/* Oikos Onboarding Portal — brand stylesheet
 * Palette
 *   Forest (primary)    #1F3A2B
 *   Deep forest (hover) #152A1F
 *   Clay (accent)       #C87F5C
 *   Cream (bg)          #FAF6EF
 *   Charcoal (text)     #1A1A1A
 *   Sand (surface)      #F1EADC
 *   Line                #E4DBC8
 */

:root {
  --forest: #1f3a2b;
  --forest-deep: #152a1f;
  --clay: #c87f5c;
  --clay-deep: #a86343;
  --cream: #faf6ef;
  --sand: #f1eadc;
  --line: #e4dbc8;
  --charcoal: #1a1a1a;
  --muted: #6b6658;
  --error: #a23226;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(26, 26, 26, 0.04), 0 8px 30px rgba(31, 58, 43, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, legend {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--forest);
}

h1 { font-size: 2rem; margin: 0 0 0.4rem; }
p.lede { color: var(--muted); margin: 0; font-size: 1.05rem; }
em { color: var(--clay); font-style: italic; }

/* ---------- topbar ---------- */
.topbar {
  background: var(--forest);
  color: var(--cream);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(250, 246, 239, 0.25);
  border-radius: 8px;
}
.brand-name {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1;
}
.brand-sub {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(250, 246, 239, 0.7);
  margin-top: 2px;
}
.topbar-right {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(250, 246, 239, 0.7);
}

/* ---------- shell ---------- */
.shell {
  max-width: 820px;
  margin: 2.5rem auto 3rem;
  padding: 0 1.25rem;
}

/* ---------- stepper ---------- */
.stepper ol {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.stepper li {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  gap: 0.4rem;
}
/* connector line between steps */
.stepper li:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 11px;
  left: calc(50% + 12px);
  right: calc(-50% + 12px);
  height: 1.5px;
  background: var(--line);
  transition: background 0.25s;
}
.stepper li.done:not(:last-child)::after {
  background: var(--forest);
}
.stepper .dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  border: 2px solid var(--line);
  background: var(--cream);
  color: var(--muted);
  position: relative;
  z-index: 1;
  transition: all 0.2s;
}
.stepper li.done .dot {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--cream);
  font-size: 0;           /* hide number, show check via content */
}
.stepper li.done .dot::after {
  content: '✓';
  font-size: 0.65rem;
  color: var(--cream);
}
.stepper li.active .dot {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--cream);
  box-shadow: 0 0 0 3px rgba(200,127,92,0.18);
}
.stepper .label {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
  opacity: 0.6;
  transition: opacity 0.2s, color 0.2s;
}
.stepper li.active .label {
  color: var(--charcoal);
  opacity: 1;
  font-weight: 500;
}
.stepper li.done .label {
  color: var(--forest);
  opacity: 0.75;
}
@media (max-width: 480px) {
  .stepper .label { display: none; }
  .stepper li.active .label { display: block; }
}

/* ---------- panel ---------- */
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 2rem 1.75rem;
  box-shadow: var(--shadow);
}
.panel.hidden { display: none; }
.panel-head { margin-bottom: 1.5rem; }
.panel-head.center { text-align: center; }

/* ---------- form ---------- */
.form fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1.75rem;
}
.form legend {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.form .hint {
  color: var(--muted);
  font-size: 0.88rem;
  margin: -0.25rem 0 0.75rem;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1rem;
}
.grid-2 .span-2 { grid-column: 1 / -1; }
@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2 .span-2 { grid-column: auto; }
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.form input,
.form select,
.form textarea {
  font: inherit;
  color: var(--charcoal);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  transition: border-color 0.15s, background 0.15s;
}
.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--forest);
  background: #fff;
}

/* ---------- repeater cards ---------- */
.repeater { display: flex; flex-direction: column; gap: 1rem; }
.rep-card {
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1rem 0.75rem;
  position: relative;
}
.rep-card h4 {
  margin: 0 0 0.75rem;
  font-family: "Fraunces", serif;
  font-weight: 600;
  color: var(--forest);
  font-size: 1rem;
}
.rep-card .remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
}
.rep-card .remove:hover { color: var(--error); }

/* ---------- buttons ---------- */
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
button.primary {
  background: var(--forest);
  color: var(--cream);
  border: 0;
  padding: 0.85rem 1.25rem;
  font: inherit;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
button.primary:hover { background: var(--forest-deep); }
button.primary:active { transform: translateY(1px); }
button.primary:disabled { background: #9aa89d; cursor: not-allowed; }

button.ghost {
  background: transparent;
  color: var(--clay);
  border: 1px dashed var(--clay);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
button.ghost:hover { background: rgba(200, 127, 92, 0.08); }

/* ---------- W9 upload ---------- */
.w9-instructions {
  margin-bottom: 1.25rem;
}
.w9-instructions details {
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.w9-instructions summary {
  cursor: pointer;
  color: var(--forest);
  font-weight: 500;
  user-select: none;
}
.w9-instructions p { margin: 0.5rem 0 0; }

.upload-zone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--sand);
  padding: 2.5rem 1.5rem;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  margin-bottom: 1rem;
}
.upload-zone.drag-over {
  border-color: var(--forest);
  background: #e9f0ea;
}
.upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  pointer-events: none;
}
.upload-icon { font-size: 2rem; }
.upload-prompt { font-size: 0.95rem; }
.upload-prompt strong { color: var(--forest); }
.upload-hint { font-size: 0.8rem; }
.upload-selected {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--forest);
  font-weight: 500;
}
.upload-selected.hidden { display: none; }
button.ghost.small { padding: 0.2rem 0.5rem; font-size: 0.78rem; }
.quiet { color: var(--muted); }

/* ---------- signwell ---------- */
.signwell-frame {
  width: 100%;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sand);
  overflow: hidden;
  margin-bottom: 1rem;
}
.signwell-frame iframe { width: 100%; height: 600px; border: 0; display: block; }
.signwell-placeholder {
  height: 100%;
  min-height: 520px;
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 2rem;
  text-align: center;
}

/* ---------- payment ---------- */
.fee-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--forest), var(--forest-deep));
  color: var(--cream);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
.fee-label {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(250, 246, 239, 0.7);
}
.fee-amount {
  font-family: "Fraunces", serif;
  font-size: 2rem;
  font-weight: 600;
  margin-top: 0.25rem;
}
.fee-note { font-size: 0.82rem; color: rgba(250, 246, 239, 0.7); }

#payment-element {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.error {
  color: var(--error);
  font-size: 0.88rem;
  min-height: 1.2em;
  margin-top: 0.5rem;
}

/* ---------- complete ---------- */
.seal {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--forest);
  color: var(--cream);
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-family: "Fraunces", serif;
}
.summary {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--muted);
}
.summary h3 {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}
.summary ul { margin: 0; padding-left: 1.1rem; }

/* ---------- footer ---------- */
.footer {
  max-width: 820px;
  margin: 0 auto 2rem;
  padding: 0 1.25rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}
.footer .quiet { font-style: italic; }

/* ---------- complete screen resources ---------- */
.resource-list { display: flex; flex-direction: column; gap: 10px; }
.resource-download,
.resource-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line, #e4dbc8);
  border-radius: 8px;
  text-decoration: none;
  color: var(--fg, #1a1a1a);
  background: var(--surface, #f1eadc);
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.resource-download:hover,
.resource-link:hover {
  border-color: var(--accent, #c87f5c);
  background: var(--bg, #faf6ef);
}
.resource-download { font-weight: 600; }
.resource-icon { font-size: 18px; flex-shrink: 0; }
.resource-arrow { margin-left: auto; color: var(--muted, #888); flex-shrink: 0; }
