/* ==========================================================================
   Telehealth Wealth Legacy | Free guide landing page
   ========================================================================== */

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

:root {
  --bg: #080614;
  --card: #110e22;
  --border: #2a1f4a;
  --purple: #7B5EA7;
  --purple-d: #5b4080;
  --lavender: #b49ddc;
  --gold: #c9a84c;
  --teal: #5BC4BF;
  --white: #f0ebff;
  --muted: #a99dce;
  --danger: #fb7185;
  --ease: cubic-bezier(0.16,1,0.3,1);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; background: var(--bg); color: var(--white); font-family: var(--sans); overflow-x: hidden; -webkit-font-smoothing: antialiased; }

body::before, body::after { content: ''; position: fixed; border-radius: 50%; filter: blur(120px); pointer-events: none; z-index: 0; }
body::before { width: 600px; height: 600px; background: radial-gradient(circle, rgba(123,94,167,.25) 0%, transparent 70%); top: -150px; left: -150px; }
body::after  { width: 500px; height: 500px; background: radial-gradient(circle, rgba(91,196,191,.15) 0%, transparent 70%); bottom: -100px; right: -100px; }

img, svg { display: block; }
ul { list-style: none; }
button, input { font: inherit; color: inherit; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ic-sm { width: 16px; height: 16px; stroke-width: 2; }
.ic-xs { width: 13px; height: 13px; stroke-width: 2; }

.dot { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; vertical-align: middle; margin: 0 5px; }

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 20px 48px;
}

.back-link {
  position: absolute;
  top: 20px; left: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 12px 7px 9px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: rgba(17,14,34,.6);
  transition: color .2s, border-color .2s;
}
.back-link:hover { color: var(--white); border-color: var(--purple); }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(123,94,167,.18);
  border: 1px solid rgba(123,94,167,.4);
  border-radius: 100px;
  padding: 6px 18px;
  font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--lavender);
  margin-bottom: 28px;
  text-align: center;
  animation: fadeUp .6s ease both;
}
.badge-dot { width: 6px; height: 6px; background: var(--teal); border-radius: 50%; animation: pulse 2s ease infinite; flex-shrink: 0; }

.hero { text-align: center; max-width: 640px; animation: fadeUp .7s .1s ease both; }

.free-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--serif); font-size: 16px; font-style: italic;
  color: var(--gold); letter-spacing: .06em; margin-bottom: 10px;
}
.free-tag svg { width: 10px; height: 10px; fill: currentColor; }

h1 { font-family: var(--serif); font-size: clamp(36px, 7vw, 58px); font-weight: 600; line-height: 1.08; margin-bottom: 14px; }
h1 em { font-style: italic; color: var(--lavender); }

.subtitle { font-size: 15px; color: var(--muted); line-height: 1.65; max-width: 480px; margin: 0 auto 32px; }

.checks { display: flex; flex-direction: column; gap: 12px; text-align: left; margin-bottom: 40px; max-width: 460px; width: 100%; animation: fadeUp .7s .2s ease both; }
.check-item { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 1.5; }
.check-icon { width: 22px; height: 22px; background: rgba(91,196,191,.15); border: 1px solid rgba(91,196,191,.4); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.check-icon svg { width: 11px; height: 11px; fill: none; stroke: var(--teal); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Card ──────────────────────────────────────────── */
.card { width: 100%; max-width: 460px; background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 36px 32px; box-shadow: 0 0 60px rgba(123,94,167,.12); }
.card[hidden] { display: none; }
#formCard { animation: fadeUp .7s .3s ease both; }
#formCard:focus { outline: none; }

.card-heading { font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--lavender); margin-bottom: 22px; text-align: center; }

.field { margin-bottom: 16px; }
label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 7px; letter-spacing: .04em; }
label .req { color: var(--teal); }
label .opt { opacity: .6; font-weight: 400; }

.input-wrap { position: relative; }
.input-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--purple); pointer-events: none; transition: color .2s; }
.input-wrap:focus-within .input-ic { color: var(--lavender); }

input {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 16px 13px 42px;
  font-size: 15px;
  color: var(--white);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
input::placeholder { color: rgba(169,157,206,.45); }
input:hover { border-color: #3b2d63; }
input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(123,94,167,.2); }
input[aria-invalid="true"] { border-color: rgba(251,113,133,.7); }

.field-error { font-size: 12px; color: var(--danger); margin-top: 6px; }
.field-error:empty { display: none; }

.form-alert { font-size: 13px; line-height: 1.5; color: var(--danger); background: rgba(251,113,133,.08); border: 1px solid rgba(251,113,133,.3); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.form-alert:empty { display: none; }

.btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--purple), var(--purple-d));
  border: none;
  border-radius: 12px;
  padding: 15px;
  font-size: 15px; font-weight: 600; letter-spacing: .02em;
  color: var(--white);
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 10px 30px -12px rgba(123,94,167,.8);
  transition: filter .2s, transform .15s;
}
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .btn-arrow { transition: transform .25s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(3px); }
.btn:disabled { opacity: .7; cursor: progress; transform: none; filter: none; }

.spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(240,235,255,.35); border-top-color: var(--white); border-radius: 50%; animation: spin .7s linear infinite; }
.btn.is-loading .spinner { display: block; }
.btn.is-loading .btn-arrow { display: none; }

.privacy { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 14px; line-height: 1.5; }
.privacy .ic { color: var(--teal); }

/* ── Success ───────────────────────────────────────── */
#successCard:not([hidden]) { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; animation: fadeUp .5s ease both; }
.success-icon { width: 72px; height: 72px; background: rgba(91,196,191,.15); border: 1px solid rgba(91,196,191,.4); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.success-icon svg { width: 32px; height: 32px; fill: none; stroke: var(--teal); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s .25s ease forwards; }
#successCard h2 { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.2; }
#successCard h2:focus { outline: none; }
#successCard > p { font-size: 14px; color: var(--muted); max-width: 360px; line-height: 1.6; }

.success-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }

.download-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--teal), #3da8a4);
  border-radius: 14px;
  padding: 16px 30px;
  font-size: 16px; font-weight: 700;
  color: var(--bg);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(91,196,191,.3);
  animation: glow 2.5s ease infinite;
  transition: filter .2s, transform .15s;
}
.download-btn:hover { filter: brightness(1.06); transform: translateY(-2px); }
.download-btn .ic { stroke-width: 2.2; }

.view-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--lavender); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .2s, color .2s; }
.view-link:hover { color: var(--white); border-color: currentColor; }

.email-note { display: flex; align-items: flex-start; gap: 9px; text-align: left; font-size: 12.5px; color: var(--gold); background: rgba(201,168,76,.06); border: 1px solid rgba(201,168,76,.3); border-radius: 10px; padding: 11px 16px; max-width: 380px; line-height: 1.5; }
.email-note .ic { margin-top: 1px; }
.email-note strong { font-weight: 600; word-break: break-all; }

.cta-box { background: rgba(123,94,167,.1); border: 1px solid rgba(123,94,167,.3); border-radius: 14px; padding: 20px 24px; max-width: 380px; width: 100%; }
.cta-box p { font-size: 13px; color: var(--muted); line-height: 1.65; margin-bottom: 14px; text-align: center; }
.cta-box p strong { color: var(--gold); font-weight: 600; }
.cta-box p em { color: var(--white); }
.cta-link { display: flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(135deg, var(--purple), var(--purple-d)); color: var(--white); font-weight: 600; font-size: 14px; padding: 12px 24px; border-radius: 10px; text-decoration: none; transition: filter .2s, transform .15s; }
.cta-link:hover { filter: brightness(1.12); transform: translateY(-1px); }

/* ── Divider + profile ─────────────────────────────── */
.divider { width: 100%; max-width: 460px; display: flex; align-items: center; gap: 14px; margin: 32px 0; animation: fadeUp .7s .4s ease both; }
.divider-line { flex: 1; height: 1px; background: var(--border); }
.divider-text { font-size: 12px; color: var(--muted); white-space: nowrap; }

.profile { display: flex; align-items: center; gap: 16px; max-width: 460px; text-decoration: none; color: inherit; padding: 8px 14px 8px 8px; border-radius: 100px; transition: background .2s; animation: fadeUp .7s .5s ease both; }
.profile:hover { background: rgba(123,94,167,.1); }
.avatar { width: 56px; height: 56px; border-radius: 50%; padding: 2px; background: linear-gradient(135deg, var(--purple), var(--teal)); flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: center top; border: 2px solid var(--bg); }
.profile-text { font-size: 13px; color: var(--muted); line-height: 1.55; }
.profile-name { display: block; font-weight: 600; color: var(--white); font-size: 14px; }

/* ── Animations ────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse  { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes glow   { 0%,100% { box-shadow: 0 8px 24px rgba(91,196,191,.3); } 50% { box-shadow: 0 8px 40px rgba(91,196,191,.55); } }
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes draw   { to { stroke-dashoffset: 0; } }

/* ── Accessibility ─────────────────────────────────── */
:focus-visible { outline: 3px solid var(--lavender); outline-offset: 3px; border-radius: 6px; }
input:focus-visible { outline: none; }
.skip-link { position: absolute; top: -100%; left: 0; background: var(--lavender); color: var(--bg); padding: 8px 16px; font-size: 13px; font-weight: 600; text-decoration: none; z-index: 999; border-radius: 0 0 4px 0; }
.skip-link:focus { top: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 480px) {
  .page { padding-top: 72px; }
  .card { padding: 28px 20px; }
  .badge { font-size: 10px; padding: 6px 14px; }
  .check-item { font-size: 13.5px; }
}
