/* ---------- Tokens ---------- */
:root {
  --bg: #F3F7FF; --bg2: #F0EDFF; --blue: #5271FF; --btn: #4560F5; --btn-dark: #3a52dc;
  --teal: #55B8A5; --ink: #172554; --muted: #64748B; --card: #fff; --line: #E2E8F0;
  --lav: #E9E7FF; --ok: #2E9D85; --err: #B42318;
  --radius: 20px; --shadow: 0 18px 40px -22px rgba(23, 37, 84, .3);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); line-height: 1.65; overflow-x: hidden;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg2) 100%) fixed;
}
/* Soft decorative blobs, kept behind content */
body::before, body::after { content: ""; position: fixed; z-index: -1; border-radius: 50%; filter: blur(70px); pointer-events: none; }
body::before { width: 460px; height: 460px; top: -120px; right: -100px; background: radial-gradient(circle, rgba(82,113,255,.28), transparent 70%); }
body::after { width: 420px; height: 420px; bottom: -120px; left: -100px; background: radial-gradient(circle, rgba(85,184,165,.25), transparent 70%); }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.center { text-align: center; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 12px; }
:focus-visible { outline: 3px solid rgba(82,113,255,.55); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; border-radius: 999px; padding: 14px 26px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s; min-height: 48px; }
.btn-primary { background: var(--btn); color: #fff; box-shadow: 0 12px 24px -12px rgba(69,96,245,.8); }
.btn-primary:hover { background: var(--btn-dark); transform: translateY(-2px); }
.btn-ghost { background: rgba(255,255,255,.7); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #fff; border-color: var(--blue); }
.btn-sm { padding: 10px 20px; min-height: 42px; }
.btn-block { width: 100%; margin-top: 8px; }
.btn:disabled { opacity: .75; cursor: progress; transform: none; }

/* ---------- Navigation ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.75); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); text-decoration: none; }
.menu { display: flex; align-items: center; gap: 6px; }
.menu a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 600; padding: 8px 14px; border-radius: 999px; transition: background .15s; }
.menu a:not(.btn):hover { background: var(--lav); }
.menu .btn { margin-left: 8px; }
.menu-btn { display: none; background: none; border: 0; padding: 10px; cursor: pointer; border-radius: 10px; }
.menu-btn span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding-top: 64px; padding-bottom: 40px; }
.badge { display: inline-block; background: var(--lav); color: #3b4bb8; font-weight: 700; font-size: .8rem; letter-spacing: .06em; padding: 7px 14px; border-radius: 999px; margin-bottom: 20px; }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 3.9rem); font-weight: 800; margin-bottom: 20px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-actions.center { justify-content: center; margin-top: 24px; }
.note { margin-top: 22px; font-size: .92rem; color: var(--muted); }
.hero-art svg { width: 100%; height: auto; display: block; }
.float { animation: float 6s ease-in-out infinite; }
.float-b { animation-duration: 7.5s; animation-delay: -2s; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---------- Sections ---------- */
.section { padding-top: 48px; padding-bottom: 48px; }
.section[hidden] { display: none; }
.form-card, .result-card, .privacy { background: var(--card); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); padding: clamp(22px, 4vw, 44px); }
.sub { color: var(--muted); margin: 8px 0 28px; }

/* ---------- Form ---------- */
fieldset { border: 0; padding: 0; margin: 0 0 26px; min-width: 0; }
legend { font-weight: 700; font-size: 1.05rem; color: #3b4bb8; padding: 0 0 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); width: 100%; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
label { font-weight: 600; font-size: .94rem; }
input, select { font: inherit; padding: 12px 14px; min-height: 48px; width: 100%; border: 1.5px solid var(--line); border-radius: 14px; background: #fbfcff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: #94a3b8; }
input:hover, select:hover { border-color: #c3cdf3; }
input:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(82,113,255,.18); }
.field.invalid input, .field.invalid select { border-color: var(--err); background: #fffafa; }
.err { color: var(--err); font-size: .86rem; font-weight: 600; }
.err::before { content: "⚠ "; }
.alert { background: #fef3f2; color: var(--err); border: 1px solid #fecdca; border-radius: 14px; padding: 12px 16px; font-weight: 600; margin-bottom: 14px; }
.spinner { display: none; width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
[aria-busy="true"] > .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Results ---------- */
.result-card { text-align: center; max-width: 640px; margin: 0 auto; animation: rise .5s ease both; }
.result-card h2:focus { outline: none; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.ring { position: relative; width: 200px; height: 200px; margin: 24px auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track, .ring-bar { fill: none; stroke-width: 12; }
.ring-track { stroke: var(--lav); }
.ring-bar { stroke: url(#rg); stroke-linecap: round; stroke-dasharray: 414.7; stroke-dashoffset: 414.7; transition: stroke-dashoffset 1.1s cubic-bezier(.2,.8,.2,1); }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-text strong { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.ring-text span { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.result-text { color: var(--muted); max-width: 34em; margin: 0 auto 16px; }
.disclaimer { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; font-size: .9rem; max-width: 36em; margin: 0 auto; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 30px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); transition: transform .2s, border-color .2s; }
.card:hover { transform: translateY(-4px); border-color: #c3cdf3; }
.card h3 { margin: 14px 0 8px; }
.card p { color: var(--muted); }
.ico { width: 48px; height: 48px; padding: 12px; border-radius: 14px; background: var(--lav); fill: none; stroke: var(--blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.privacy { background: linear-gradient(135deg, #fff, var(--bg2)); }
.privacy h2 { margin-bottom: 10px; }
.privacy p { color: var(--muted); max-width: 46em; }

/* ---------- Footer ---------- */
.footer { margin-top: 40px; padding: 36px 0 28px; background: rgba(255,255,255,.7); border-top: 1px solid var(--line); }
.foot-inner { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.footer p { color: var(--muted); font-size: .92rem; max-width: 30em; margin-top: 6px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer nav a { color: var(--ink); font-weight: 600; text-decoration: none; }
.footer nav a:hover { color: var(--blue); }
.foot-note { margin-top: 22px !important; padding-top: 16px; border-top: 1px solid var(--line); max-width: 1140px !important; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .hero-art { max-width: 420px; margin: 0 auto; }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .menu { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: #fff; padding: 14px 20px 20px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .menu.open { display: flex; }
  .menu .btn { margin: 8px 0 0; }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
