:root {
  --brand-emerald: #064E3B;
  --brand-teal: #14B8A6;
  --brand-cream: #FEF3C7;
  --surface-stone: #FAFAF9;
  --surface-white: #ffffff;
  --surface-muted: #f8f9fa;
  --border-stone: #E7E5E4;
  --border-muted: #e5e7eb;
  --border-subtle: #f1f3f5;
  --text-body: #111827;
  --text-label: #374151;
  --text-muted: #6b7280;
  --danger: #dc3545;
  --success: #198754;
  --shadow-brand: 0 4px 14px rgba(6, 78, 59, 0.3);
  --shadow-brand-hover: 0 6px 20px rgba(6, 78, 59, 0.4);
  --radius-input: 10px;
  --radius-button: 12px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text-body);
  background: var(--surface-stone);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Shell ---------- */

.shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Brand panel ---------- */

.brand-panel {
  width: 440px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--brand-emerald) 0%, var(--brand-teal) 100%);
  color: #fff;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
}

.brand-decor {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.brand-decor--top {
  width: 420px;
  height: 420px;
  background: rgba(255, 255, 255, 0.04);
  top: -20%;
  right: -30%;
}

.brand-decor--bottom {
  width: 280px;
  height: 280px;
  background: rgba(255, 255, 255, 0.03);
  bottom: -10%;
  left: -20%;
}

.brand-logo {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
}

.brand-logo i {
  color: var(--brand-cream);
  font-size: 22px;
}

.brand-pitch {
  position: relative;
  margin-top: 64px;
}

.brand-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 14px;
}

.brand-headline {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.15;
  margin: 0;
}

.brand-headline-accent {
  color: var(--brand-cream);
}

.brand-lede {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.7);
  margin: 18px 0 0;
  max-width: 340px;
}

.brand-foot {
  position: relative;
  margin-top: auto;
}

/* Timeline */

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline__step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}

.timeline__marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.timeline__num {
  width: 26px;
  height: 26px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.timeline__check { font-size: 14px; display: none; }

.timeline__step:not(.timeline__step--last) .timeline__marker::after {
  content: "";
  display: block;
  width: 1px;
  flex: 1;
  min-height: 18px;
  background: rgba(255, 255, 255, 0.15);
  margin-top: 4px;
}

.timeline__label {
  font-size: 13.5px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  padding: 4px 0 10px;
}

/* Active step */
.brand-panel[data-stage="1"] .timeline__step[data-step="1"] .timeline__num,
.brand-panel[data-stage="2"] .timeline__step[data-step="2"] .timeline__num,
.brand-panel[data-stage="3"] .timeline__step[data-step="3"] .timeline__num {
  background: rgba(255, 255, 255, 0.25);
}
.brand-panel[data-stage="1"] .timeline__step[data-step="1"] .timeline__label,
.brand-panel[data-stage="2"] .timeline__step[data-step="2"] .timeline__label,
.brand-panel[data-stage="3"] .timeline__step[data-step="3"] .timeline__label {
  color: #fff;
  font-weight: 600;
}

/* Done step: cream background, emerald check */
.brand-panel[data-stage="2"] .timeline__step[data-step="1"] .timeline__num,
.brand-panel[data-stage="3"] .timeline__step[data-step="1"] .timeline__num,
.brand-panel[data-stage="3"] .timeline__step[data-step="2"] .timeline__num {
  background: var(--brand-cream);
  color: var(--brand-emerald);
}
.brand-panel[data-stage="2"] .timeline__step[data-step="1"] .timeline__n,
.brand-panel[data-stage="3"] .timeline__step[data-step="1"] .timeline__n,
.brand-panel[data-stage="3"] .timeline__step[data-step="2"] .timeline__n {
  display: none;
}
.brand-panel[data-stage="2"] .timeline__step[data-step="1"] .timeline__check,
.brand-panel[data-stage="3"] .timeline__step[data-step="1"] .timeline__check,
.brand-panel[data-stage="3"] .timeline__step[data-step="2"] .timeline__check {
  display: inline-block;
}

.brand-badges {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.brand-badges i { margin-right: 4px; }

/* ---------- Content ---------- */

.content {
  flex: 1;
  overflow: auto;
  min-width: 0;
}

.content-inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 40px;
}

.content-inner--narrow {
  max-width: 460px;
  padding-top: 80px;
}

.view--center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  flex-direction: column;
  gap: 16px;
}

.view[hidden] { display: none; }

.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  margin: 0 0 6px;
  color: var(--text-body);
}

.page-title--center {
  text-align: center;
  font-size: 30px;
  margin: 0 0 12px;
}

.page-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 28px;
  line-height: 1.6;
}

.page-sub--center {
  text-align: center;
  font-size: 14.5px;
  line-height: 1.65;
  margin: 0 0 28px;
}

.muted {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

/* ---------- Form ---------- */

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-label);
  margin-bottom: 6px;
}

.req { color: var(--danger); }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-stone);
  border-radius: var(--radius-input);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface-white);
  color: var(--text-body);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input.mono,
.field textarea.mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.field input[readonly] {
  background: var(--surface-muted);
  color: var(--text-label);
  cursor: default;
}

.hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

.consent {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

.form-error {
  background: rgba(220, 53, 69, 0.08);
  color: var(--danger);
  border: 1px solid rgba(220, 53, 69, 0.25);
  border-radius: var(--radius-input);
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- Primary button ---------- */

.btn-primary {
  background: linear-gradient(135deg, var(--brand-emerald) 0%, var(--brand-teal) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-button);
  padding: 14px 20px;
  font-weight: 600;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: var(--shadow-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-brand-hover);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-primary--inline {
  padding: 12px 22px;
  font-size: 14px;
  margin: 0 auto;
  align-self: center;
}

.btn-icon { display: inline-flex; }

/* ---------- Spinners ---------- */

.spinner,
.btn-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(20, 184, 166, 0.15);
  border-top-color: var(--brand-teal);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- State views (error / success) ---------- */

.state-icon {
  width: 72px;
  height: 72px;
  border-radius: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
  font-size: 32px;
}

.state-icon--error {
  background: rgba(220, 53, 69, 0.08);
  color: var(--danger);
}

.state-icon--success {
  background: rgba(25, 135, 84, 0.10);
  color: var(--success);
  margin-bottom: 18px;
}

.state-header { text-align: center; margin-bottom: 28px; }

.info-card {
  margin-top: 32px;
  padding: 16px;
  background: var(--surface-white);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-input);
  font-size: 13px;
  color: var(--text-muted);
  text-align: left;
  line-height: 1.6;
}

.info-card strong {
  color: var(--text-label);
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

/* ---------- Success: next steps ---------- */

.next-steps {
  background: var(--surface-white);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-button);
  padding: 20px;
}

.next-steps__kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--brand-teal);
  margin-bottom: 14px;
}

.next-steps__list { list-style: none; padding: 0; margin: 0; }

.next-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.next-step--last {
  padding-bottom: 0;
  border-bottom: none;
  margin-bottom: 0;
}

.next-step__marker {
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.next-step--done .next-step__marker {
  background: var(--brand-teal);
  color: #fff;
  font-size: 15px;
}

.next-step__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-body);
  margin-bottom: 2px;
}

.next-step__sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

.ref-row {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface-muted);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.ref-row code.mono {
  font-family: var(--font-mono);
  color: var(--text-label);
  font-weight: 500;
  background: transparent;
  padding: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 991.98px) {
  .shell { flex-direction: column; }
  .brand-panel {
    width: 100%;
    padding: 32px 24px;
    min-height: auto;
  }
  .brand-pitch { margin-top: 40px; }
  .brand-headline { font-size: 32px; }
  .brand-foot { margin-top: 32px; }
  .content-inner,
  .content-inner--narrow { padding: 32px 24px; }
  .content-inner--narrow { padding-top: 48px; }
}

@media (max-width: 575.98px) {
  .field-grid { grid-template-columns: 1fr; }
  .brand-headline { font-size: 28px; }
  .page-title { font-size: 22px; }
  .page-title--center { font-size: 24px; }
}
