/* ============================================================
   MYSA Forms — Design System
   ============================================================ */

@import url('https://rsms.me/inter/inter.css');

:root {
  --mysa-green: #1F7A3A;
  --mysa-green-hover: #196530;
  --mysa-green-light: #E8F4ED;
  --mysa-green-tint: rgba(31, 122, 58, 0.08);

  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --surface-2: #F5F5F1;
  --border: #E5E5DF;
  --border-strong: #D4D4CC;
  --text: #1A1A17;
  --text-muted: #6B6B66;
  --text-subtle: #9A9A93;

  --danger: #B91C1C;
  --danger-bg: #FEF2F2;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-feature: 'cv11', 'ss01', 'ss03';

  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.25rem; --sp-6: 1.5rem; --sp-8: 2rem; --sp-10: 2.5rem;
  --sp-12: 3rem; --sp-16: 4rem;

  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-full: 9999px;

  --sh-sm: 0 1px 2px rgba(20,20,15,.04), 0 1px 1px rgba(20,20,15,.02);
  --sh-md: 0 4px 12px rgba(20,20,15,.06), 0 1px 2px rgba(20,20,15,.03);
  --sh-lg: 0 12px 32px rgba(20,20,15,.08), 0 2px 6px rgba(20,20,15,.04);
  --sh-focus: 0 0 0 3px rgba(31,122,58,.18);

  --t-fast: 120ms cubic-bezier(.4,0,.2,1);
  --t-base: 180ms cubic-bezier(.4,0,.2,1);

  --content-max: 720px;
  --content-narrow: 480px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F0F0E;
    --surface: #1A1A18;
    --surface-2: #232321;
    --border: #2E2E2B;
    --border-strong: #3A3A37;
    --text: #F0F0EC;
    --text-muted: #A8A8A2;
    --text-subtle: #6B6B66;
    --mysa-green-light: rgba(31,122,58,.15);
    --mysa-green-tint: rgba(31,122,58,.12);
    --danger-bg: rgba(185,28,28,.1);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-feature-settings: var(--font-feature);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@supports (font-variation-settings: normal) { body { font-family: 'Inter var', var(--font-sans); } }

img { max-width: 100%; display: block; }

.shell { flex: 1; display: flex; flex-direction: column; }

.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  padding: var(--sp-4) var(--sp-6);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
}

.site-header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.brand { display: flex; align-items: center; gap: var(--sp-3); text-decoration: none; color: var(--text); }

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--mysa-green);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-logo img { width: 100%; height: 100%; object-fit: cover; }

.brand-name { font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.01em; }

.brand-tag {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.brand-tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mysa-green);
  display: inline-block;
}

.site-main { flex: 1; padding: var(--sp-12) var(--sp-6) var(--sp-16); }
.site-main-narrow { max-width: var(--content-narrow); margin: 0 auto; }
.site-main-wide   { max-width: var(--content-max);    margin: 0 auto; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-6);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-subtle);
  background: var(--surface);
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mysa-green);
  margin-bottom: var(--sp-3);
}

.h1 {
  font-size: clamp(1.875rem, 1.4rem + 1.6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 var(--sp-3);
}

.h2 { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 var(--sp-3); }

.lede { font-size: 1.0625rem; color: var(--text-muted); line-height: 1.55; margin: 0 0 var(--sp-8); }

.muted { color: var(--text-muted); }

.option-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--t-base), transform var(--t-fast), box-shadow var(--t-base);
  cursor: pointer;
  position: relative;
}

.option-card:hover {
  border-color: var(--mysa-green);
  transform: translateY(-1px);
  box-shadow: var(--sh-md);
}

.option-card:focus-visible {
  outline: none;
  border-color: var(--mysa-green);
  box-shadow: var(--sh-focus);
}

.option-card-header { display: flex; align-items: flex-start; gap: var(--sp-4); margin-bottom: var(--sp-3); }

.option-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--mysa-green-tint);
  color: var(--mysa-green);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.option-card-icon svg { width: 22px; height: 22px; }

.option-card-title { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.option-card-desc  { color: var(--text-muted); margin: 0; font-size: 0.9375rem; line-height: 1.55; }

.option-card-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--mysa-green);
}

.option-card-cta svg { width: 14px; height: 14px; transition: transform var(--t-fast); }
.option-card:hover .option-card-cta svg { transform: translateX(3px); }

.option-list { display: grid; gap: var(--sp-4); }

.field { margin-bottom: var(--sp-5); }

.label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: var(--sp-2); color: var(--text); }

.input {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder { color: var(--text-subtle); }
.input:hover { border-color: var(--text-subtle); }
.input:focus { outline: none; border-color: var(--mysa-green); box-shadow: var(--sh-focus); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary { background: var(--mysa-green); color: white; border-color: var(--mysa-green); }
.btn-primary:hover:not(:disabled) { background: var(--mysa-green-hover); border-color: var(--mysa-green-hover); }
.btn-primary:focus-visible { outline: none; box-shadow: var(--sh-focus); }

.btn-block { width: 100%; }
.btn-lg { padding: var(--sp-4) var(--sp-6); font-size: 1rem; }

.alert {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin-bottom: var(--sp-5);
  border: 1px solid transparent;
}

.alert-error { background: var(--danger-bg); border-color: rgba(185,28,28,.2); color: var(--danger); }

.unlock-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-10) var(--sp-8);
  box-shadow: var(--sh-sm);
}

.unlock-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--sp-5);
  background: var(--mysa-green-tint);
  color: var(--mysa-green);
  border-radius: var(--r-full);
  display: grid;
  place-items: center;
}

.unlock-icon svg { width: 22px; height: 22px; }

.unlock-title { text-align: center; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.hidden { display: none !important; }

/* ---------- Logo-forward header ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  height: 32px;
  width: auto;
  display: block;
}

.brand-name { display: none; }

.site-header { padding: var(--sp-3) var(--sp-6); }

@media (max-width: 540px) {
  .site-header-inner { gap: var(--sp-2); }
  .brand-mark { height: 28px; }
  .brand-tag { font-size: 0.75rem; }
}

/* ---------- Forms ---------- */
.field-row {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
}

.label-required::after {
  content: '*';
  color: var(--mysa-green);
  margin-left: 4px;
}

.help {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--sp-2);
  line-height: 1.5;
}

.textarea {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  min-height: 140px;
  resize: vertical;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}

.textarea::placeholder { color: var(--text-subtle); }
.textarea:focus { outline: none; border-color: var(--mysa-green); box-shadow: var(--sh-focus); }

.checkbox, .radio {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}

.checkbox:hover, .radio:hover { border-color: var(--text-subtle); }

.checkbox input, .radio input {
  width: 18px; height: 18px;
  margin: 2px 0 0 0;
  flex-shrink: 0;
  accent-color: var(--mysa-green);
  cursor: pointer;
}

.checkbox-label, .radio-label { font-size: 0.9375rem; line-height: 1.45; display: block; font-weight: 500; }
.checkbox-desc, .radio-desc { font-size: 0.8125rem; color: var(--text-muted); margin-top: var(--sp-1); line-height: 1.5; }

.checkbox:has(input:checked), .radio:has(input:checked) {
  border-color: var(--mysa-green);
  background: var(--mysa-green-tint);
}

.radio-group { display: grid; gap: var(--sp-3); }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: var(--sp-10) var(--sp-6);
  text-align: center;
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--mysa-green);
  background: var(--mysa-green-tint);
}

.dropzone-icon { width: 36px; height: 36px; margin: 0 auto var(--sp-3); color: var(--mysa-green); }
.dropzone-text { font-weight: 500; margin-bottom: var(--sp-1); font-size: 0.9375rem; }
.dropzone-hint { font-size: 0.8125rem; color: var(--text-muted); }

.file-list { margin-top: var(--sp-4); display: grid; gap: var(--sp-2); }

.file-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.875rem;
}

.file-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-size { color: var(--text-muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; flex-shrink: 0; }

.file-item-progress {
  width: 90px;
  height: 4px;
  background: var(--border);
  border-radius: var(--r-full);
  overflow: hidden;
  flex-shrink: 0;
}

.file-item-progress-bar {
  height: 100%;
  background: var(--mysa-green);
  width: 0;
  transition: width 200ms linear;
}

.file-item-status { font-size: 0.75rem; color: var(--text-muted); width: 70px; text-align: right; flex-shrink: 0; }
.file-item-status.is-done { color: var(--mysa-green); }
.file-item-status.is-error { color: var(--danger); }

.file-item-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--sp-1);
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
}

.file-item-remove svg { width: 16px; height: 16px; }
.file-item-remove:hover { color: var(--danger); background: var(--danger-bg); }

/* Buttons (extras) */
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--text-subtle);
  background: var(--surface-2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }

.btn-row {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-8);
  align-items: center;
  flex-wrap: wrap;
}

.btn-row-between { justify-content: space-between; }

/* Stepper for communication form */
.stepper {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: var(--sp-4) 0 var(--sp-8);
  flex-wrap: wrap;
}

.stepper-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--border-strong);
  transition: background var(--t-fast), transform var(--t-fast);
}

.stepper-dot.is-current { background: var(--mysa-green); transform: scale(1.4); }
.stepper-dot.is-done { background: var(--mysa-green); opacity: 0.5; }

.step-meta {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
  font-variant-numeric: tabular-nums;
}

/* Privacy block */
.privacy-block {
  background: var(--mysa-green-tint);
  border: 1px solid color-mix(in srgb, var(--mysa-green) 25%, transparent);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  margin-bottom: var(--sp-6);
}

.privacy-block ul { margin: var(--sp-3) 0; padding-left: var(--sp-5); }
.privacy-block li { margin-bottom: var(--sp-1); color: var(--text); }

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: var(--sp-6);
  padding: var(--sp-2) 0;
}

.back-link:hover { color: var(--text); }
.back-link svg { width: 14px; height: 14px; }

/* Success screen */
.success-screen { text-align: center; padding: var(--sp-8) 0; }

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--sp-6);
  background: var(--mysa-green-light);
  color: var(--mysa-green);
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.success-icon svg { width: 32px; height: 32px; }

.success-meta {
  display: inline-block;
  margin-top: var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  background: var(--surface-2);
  border-radius: var(--r-md);
  font-family: ui-monospace, SF Mono, Menlo, monospace;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.alert-info { background: var(--surface-2); border-color: var(--border); color: var(--text-muted); }
.alert-success { background: var(--mysa-green-light); border-color: rgba(31,122,58,.2); color: var(--mysa-green); }
