/* ==========================================================================
   prefs.css — light theme + the nav language/theme switcher
   Shared by index.html and contact.html. Loaded after each page's inline
   <style>, and every rule is scoped by :root[data-theme=...] or
   :root[data-lang=...], so the dark design is untouched by default.
   --------------------------------------------------------------------------
   How the light theme works
   -------------------------
   The pages were built on a grey scale used "upside down": --grey-950 is the
   page background and --grey-50 is heading text. So light mode mostly just
   flips that scale — 50..600 become dark (they are text) and 700..950 become
   light (they are surfaces and borders). Translucent overlays were changed in
   the page CSS from rgba(255,255,255,a) to rgba(var(--ov),a), so flipping --ov
   turns every "white tint on dark" into "dark tint on light" at the same
   strength. What is left below is the handful of places where a dark-tuned
   alpha or an accent colour does not survive the flip on its own.
   ========================================================================== */

/* ===================== base tokens (dark = default) ===================== */
:root {
  color-scheme: dark;

  /* Tint used by every translucent surface and hairline border. */
  --ov: 255, 255, 255;

  /* Drop shadows, by their original dark-mode alpha. */
  --sh-25: rgba(0, 0, 0, 0.25);
  --sh-30: rgba(0, 0, 0, 0.30);
  --sh-40: rgba(0, 0, 0, 0.40);
  --sh-50: rgba(0, 0, 0, 0.50);
  --sh-55: rgba(0, 0, 0, 0.55);
  --sh-60: rgba(0, 0, 0, 0.60);

  --nav-bg: rgba(9, 9, 11, 0.70);
  --nav-bg-scrolled: rgba(9, 9, 11, 0.92);

  --shot-bg: #0f1115;
  --noise-opacity: 1;
  --logo-chip-border: transparent;
}

/* ===================== light theme: token remap ======================== */
:root[data-theme="light"] {
  color-scheme: light;

  /* text ramp — was lightest-first, now darkest-first */
  --grey-50:  #18181b;   /* h1, section titles, plan amounts */
  --grey-100: #27272a;   /* card headings */
  --grey-200: #3f3f46;   /* inline <strong> */
  --grey-300: #3f3f46;   /* body default, check lists, plan features */
  --grey-400: #52525b;   /* lead paragraphs, nav links, section descriptions */
  --grey-500: #6b6b73;   /* muted card copy, labels (4.6:1 on white) */
  --grey-600: #71717a;   /* captions, footer copy, keyword cloud */

  /* surface ramp — these are backgrounds and borders, so they go light */
  --grey-700: #d4d4d8;   /* outline-button and mockup borders */
  --grey-800: #e4e4e7;   /* progress tracks, skeleton lines */
  --grey-900: #f4f4f5;   /* raised panels, badge backgrounds */
  --grey-950: #ffffff;   /* the page */

  /* Accent text: #fb923c is unreadable on white, so the "400" slot — which
     the pages use for accent *text* — drops to orange-700. Gradients that
     use it still read as a warm orange ramp. */
  --orange-400: #c2410c;

  --ov: 9, 9, 11;

  --sh-25: rgba(24, 24, 27, 0.07);
  --sh-30: rgba(24, 24, 27, 0.08);
  --sh-40: rgba(24, 24, 27, 0.10);
  --sh-50: rgba(24, 24, 27, 0.10);
  --sh-55: rgba(24, 24, 27, 0.12);
  --sh-60: rgba(24, 24, 27, 0.16);

  --nav-bg: rgba(255, 255, 255, 0.78);
  --nav-bg-scrolled: rgba(255, 255, 255, 0.94);

  --shot-bg: #f4f4f5;
  --noise-opacity: 0.45;
  --logo-chip-border: rgba(9, 9, 11, 0.10);
}

/* ===================== light theme: component fixes ==================== */
/* Alphas tuned against black are too faint against white: surfaces vanish
   and hairlines disappear. These are the components where that shows.
   Written flat rather than nested, so old Android WebViews keep up. */

/* --- cards and panels ------------------------------------------------- */
:root[data-theme="light"] .feature-card,
:root[data-theme="light"] .panel,
:root[data-theme="light"] .pricing-card,
:root[data-theme="light"] .form-card,
:root[data-theme="light"] .info-card,
:root[data-theme="light"] .support-card {
  background: #ffffff;
  border-color: rgba(9, 9, 11, 0.10);
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.04), 0 8px 24px rgba(24, 24, 27, 0.04);
}
:root[data-theme="light"] .feature-card:hover {
  background: #ffffff;
  border-color: rgba(249, 115, 22, 0.35);
}
:root[data-theme="light"] .info-card:hover,
:root[data-theme="light"] .support-card:hover {
  border-color: rgba(249, 115, 22, 0.35);
}
:root[data-theme="light"] .pricing-card:not(.featured):hover {
  border-color: rgba(9, 9, 11, 0.18);
}
:root[data-theme="light"] .pricing-card.featured {
  background: #fffaf6;
  border-color: rgba(249, 115, 22, 0.40);
  box-shadow: 0 24px 60px rgba(249, 115, 22, 0.14);
}
:root[data-theme="light"] .pricing-card.accounting {
  background: linear-gradient(180deg, #fff7ed, #ffffff);
  border-color: rgba(249, 115, 22, 0.32);
}
:root[data-theme="light"] .plan-features li {
  border-bottom-color: rgba(9, 9, 11, 0.07);
}

/* --- rules, dividers, section edges ---------------------------------- */
:root[data-theme="light"] .stats-bar {
  background: #fafafa;
  border-top-color: rgba(9, 9, 11, 0.08);
  border-bottom-color: rgba(9, 9, 11, 0.08);
}
:root[data-theme="light"] .faq-list,
:root[data-theme="light"] .faq-item {
  border-color: rgba(9, 9, 11, 0.10);
}
:root[data-theme="light"] .kw-cloud,
:root[data-theme="light"] footer,
:root[data-theme="light"] .footer-bottom {
  border-top-color: rgba(9, 9, 11, 0.09);
}

/* --- small accent text that needs more contrast than orange-500 ------ */
:root[data-theme="light"] .section-label,
:root[data-theme="light"] .plan-features li .tick,
:root[data-theme="light"] .faq-item summary::after {
  color: #c2410c;
}
:root[data-theme="light"] .section-label::before {
  background: #c2410c;
}

/* Heading gradient: the "400" slot is now orange-700, so widen the ramp
   again rather than letting it flatten into one colour. */
:root[data-theme="light"] .hero h1 .highlight,
:root[data-theme="light"] .page-header h1 .highlight {
  background-image: linear-gradient(135deg, #ea580c, #9a3412);
}

/* --- secondary / outline buttons ------------------------------------- */
:root[data-theme="light"] .btn-secondary {
  background: #ffffff;
  border-color: rgba(9, 9, 11, 0.16);
  color: #3f3f46;
}
:root[data-theme="light"] .btn-secondary:hover {
  background: #fafafa;
  border-color: rgba(9, 9, 11, 0.28);
  color: #18181b;
}
:root[data-theme="light"] .plan-btn-outline {
  background: #ffffff;
  border-color: rgba(9, 9, 11, 0.16);
  color: #3f3f46;
}
:root[data-theme="light"] .plan-btn-outline:hover {
  border-color: #f97316;
  color: #c2410c;
  background: #fff7ed;
}

/* --- product screenshots --------------------------------------------- */
:root[data-theme="light"] .shot {
  border-color: rgba(9, 9, 11, 0.12);
}
:root[data-theme="light"] .shot-bar {
  background: #f4f4f5;
  border-bottom-color: rgba(9, 9, 11, 0.08);
}

/* --- the logo chip is white, so give it an edge on a white page ------- */
:root[data-theme="light"] .nav-logo .logo-icon,
:root[data-theme="light"] .footer-logo .logo-icon {
  border: 1px solid var(--logo-chip-border);
}

/* --- phone mockup ---------------------------------------------------- */
:root[data-theme="light"] .phone-notch { background: #d4d4d8; }
:root[data-theme="light"] .phone-mini-card { background: #ffffff; border: 1px solid rgba(9, 9, 11, 0.08); }
:root[data-theme="light"] .phone-list-item { background: #ffffff; border: 1px solid rgba(9, 9, 11, 0.06); }

/* --- contact.html: form fields --------------------------------------- */
:root[data-theme="light"] .form-group input,
:root[data-theme="light"] .form-group textarea {
  background: #ffffff;
  border-color: rgba(9, 9, 11, 0.18);
  color: #18181b;
}
:root[data-theme="light"] .form-group input::placeholder,
:root[data-theme="light"] .form-group textarea::placeholder {
  color: #8e8e97;
}
:root[data-theme="light"] .form-group input:focus,
:root[data-theme="light"] .form-group textarea:focus {
  background: #fffaf6;
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}
:root[data-theme="light"] .form-group input.error-state,
:root[data-theme="light"] .form-group textarea.error-state {
  border-color: #dc2626;
  background: #fef2f2;
}
:root[data-theme="light"] .error-message { color: #b91c1c; }

/* --- contact.html: status colours (light-on-dark fails on white) ----- */
:root[data-theme="light"] .support-icon.blue  { background: #eff6ff; border-color: rgba(37, 99, 235, 0.25); color: #1d4ed8; }
:root[data-theme="light"] .support-icon.green { background: #f0fdf4; border-color: rgba(22, 163, 74, 0.25); color: #15803d; }
:root[data-theme="light"] .support-icon.orange,
:root[data-theme="light"] .info-icon.orange   { background: #fff7ed; border-color: rgba(234, 88, 12, 0.25); color: #c2410c; }
:root[data-theme="light"] .info-icon.grey     { background: #f4f4f5; border-color: rgba(9, 9, 11, 0.10);    color: #3f3f46; }
:root[data-theme="light"] .toast.success      { background: #f0fdf4; border-color: rgba(22, 163, 74, 0.35); color: #15803d; }
:root[data-theme="light"] .toast.error        { background: #fef2f2; border-color: rgba(220, 38, 38, 0.35); color: #b91c1c; }
/* The loading scrim stays dark in both themes, so its label stays light. */
:root[data-theme="light"] .spinner-text       { color: #fafafa; }

/* The noise grain was dialled in against black; soften it on white. */
body::before { opacity: var(--noise-opacity); }

/* ====================================================================== */
/*  FOOTER NAV FIX (pre-existing bug on contact.html)                     */
/* ====================================================================== */

/* contact.html wraps its footer links in <nav aria-label="Footer navigation">,
   and the page styles the header bar with a bare `nav { position: fixed }`.
   That selector matches the footer's nav too, so the footer links were being
   pinned across the top of the window on top of the real header — and, at
   z-index 1000 and later in the DOM, they swallowed clicks meant for the
   header (including the language and theme buttons). Keep the fixed bar
   treatment for the header only. `nav.scrolled` is left alone: only #navbar
   ever gets that class. */
footer nav {
  position: static;
  z-index: auto;
  padding: 0;
  background: none;
  backdrop-filter: none;
  border-bottom: 0;
  transition: none;
}

/* ====================================================================== */
/*  NAV SWITCHER                                                          */
/* ====================================================================== */

/* Groups the links and the switcher on the right so the nav keeps its
   original logo-left / everything-right balance. */
.nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: 0;
}
.nav-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: rgba(var(--ov), 0.05);
  border: 1px solid rgba(var(--ov), 0.10);
  border-radius: 50px;
}
.lang-opt {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 1.25;
  color: var(--grey-500);
  padding: 5px 11px;
  border-radius: 50px;
  transition: color 0.25s, background 0.25s;
  white-space: nowrap;
}
.lang-opt:hover { color: var(--orange-400); }
.lang-opt.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
  box-shadow: 0 2px 10px rgba(249, 115, 22, 0.30);
}
/* Devanagari sits lower than Latin in the same box; nudge it back up. */
.lang-opt[data-lang-set="hi"] { font-size: 0.8rem; padding-top: 3px; padding-bottom: 4px; }

.theme-toggle {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  background: rgba(var(--ov), 0.05);
  border: 1px solid rgba(var(--ov), 0.10);
  color: var(--grey-400);
  transition: color 0.25s, background 0.25s, border-color 0.25s, transform 0.35s;
}
.theme-toggle:hover {
  color: var(--orange-400);
  background: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.30);
  transform: rotate(-20deg);
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
}
/* Show the destination, not the current state: a sun while dark, moon while light. */
.theme-toggle .ic-moon { display: none; }
.theme-toggle .ic-sun  { display: block; }
:root[data-theme="light"] .theme-toggle .ic-sun  { display: none; }
:root[data-theme="light"] .theme-toggle .ic-moon { display: block; }

.lang-opt:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--orange-500);
  outline-offset: 2px;
}

/* Until the Hindi dictionary has registered, there is nothing to switch to. */
.lang-opt[hidden] { display: none; }

/* The switcher adds ~126px to the right-hand group, so the nav runs out of
   room roughly 130px earlier than the page's own breakpoints assume. These
   shift the same steps up to match. Ordered widest-first: equal specificity,
   so the last matching rule wins. */
@media (max-width: 1420px) {
  .nav-links { gap: 24px; }
  .nav-links a { font-size: 0.84rem; }
}
@media (max-width: 1240px) {
  /* Wordmark goes first — the chip still carries the brand. */
  .nav-logo span { display: none; }
  .nav-right { gap: 18px; }
  .nav-links { gap: 18px; }
  .nav-links a { font-size: 0.8rem; }
}
@media (max-width: 900px) {
  /* Only the CTA survives here, so there is room for the wordmark again. */
  .nav-logo span { display: inline; }
  .nav-right { gap: 12px; }
  .nav-tools { gap: 8px; }
}
@media (max-width: 600px) {
  /* The logo chip carries the brand here; the wordmark would crowd out
     the switcher and the CTA. */
  .nav-logo span { display: none; }
  .nav-right { gap: 10px; }
  .nav-tools { gap: 6px; }
  .lang-opt { padding: 4px 8px; font-size: 0.68rem; }
  .lang-opt[data-lang-set="hi"] { font-size: 0.75rem; }
  .theme-toggle { width: 30px; height: 30px; }
  .theme-toggle svg { width: 14px; height: 14px; }
}
@media (max-width: 380px) {
  .nav-tools { gap: 5px; }
  .lang-switch { padding: 2px; }
  .lang-opt { padding: 4px 7px; font-size: 0.64rem; }
  .theme-toggle { width: 28px; height: 28px; }
}

/* ====================================================================== */
/*  HINDI TYPOGRAPHY                                                      */
/* ====================================================================== */

/* Outfit has no Devanagari, so Devanagari glyphs fall through to Noto Sans
   Devanagari (injected by site-prefs.js on first switch) while Latin terms
   inside Hindi copy — E-Way Bill, FASTag, GST — stay in the brand face. */
:root[data-lang="hi"] body,
:root[data-lang="hi"] .btn-primary,
:root[data-lang="hi"] .btn-secondary,
:root[data-lang="hi"] .plan-btn,
:root[data-lang="hi"] .btn-submit,
:root[data-lang="hi"] .form-group input,
:root[data-lang="hi"] .form-group textarea {
  font-family: 'Outfit', 'Noto Sans Devanagari', 'Nirmala UI', sans-serif;
}

/* Devanagari joins its letters along a headline bar, so the tight tracking
   the Latin headings use closes the counters up. Reset it and give the
   taller glyphs room. */
:root[data-lang="hi"] .hero h1,
:root[data-lang="hi"] .page-header h1,
:root[data-lang="hi"] .section-title,
:root[data-lang="hi"] .cta-box h2 {
  letter-spacing: normal;
  line-height: 1.32;
}
:root[data-lang="hi"] .hero h1 { font-size: clamp(1.75rem, 5.4vw, 3.7rem); }
:root[data-lang="hi"] .section-title { font-size: clamp(1.4rem, 3.9vw, 2.6rem); }
:root[data-lang="hi"] .page-header h1 { font-size: clamp(1.75rem, 5.2vw, 3.2rem); }

:root[data-lang="hi"] .feature-card h3,
:root[data-lang="hi"] .panel h3,
:root[data-lang="hi"] .info-card h3,
:root[data-lang="hi"] .support-card h3,
:root[data-lang="hi"] .faq-item summary {
  letter-spacing: normal;
  line-height: 1.45;
}
:root[data-lang="hi"] .section-label,
:root[data-lang="hi"] .plan-name,
:root[data-lang="hi"] .card-label,
:root[data-lang="hi"] .footer-col h3,
:root[data-lang="hi"] .form-group label {
  letter-spacing: 0.6px;
}
:root[data-lang="hi"] .check-list li,
:root[data-lang="hi"] .plan-features li,
:root[data-lang="hi"] .copy-block p,
:root[data-lang="hi"] .faq-item .faq-body {
  line-height: 1.9;
}
/* Hindi runs longer than English — keep the plan feature rows from clipping. */
:root[data-lang="hi"] .plan-features li { align-items: flex-start; }
:root[data-lang="hi"] .plan-features li .tick { margin-top: 2px; }

/* Pricing badges are CSS ::before content, so they are translated here. */
:root[data-lang="hi"] .pricing-card.featured::before { content: 'लोकप्रिय'; letter-spacing: 0.8px; }
:root[data-lang="hi"] .pricing-card.accounting::before { content: 'फ़ुल अकाउंटिंग'; letter-spacing: 0.6px; }
