/* ==========================================================================
   Visastat — shared design system
   Used by every page via templates/_headstyles.html. Page-specific styles
   live in their own file (home.css) or a small <style> block on that page.
   Class names used by page scripts or other templates (btn-search, panel,
   faq-*, price-*, promo-*, sr-only, nav/footer ids) are part of the contract:
   restyle them freely, don't rename them.
   ========================================================================== */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --bg:           #f4f6f9;
  --surface:      #ffffff;
  --surface-2:    #f8fafc;
  --border:       #e2e8f0;
  --border-strong:#cbd5e1;
  --text:         #0f172a;
  --text-2:       #64748b;
  --text-3:       #5f6f85;
  --nav-bg:       rgba(255,255,255,.9);
  --green:        #16884a;
  --green-dk:     #0a5c32;
  --green-light:  #dcfce7;
  --green-soft:   #f0fdf4;
  --green-glow:   rgba(22,136,74,.16);
  --on-green:     #ffffff;           /* text on a --green fill */
  --red:          #dc2626;
  --red-light:    #fef2f2;
  --red-glow:     rgba(220,38,38,.14);
  --amber:        #d97706;
  --amber-text:   #b45309;           /* amber for small text: >=4.5:1 on white */
  --amber-light:  #fffbeb;
  --amber-glow:   rgba(217,119,6,.14);
  --purple:       #7c3aed;
  --purple-light: #f5f3ff;
  --shadow-sm:    0 1px 2px rgba(15,23,42,.05);
  --shadow:       0 1px 2px rgba(15,23,42,.04), 0 4px 14px rgba(15,23,42,.06);
  --shadow-lg:    0 6px 12px rgba(15,23,42,.06), 0 18px 40px rgba(15,23,42,.10);
  --radius-lg:    18px;
  --radius:       14px;
  --radius-sm:    10px;
  --container:    1120px;
  --gutter:       clamp(1rem, 3vw, 1.5rem);
  --t:            .25s cubic-bezier(.4,0,.2,1);
  --font:         'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono:         ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace;
}

[data-theme="dark"] {
  --bg:           #0b0f19;
  --surface:      #131929;
  --surface-2:    #1a2133;
  --border:       #232d42;
  --border-strong:#334058;
  --text:         #e2e8f0;
  --text-2:       #8896b3;
  --text-3:       #808ca5;
  --nav-bg:       rgba(13,20,38,.9);
  --green:        #34d399;
  --green-dk:     #6ee7b7;
  --green-light:  #052e16;
  --green-soft:   #0b2418;
  --green-glow:   rgba(52,211,153,.15);
  --on-green:     #052e16;           /* white on #34d399 is only ~1.9:1 */
  --red:          #f87171;
  --red-light:    #1c0a0a;
  --red-glow:     rgba(248,113,113,.15);
  --amber:        #fbbf24;
  --amber-text:   #fbbf24;
  --amber-light:  #1c1300;
  --amber-glow:   rgba(251,191,36,.13);
  --purple:       #a78bfa;
  --purple-light: #1e1040;
  --shadow-sm:    0 1px 2px rgba(0,0,0,.3);
  --shadow:       0 1px 3px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.4);
  --shadow-lg:    0 4px 8px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.6);
}

/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;   /* secondary pages rely on this to centre their main column */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background var(--t), color var(--t);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--green); text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--green-light); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 1000;
  background: var(--green); color: var(--on-green); padding: .55rem 1rem;
  border-radius: var(--radius-sm); font-weight: 700; text-decoration: none;
  transition: top .15s;
}
.skip-link:focus { top: .75rem; }

.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; stroke: currentColor; fill: none;
        stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: -.2em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

/* ── Header / navigation ─────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 200; width: 100%;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background var(--t), border-color var(--t);
}
.nav-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  height: 60px; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter);
}
.nav-brand { display: flex; align-items: center; gap: .55rem; min-width: 0; color: var(--text); }
.nav-brand a { display: flex; align-items: center; gap: .45rem; color: inherit; text-decoration: none; }
.nav-logo { height: 28px; width: auto; flex-shrink: 0; }
.nav-brand-name { font-weight: 800; font-size: .95rem; letter-spacing: -.01em; }
.nav-sep { color: var(--border-strong); }
.nav-page { font-weight: 600; font-size: .86rem; color: var(--text-2); white-space: nowrap; }
.nav-page:hover { color: var(--green); text-decoration: none; }

.nav-sections { display: flex; align-items: center; gap: .15rem; list-style: none; }
.nav-sections a {
  display: block; padding: .45rem .7rem; border-radius: 8px;
  font-size: .84rem; font-weight: 600; color: var(--text-2); text-decoration: none; white-space: nowrap;
  transition: color .15s, background .15s;
}
.nav-sections a:hover { color: var(--text); background: var(--surface-2); }
.nav-sections a.nav-cta { color: var(--on-green); background: var(--green); }
.nav-sections a.nav-cta:hover { background: var(--green-dk); color: var(--on-green); }
[data-theme="dark"] .nav-sections a.nav-cta:hover { color: #052e16; }

.nav-right { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.nav-dropdown { position: relative; }
.nav-dropdown-btn {
  font-size: .82rem; font-weight: 600; color: var(--text-2);
  background: none; border: 1px solid transparent; cursor: pointer;
  padding: .4rem .65rem; border-radius: 8px; display: flex; align-items: center; gap: .3rem;
  transition: color .15s, background .15s, border-color .15s;
}
.nav-dropdown-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.nav-dropdown-menu {
  display: none; position: absolute; right: 0; top: calc(100% + .45rem);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 220px; z-index: 210; overflow: hidden; padding: .3rem;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; border-radius: 8px;
  font-size: .84rem; font-weight: 500; color: var(--text-2); text-decoration: none;
}
.nav-dropdown-menu a:hover { background: var(--surface-2); color: var(--text); }
.nav-dropdown-menu a.active { color: var(--green); font-weight: 700; }
.install-btn {
  display: none; align-items: center; gap: .35rem;
  font-size: .8rem; font-weight: 600; color: var(--green);
  background: var(--green-soft); border: 1px solid var(--green-glow); border-radius: 8px;
  padding: .4rem .7rem; cursor: pointer;
}
.install-btn:hover { background: var(--green-light); }
.theme-btn {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, transform .15s;
}
.theme-btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }

/* Second row on narrow screens: the section links scroll sideways instead of
   hiding behind a menu button — everything stays one tap away. */
.nav-sub { display: none; border-top: 1px solid var(--border); }
.nav-sub .nav-sections { overflow-x: auto; scrollbar-width: none; padding: .35rem var(--gutter); gap: .25rem; }
.nav-sub .nav-sections::-webkit-scrollbar { display: none; }
@media (max-width: 920px) {
  .nav-bar > .nav-sections { display: none; }
  .nav-sub { display: block; }
}
@media (max-width: 560px) {
  /* Logo + product name is more useful than the company name on a phone. */
  .nav-brand .nav-brand-name, .nav-brand .nav-sep { display: none; }
  .nav-brand .nav-page { font-size: .88rem; color: var(--text); font-weight: 700; }
  .install-btn { font-size: 0; gap: 0; padding: .4rem .55rem; }
  .install-btn .icon { font-size: .95rem; }
}

/* ── Limited-time offer bar ──────────────────────────────────────────────── */
.promo-bar {
  width: 100%;
  /* Darker than --red/--amber so white text stays >=4.5:1 across the gradient */
  background: linear-gradient(90deg, #b91c1c 0%, #b45309 100%);
  color: #fff; text-align: center; font-size: .82rem; font-weight: 600; line-height: 1.5;
  padding: .5rem var(--gutter);
}
.promo-bar a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.promo-bar .promo-ends { font-weight: 500; opacity: .92; white-space: nowrap; }
.promo-short { display: none; }
@media (max-width: 640px) { .promo-long { display: none; } .promo-short { display: inline; } }
[data-theme="dark"] .promo-bar { background: linear-gradient(90deg, var(--red) 0%, var(--amber) 100%); color: #1a0a00; }
[data-theme="dark"] .promo-bar a { color: #1a0a00; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn, .btn-search {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .8rem 1.35rem; border-radius: var(--radius-sm);
  background: var(--green); color: var(--on-green); border: 1px solid transparent;
  font-size: .9rem; font-weight: 700; letter-spacing: .005em; white-space: nowrap;
  cursor: pointer; text-decoration: none;
  transition: background .15s, transform .15s, box-shadow .15s, border-color .15s;
}
.btn:hover:not(:disabled), .btn-search:hover:not(:disabled) {
  background: var(--green-dk); color: var(--on-green); text-decoration: none;
  transform: translateY(-1px); box-shadow: 0 6px 16px var(--green-glow);
}
[data-theme="dark"] .btn:hover:not(:disabled), [data-theme="dark"] .btn-search:hover:not(:disabled) { color: #052e16; }
.btn:disabled, .btn-search:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); color: var(--text); box-shadow: var(--shadow); }
.btn-purple { background: var(--purple); color: #fff; }
.btn-purple:hover:not(:disabled) { background: #6d28d9; color: #fff; box-shadow: 0 6px 16px rgba(124,58,237,.2); }
[data-theme="dark"] .btn-purple, [data-theme="dark"] .btn-purple:hover:not(:disabled) { color: #1e1040; }
.btn-block { width: 100%; }
.btn-sm { padding: .5rem .9rem; font-size: .82rem; }
.btn-link {
  background: none; border: none; padding: 0; color: var(--green); font-weight: 600; font-size: .82rem;
  cursor: pointer; text-decoration: none;
}
.btn-link:hover { text-decoration: underline; }

/* ── Form fields ─────────────────────────────────────────────────────────── */
.field, .search-input {
  width: 100%; padding: .78rem 1rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: .95rem; outline: none;
  transition: border-color .15s, box-shadow .15s, background var(--t);
}
.field::placeholder, .search-input::placeholder { color: var(--text-3); }
.field:focus, .search-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }
.field-label { display: block; font-size: .8rem; font-weight: 700; color: var(--text); margin-bottom: .35rem; }
.field-hint { font-size: .76rem; color: var(--text-3); margin-top: .4rem; line-height: 1.5; }
.check-row { display: flex; gap: .55rem; align-items: flex-start; font-size: .78rem; color: var(--text-2); line-height: 1.5; cursor: pointer; }
.check-row input { margin-top: .2rem; accent-color: var(--green); width: 16px; height: 16px; flex-shrink: 0; }

/* ── Panels / cards ──────────────────────────────────────────────────────── */
.panel, .card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.5rem 1.6rem; width: 100%;
  transition: background var(--t), border-color var(--t);
}
.panel { margin-bottom: 1.1rem; }
.panel-hd {
  display: flex; align-items: center; gap: .55rem; margin-bottom: 1rem;
  font-size: 1rem; font-weight: 800; letter-spacing: -.01em; color: var(--text);
}
.panel-hd .icon { color: var(--green); }

/* Section rhythm */
.section { padding: clamp(2.5rem, 6vw, 4rem) 0; }
.section + .section { padding-top: 0; }
.section-head { max-width: 680px; margin-bottom: 1.6rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--green);
  margin-bottom: .55rem;
}
.section-title { font-size: clamp(1.45rem, 3vw, 1.95rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.2; color: var(--text); }
.section-lead { font-size: 1rem; color: var(--text-2); line-height: 1.65; margin-top: .55rem; }

/* ── Price tags (homepage plans, guide page) ─────────────────────────────── */
.price-tag { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .55rem; margin: .2rem 0 .75rem; }
.price-now { font-size: 2rem; font-weight: 800; color: var(--text); letter-spacing: -.03em; line-height: 1.1; }
.price-was { font-size: 1rem; color: var(--text-3); text-decoration: line-through; }
.price-off {
  align-self: center; font-size: .68rem; font-weight: 800; letter-spacing: .05em;
  color: var(--red); background: var(--red-light); border: 1px solid var(--red-glow);
  border-radius: 99px; padding: .16rem .55rem;
}
.price-ends { flex-basis: 100%; font-size: .76rem; font-weight: 600; color: var(--amber-text); }

/* ── FAQ (div-based on /guide, <details> accordion on the homepage) ──────── */
.faq-section {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.5rem 1.6rem; margin-bottom: 1.1rem;
}
.faq-hd { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin-bottom: 1rem; }
.faq-item { border-bottom: 1px solid var(--border); padding: .95rem 0; }
.faq-item:first-of-type { padding-top: 0; }
.faq-item:last-of-type { border-bottom: none; padding-bottom: 0; }
.faq-q { font-size: .92rem; font-weight: 700; color: var(--text); line-height: 1.45; letter-spacing: -.01em; margin-bottom: .4rem; }
.faq-a { font-size: .86rem; color: var(--text-2); line-height: 1.7; }
details.faq-item > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
details.faq-item > summary::-webkit-details-marker { display: none; }
details.faq-item > summary .faq-q { margin: 0; }
details.faq-item > summary::after {
  content: ''; width: 9px; height: 9px; flex-shrink: 0; margin-right: .2rem;
  border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg) translateY(-3px); transition: transform .2s;
}
details.faq-item[open] > summary::after { transform: rotate(-135deg) translateY(-3px); }
details.faq-item[open] > .faq-a { margin-top: .55rem; }
details.faq-item > summary:hover .faq-q { color: var(--green); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  margin-top: auto; width: 100%; background: var(--surface); border-top: 1px solid var(--border);
  color: var(--text-2); font-size: .84rem; transition: background var(--t), border-color var(--t);
}
.footer-grid {
  display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 2rem;
  max-width: var(--container); margin: 0 auto; padding: 2.75rem var(--gutter) 2rem;
}
.footer-brand p { margin-top: .7rem; line-height: 1.65; max-width: 340px; color: var(--text-3); font-size: .8rem; }
.footer-col h3 { font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text); margin-bottom: .8rem; }
.footer-col ul { list-style: none; display: grid; gap: .5rem; }
.footer-col a { color: var(--text-2); text-decoration: none; font-weight: 500; }
.footer-col a:hover { color: var(--green); }
.footer-legal {
  max-width: var(--container); margin: 0 auto; padding: 1.2rem var(--gutter) 1.6rem;
  border-top: 1px solid var(--border); font-size: .74rem; color: var(--text-3); line-height: 1.65;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 2rem;
}
.footer-legal p { max-width: 760px; }
.footer-legal a { color: var(--text-2); }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 460px) { .footer-grid { grid-template-columns: 1fr; } }

/* ── Cookie banner (built by _scripts_shared.html) ───────────────────────── */
#cookie-bar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: .85rem var(--gutter); align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem;
  box-shadow: 0 -6px 24px rgba(15,23,42,.10); font-size: .84rem; line-height: 1.5;
}
#cookie-bar p { margin: 0; color: var(--text-2); max-width: 680px; }
#cookie-bar a { color: var(--green); font-weight: 600; text-decoration: none; }
#cookie-bar a:hover { text-decoration: underline; }
#cookie-bar-btn {
  padding: .5rem 1.25rem; background: var(--green); color: var(--on-green); border: none; border-radius: 8px;
  font-size: .84rem; font-weight: 700; cursor: pointer; white-space: nowrap;
}
#cookie-bar-btn:hover { background: var(--green-dk); }
#cookie-bar-decline {
  padding: .5rem 1.25rem; background: transparent; color: var(--text-2); border: 1px solid var(--border-strong);
  border-radius: 8px; font-size: .84rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.ck-btns { display: flex; gap: .5rem; flex-shrink: 0; }

/* ── Floating donation widget ────────────────────────────────────────────── */
.donate-float-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 150;
  animation: donateFloatIn .5s cubic-bezier(.34,1.56,.64,1) .4s both; transition: bottom .2s ease; }
.donate-float {
  position: relative; display: inline-flex; align-items: center; gap: .5rem;
  background: linear-gradient(135deg, #16884a, #0a5c32); color: #fff;
  padding: .7rem 1.15rem; border-radius: 999px; text-decoration: none;
  font-weight: 700; font-size: .84rem; box-shadow: 0 6px 20px rgba(22,136,74,.25), 0 2px 8px rgba(0,0,0,.14);
}
.donate-float:hover { transform: translateY(-2px); text-decoration: none; color: #fff; }
.donate-close {
  position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--border);
  font-size: .85rem; line-height: 1; display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.donate-close:hover { background: var(--red-light); color: var(--red); }
@keyframes donateFloatIn { from { opacity: 0; transform: translateY(20px) scale(.85); } to { opacity: 1; transform: none; } }
@media (max-width: 480px) { .donate-float-wrap { right: 12px; bottom: 12px; } .donate-float { padding: .6rem .95rem; font-size: .8rem; } }
@media print { .donate-float-wrap, .site-header, .promo-bar, #cookie-bar { display: none !important; } }

/* ── Motion ──────────────────────────────────────────────────────────────── */
@keyframes fadeDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes fadeUp   { from { opacity: 0; transform: translateY(10px); }  to { opacity: 1; transform: none; } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn    { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes pulse    { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes shimmer  { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
                           transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
