/* ==========================================================================
   SynMed Care — HIPAA Authorization & Consent form
   Shares the SynMedCare design language (forest green + lime, Plus Jakarta
   Sans) with the main site; light, premium form surfaces for readability.
   ========================================================================== */
:root {
  --forest-950: #021d0b;
  --forest-900: #073902;
  --forest-800: #0b4b18;
  --forest-700: #166702;
  --green-600: #24a148;
  --green-500: #35b85b;
  --lime-200: #e2f0c6;
  --lime-100: #f1f7e6;
  --paper: #ffffff;
  --ink: #071b10;
  --muted: #657369;
  --line: #e4e9e2;
  --soft: #f4f7f2;
  --amber: #e8a740;
  --danger: #c84a4a;
  --app-bg: #eef2ea;
  --field-bg: #f5f8f3;
  --field-border: #e3e9e0;
  --ring: 0 0 0 4px rgba(36, 161, 72, 0.16);
  --radius-sm: 14px;
  --radius-md: 22px;
  --shadow-card: 0 1px 2px rgba(2, 29, 11, 0.05), 0 10px 26px -8px rgba(2, 29, 11, 0.12);
  --ease: 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--app-bg); }
body { min-height: 100dvh; background: var(--app-bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid var(--green-500); outline-offset: 3px;
}

svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- chrome ---------- */
.site-top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: calc(env(safe-area-inset-top, 0px) + 1rem) 1.2rem 1rem;
  background: linear-gradient(180deg, var(--forest-900), var(--forest-800));
  box-shadow: 0 6px 20px -10px rgba(2, 29, 11, 0.5);
}
.brand img { height: 30px; width: auto; display: block; }
.secure-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--lime-200); font-size: 0.74rem; font-weight: 700;
}
.secure-badge svg { width: 15px; height: 15px; }

.wrap { max-width: 680px; margin: 0 auto; padding: 1.2rem 1.1rem 3rem; }
.step { display: none; }
.step.active { display: block; animation: rise 320ms cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.site-foot {
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  padding: 1.4rem 1.2rem calc(env(safe-area-inset-bottom, 0px) + 1.4rem);
  color: var(--muted); font-size: 0.74rem; text-align: center;
}

/* ---------- choose ---------- */
.hero-card {
  background: linear-gradient(150deg, var(--forest-900), var(--forest-800));
  border-radius: var(--radius-md); padding: 1.8rem 1.5rem; margin-bottom: 1.6rem;
  box-shadow: var(--shadow-card);
}
.eyebrow {
  display: inline-block; color: var(--lime-200); font-size: 0.7rem; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.5rem;
}
.hero-card h1 { color: #fff; font-size: clamp(1.5rem, 5vw, 2rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
.lede { color: rgba(241, 247, 230, 0.82); font-size: 0.92rem; line-height: 1.6; margin-top: 0.7rem; }

.q { font-size: 1.05rem; font-weight: 800; margin-bottom: 0.8rem; }
.choices { display: flex; flex-direction: column; gap: 0.7rem; }
.choice {
  display: flex; align-items: center; gap: 0.85rem; text-align: left;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card); padding: 1rem; color: var(--ink);
  transition: transform var(--ease), border-color var(--ease);
}
.choice:hover { border-color: var(--green-500); }
.choice:active { transform: scale(0.99); }
.choice-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 42px; height: 42px; border-radius: 12px; background: var(--lime-100); color: var(--forest-700);
}
.choice-icon svg { width: 20px; height: 20px; }
.choice-main { flex: 1; min-width: 0; }
.choice-main strong { display: block; font-size: 0.9rem; font-weight: 800; line-height: 1.3; }
.choice-main small { display: block; font-size: 0.76rem; color: var(--muted); margin-top: 0.15rem; line-height: 1.45; }
.chev { color: var(--muted); flex: none; }
.chev svg { width: 18px; height: 18px; }

.privacy-foot {
  display: flex; align-items: center; justify-content: center; gap: 0.45rem;
  color: var(--muted); font-size: 0.76rem; line-height: 1.5; margin-top: 1.4rem; text-align: center;
}
.privacy-foot svg { width: 15px; height: 15px; flex: none; color: var(--green-600); }
.privacy-foot.small { margin-top: 0.9rem; font-size: 0.72rem; }

/* ---------- form ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 0.45rem; background: none;
  color: var(--forest-700); font-size: 0.84rem; font-weight: 700; padding: 0.5rem 0; margin-bottom: 0.6rem;
}
.back-link svg { width: 16px; height: 16px; }

.form-card {
  background: var(--paper); border-radius: var(--radius-md); box-shadow: var(--shadow-card);
  padding: 1.5rem 1.3rem;
}
.form-title { font-size: 1.15rem; font-weight: 800; line-height: 1.25; margin-bottom: 1rem; }

.f-h {
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--forest-700); margin: 1.3rem 0 0.5rem;
}
.f-p { font-size: 0.87rem; line-height: 1.6; color: #2a3a30; margin-bottom: 0.7rem; }
.f-note {
  font-size: 0.82rem; line-height: 1.6; color: var(--muted); font-style: italic; margin-bottom: 0.9rem;
}
.f-ul { margin: 0 0 0.9rem 1.1rem; }
.f-ul li { font-size: 0.85rem; line-height: 1.6; color: #2a3a30; margin-bottom: 0.25rem; }

.field { display: block; margin-bottom: 0.95rem; }
.field > span { display: block; font-size: 0.8rem; font-weight: 700; color: var(--forest-800); margin-bottom: 0.4rem; }
.req { font-style: normal; font-size: 0.68rem; font-weight: 700; color: var(--amber); text-transform: uppercase; letter-spacing: 0.04em; margin-left: 0.3rem; }

.input-shell {
  display: flex; align-items: center; border: 1.5px solid var(--field-border);
  border-radius: var(--radius-sm); background: var(--field-bg); padding: 0 1rem;
  transition: border-color var(--ease), background var(--ease), box-shadow var(--ease);
}
.input-shell:focus-within { border-color: var(--green-600); background: #fff; box-shadow: var(--ring); }
.input-shell input {
  flex: 1; min-width: 0; min-height: 52px; border: 0; background: none; outline: none;
  font-size: 1rem; color: var(--ink);
}
.input-shell input::placeholder { color: var(--muted); opacity: 0.75; }

.area {
  width: 100%; border: 1.5px solid var(--field-border); border-radius: var(--radius-sm);
  background: var(--field-bg); color: var(--ink); padding: 0.8rem 0.95rem;
  font-size: 1rem; line-height: 1.55; resize: vertical; outline: none;
  transition: border-color var(--ease), background var(--ease), box-shadow var(--ease);
}
.area::placeholder { color: var(--muted); opacity: 0.75; }
.area:focus { border-color: var(--green-600); background: #fff; box-shadow: var(--ring); }

.f-checks { margin-bottom: 1rem; }
.tick {
  display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.6rem 0.7rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
  margin-bottom: 0.4rem; font-size: 0.85rem; line-height: 1.45; color: var(--ink); cursor: pointer;
}
.tick input { margin-top: 0.15rem; width: 18px; height: 18px; accent-color: var(--green-600); flex: none; }
.tick:hover { border-color: var(--green-500); }
.tick.agree { background: var(--lime-100); border-color: var(--lime-200); font-weight: 600; margin-bottom: 0.8rem; }

/* signature */
.sig-block { margin-bottom: 1.1rem; }
.sig-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.8rem; font-weight: 700; color: var(--forest-800); margin-bottom: 0.5rem;
}
.sig-clear { background: none; color: var(--green-600); font-size: 0.78rem; font-weight: 700; text-decoration: underline; padding: 0.3rem 0.2rem; }
.sig-pad-wrap {
  position: relative; background: #fff; border: 1.5px solid var(--field-border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.sig-pad-wrap.filled { border-color: var(--green-500); }
.sig-pad-wrap canvas { display: block; width: 100%; height: 190px; touch-action: none; cursor: crosshair; }
.sig-guide { position: absolute; left: 1rem; right: 1rem; bottom: 2.4rem; border-bottom: 1.5px dashed #c7d3c1; pointer-events: none; }
.sig-guide-x { position: absolute; left: 1rem; bottom: 2.5rem; color: #a9b7a3; font-size: 1.1rem; pointer-events: none; }
.sig-pad-wrap.filled .sig-guide, .sig-pad-wrap.filled .sig-guide-x { opacity: 0; }

/* ---------- actions ---------- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 54px; padding: 0.9rem 1.5rem; border-radius: 999px;
  background: linear-gradient(135deg, var(--green-500), var(--forest-700));
  color: #fff; font-weight: 800; font-size: 1rem; text-decoration: none;
  box-shadow: 0 14px 30px rgba(36, 161, 72, 0.32);
  transition: transform var(--ease), filter var(--ease);
}
.btn-primary svg { width: 18px; height: 18px; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { filter: saturate(0.4) brightness(0.95); cursor: default; }
.submit-btn { width: 100%; margin-top: 1.2rem; }

.form-error {
  background: rgba(200, 74, 74, 0.1); border: 1px solid rgba(200, 74, 74, 0.35);
  color: var(--danger); border-radius: var(--radius-sm); padding: 0.75rem 0.9rem;
  font-size: 0.85rem; font-weight: 600; line-height: 1.45; margin-top: 1rem;
}

/* ---------- done ---------- */
.done-card {
  background: var(--paper); border-radius: var(--radius-md); box-shadow: var(--shadow-card);
  padding: 2.4rem 1.6rem; text-align: center; margin-top: 2rem;
}
.done-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 50%; background: var(--lime-100);
  color: var(--green-600); margin-bottom: 1.1rem;
}
.done-mark svg { width: 30px; height: 30px; stroke-width: 2.5; }
.done-card h2 { font-size: 1.25rem; font-weight: 800; line-height: 1.25; }
.done-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.6; margin-top: 0.7rem; }
.done-ref { font-family: monospace; font-size: 0.78rem !important; color: var(--forest-700) !important; }
.done-card .btn-primary { margin-top: 1.4rem; }

/* ---------- busy ---------- */
.busy {
  position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.9rem;
  background: rgba(2, 22, 9, 0.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  color: var(--lime-100); font-weight: 700;
}
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3.5px solid rgba(226, 240, 198, 0.25); border-top-color: var(--green-500);
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
