/* ── fonts ─────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/static/fonts/CormorantGaramond-normal-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/static/fonts/CormorantGaramond-normal-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('/static/fonts/Outfit-normal-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('/static/fonts/Outfit-normal-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('/static/fonts/Outfit-normal-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}

/* ── tokens ────────────────────────────────────────────────────── */
:root {
  --color-obsidian:   #0e1a0e;
  --color-graphite:   #2e422e;
  --color-warm-gray:  #567438;
  --color-sand:       #A8C298;
  --color-cream:      #EEF4E8;
  --color-ivory:      #F5F9F0;
  --color-gold:       #5A8A4A;
  --color-gold-light: #7AAA6A;
  --color-gold-faint: rgba(90, 138, 74, 0.08);

  /* ── neutral surface tokens (green pulled back to accent only) ── */
  --surface-paper:    #fbfaf7;   /* page background — warm white, not green */
  --surface-card:     #ffffff;   /* card / form panel */
  --border-hairline:  #e0dbd2;   /* input borders at rest */
  --text-strong:      #2a2520;   /* labels, body text */
  --text-soft:        #7a736a;   /* muted labels, hints */

  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body:    'Outfit', 'Helvetica Neue', sans-serif;

  --radius:  10px;
  --shadow:  0 1px 4px rgba(14,26,14,.06);
  --error:   #b83232;
  --error-bg:#fdf2f2;
}

/* ── reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

/* ── base ──────────────────────────────────────────────────────── */
body {
  background: var(--surface-paper);
  color: var(--text-strong);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  min-height: 100vh;
}

/* ── layout ────────────────────────────────────────────────────── */
.page-wrap {
  max-width: 540px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ── header ────────────────────────────────────────────────────── */
.site-header {
  text-align: center;
  padding: 3rem 0 2.5rem;
}
.site-header h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 400;
  color: var(--color-obsidian);
  letter-spacing: .01em;
  line-height: 1.15;
}
.site-header .tagline {
  color: var(--color-warm-gray);
  font-size: .875rem;
  margin-top: .5rem;
  letter-spacing: .03em;
}

/* ── card ──────────────────────────────────────────────────────── */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.25rem;
}

/* ── verify state ──────────────────────────────────────────────── */
#state-verify .verify-heading {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-graphite);
  margin-bottom: .5rem;
}
#state-verify .verify-intro {
  color: var(--color-warm-gray);
  font-size: .9375rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ── QR panel ─────────────────────────────────────────────────── */
.qr-panel {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-sand);
  text-align: center;
}
.qr-panel .qr-label {
  font-size: .8125rem;
  color: var(--color-warm-gray);
  letter-spacing: .03em;
  margin-bottom: .875rem;
}
.qr-panel img {
  border-radius: 8px;
  border: 1px solid var(--color-sand);
  background: #fff;
  padding: 6px;
}

/* ── buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .1s;
  text-decoration: none;
  line-height: 1;
}
.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--color-gold);
  color: #fff;
  width: 100%;
}
.btn-primary:hover { background: var(--color-graphite); box-shadow: 0 3px 10px rgba(90,138,74,.25); }

.btn-wa {
  background: #25D366;
  color: #fff;
  width: 100%;
  font-size: 1rem;
}
.btn-wa:hover { background: #1da851; }
.btn-wa svg { width: 22px; height: 22px; flex-shrink: 0; }

.btn-ghost {
  background: transparent;
  color: var(--color-gold);
  border: 1px solid var(--color-sand);
  padding: .5rem 1rem;
  font-size: .875rem;
}
.btn-ghost:hover { background: var(--color-gold-faint); border-color: var(--color-gold); }

/* ── status pill ───────────────────────────────────────────────── */
.status-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: 1rem;
  font-size: .875rem;
  color: var(--color-warm-gray);
}
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-gold-light);
  flex-shrink: 0;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(.65); }
}

/* ── copy link ─────────────────────────────────────────────────── */
.copy-link-row {
  margin-top: 1rem;
  display: flex;
  gap: .5rem;
  align-items: center;
}
.copy-link-row .copy-label {
  font-size: .75rem;
  color: var(--color-warm-gray);
  white-space: nowrap;
}
.copy-link-row input {
  flex: 1;
  padding: .4rem .65rem;
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: .72rem;
  color: var(--text-strong);
  background: var(--surface-paper);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.copy-link-row input:read-only { cursor: default; }

/* ── form state ────────────────────────────────────────────────── */
.phone-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--color-gold-faint);
  color: var(--color-graphite);
  font-weight: 600;
  font-size: .85rem;
  padding: .3rem .85rem;
  border-radius: 20px;
  border: 1px solid var(--color-sand);
  margin-bottom: .9rem;
}
.phone-chip svg { width: 13px; height: 13px; }
.phone-chip-sub {
  font-size: .8125rem;
  color: var(--color-warm-gray);
  margin-top: .1rem;
}

/* ── section labels ────────────────────────────────────────────── */
.form-section-label {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--color-obsidian);
  margin: 1.25rem 0 1rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border-hairline);
}
.card > .form-section-label:first-child { margin-top: 0; }

/* ── fields ─────────────────────────────────────────────────────── */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: .35rem;
  letter-spacing: .01em;
}
.field label .req { color: var(--error); margin-left: 2px; }

.field input,
.field select,
.field textarea {
  display: block;
  width: 100%;
  padding: .65rem .85rem;
  border: 1px solid var(--border-hairline);
  border-radius: 7px;
  font-size: .9375rem;
  font-family: var(--font-body);
  color: var(--text-strong);
  background: #ffffff;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(90,138,74,.12);
}
.field textarea { resize: vertical; min-height: 76px; }
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23567438' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2rem;
}

.field .hint {
  display: inline-block;
  font-size: .78rem;
  color: var(--text-soft);
  font-weight: 500;
  margin-top: .25rem;
}
.field .hint.muted { color: var(--text-soft); }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

/* toggle */
.toggle-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem 0;
}
.toggle-row label { margin: 0; font-size: .875rem; font-weight: 500; color: var(--color-warm-gray); }
.toggle-row input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--color-gold); cursor: pointer; }

/* file upload */
.file-upload-area {
  border: 1px dashed var(--color-sand);
  border-radius: 8px;
  padding: .9rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  position: relative;
}
.file-upload-area:hover,
.file-upload-area.has-file {
  border-color: var(--color-gold);
  background: var(--color-gold-faint);
}
.file-upload-area input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.file-upload-area .upload-label {
  font-size: .8125rem;
  color: var(--color-warm-gray);
  pointer-events: none;
}
.file-upload-area .upload-label strong { color: var(--color-gold); }

/* inline errors */
.field-error {
  font-size: .78rem;
  color: var(--error);
  margin-top: .2rem;
  display: none;
}
.field.has-error input,
.field.has-error select,
.field.has-error textarea,
.field.has-error .file-upload-area { border-color: var(--error); }
.field.has-error .field-error { display: block; }

/* global error box */
.error-box {
  background: var(--error-bg);
  border: 1px solid #f5c6c6;
  border-radius: 8px;
  padding: .75rem 1rem;
  font-size: .875rem;
  color: var(--error);
  margin-bottom: 1rem;
  display: none;
}
.error-box.visible { display: block; }

/* ── submit ─────────────────────────────────────────────────────── */
.btn-submit {
  background: var(--color-gold);
  color: #fff;
  width: 100%;
  padding: .875rem 1.5rem;
  font-size: 1rem;
  border-radius: 8px;
  margin-top: .5rem;
  font-family: var(--font-body);
}
.btn-submit:hover { background: var(--color-graphite); }
.btn-submit:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── hidden util ────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── upload overlay ─────────────────────────────────────────────── */
.upload-overlay {
  position: fixed;
  inset: 0;
  background: rgba(251,250,247,.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.upload-overlay.hidden { display: none; }
.upload-panel {
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  padding: 2rem 1.75rem;
  text-align: center;
  max-width: 280px;
  box-shadow: 0 8px 32px rgba(14,26,14,.1);
}
.spinner {
  width: 40px; height: 40px;
  border: 2px solid var(--color-sand);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin .9s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.upload-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--color-graphite);
  margin: 0 0 1.25rem;
}
.progress-container {
  background: var(--color-sand);
  border-radius: 6px;
  height: 4px;
  margin: 0 0 .75rem;
  overflow: hidden;
}
.progress-bar {
  background: var(--color-gold);
  height: 100%;
  width: 0%;
  transition: width .2s ease;
}
.progress-text {
  font-size: .8rem;
  color: var(--color-warm-gray);
  margin: 0;
}

/* ── footer ─────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  font-size: .75rem;
  color: var(--color-sand);
  padding-top: 2rem;
  letter-spacing: .02em;
}

/* ── success page ───────────────────────────────────────────────── */
.success-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 3rem 1rem;
}
.success-check {
  width: 52px; height: 52px;
  border: 1.5px solid var(--color-sand);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.75rem;
  color: var(--color-gold);
}
.success-wrap h1 {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 400;
  color: var(--color-obsidian);
  margin-bottom: .75rem;
}
.success-wrap p {
  color: var(--color-warm-gray);
  font-size: .9375rem;
  max-width: 320px;
  line-height: 1.7;
}
