/* assets/tokens.css */
/* Shared design tokens for the SQLly site. Loaded once from the layout,
 * before all other stylesheets. Page CSS files only override deltas. */

:root {
    --navy: #04132d;
    --navy-2: #041b43;
    --blue: #1e4f9d;
    --blue-bright: #2f70d0;
    --blue-soft: #eaf2ff;
    --pink: #f37689;
    --pink-deep: #df6779;
    --pink-strong: #c8455c;
    --pink-soft: #fec7c8;
    --pink-wash: #fff2f3;
    --pink-ink: #b3364d;
    /* #1f7a4d: 4.8:1 on --green-soft and 5.3:1 on white - passes WCAG AA for
       the small text it carries (pills, eyebrows, notices) and for white text
       on it (plan tags). Dark-mode --green below already passes (~7:1). */
    --green: #1f7a4d;
    --green-soft: #e7f7ef;
    --cream: #fff7f6;
    --ink: #1a2340;
    --muted: #5a6584;
    --line: #e6ecf6;
    --card: #fff;
    --heading: var(--navy);
    /* Semantic lifts: --link is inline-link color (bright blue light, lifted
       blue dark so it clears 4.5:1 on near-black); --blue-lift is small blue
       text on tinted surfaces (terms labels, stamps, term markers). */
    --link: var(--blue-bright);
    --blue-lift: var(--blue);
    --radius: 18px;
    --shadow: 0 16px 34px -18px rgba(4, 19, 45, 0.28);
    --shadow-lg: 0 26px 54px -22px rgba(4, 19, 45, 0.38);
    --maxw: 1140px;
}

:root[data-theme="dark"] {
    --cream: #0a1220;
    --card: #10192c;
    --ink: #eaf1ff;
    --muted: #93a3c8;
    --line: #1f2c47;
    --heading: #eaf1ff;
    --blue-soft: #142850;
    --pink-wash: #2c1620;
    --pink-ink: #f6a3b0;
    --green-soft: #12281e;
    --green: #4cc48a;
    --link: #8fbaff;
    --blue-lift: #8fbaff;
    --shadow: 0 16px 34px -18px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 26px 54px -22px rgba(0, 0, 0, 0.8);
}

/* OS dark mode when no explicit theme is chosen (works without JS). */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --cream: #0a1220;
        --card: #10192c;
        --ink: #eaf1ff;
        --muted: #93a3c8;
        --line: #1f2c47;
        --heading: #eaf1ff;
        --blue-soft: #142850;
        --pink-wash: #2c1620;
        --pink-ink: #f6a3b0;
        --green-soft: #12281e;
        --green: #4cc48a;
        --link: #8fbaff;
        --blue-lift: #8fbaff;
        --shadow: 0 16px 34px -18px rgba(0, 0, 0, 0.7);
        --shadow-lg: 0 26px 54px -22px rgba(0, 0, 0, 0.8);
    }
}

/* assets/fonts.css */
/* Self-hosted fonts (latin subset, woff2).
 *
 * These mirror the Google Fonts set used site-wide (Fredoka / Inter /
 * JetBrains Mono). They exist so a page can drop the cross-origin
 * fonts.googleapis.com <link> and still render identically - required on
 * pages that opt into cross-origin isolation (COOP/COEP), where a
 * cross-origin stylesheet without CORP would otherwise be blocked.
 * Files come from Fontsource (the same upstream font data as Google Fonts). */

/* Inter - 400/500/600/700 */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/inter-700.woff2") format("woff2"); }

/* Fredoka - 500/600/700 */
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/fredoka-500.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/fredoka-600.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/fredoka-700.woff2") format("woff2"); }

/* JetBrains Mono - 400/500 */
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/jetbrains-mono-500.woff2") format("woff2"); }

/* assets/nav.css */
/* ============================================================
   SQLly site nav - shared across all pages.
   Header bar, brand, links, theme toggle, mobile menu.

   Pages define their own theme variables in their inline
   <style> (or guides.css). Every page defines --cream, --line,
   --muted, --card, --blue-bright, --blue-soft, --shadow-lg.
   Text color: most pages use --heading; guides.css pages use
   --text, hence the fallback.
   ============================================================ */

header.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--cream) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--heading, var(--text));
  flex-shrink: 0;
}

.brand img {
  width: 38px;
  height: 38px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  color: var(--muted);
  font-weight: 500;
  font-size: .95rem;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--heading, var(--text));
}

/* ---------- Desktop dropdown groups (JS-free) ---------- */

.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
  font-size: .95rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .15s ease;
}

.nav-dropdown[open] summary::after {
  transform: rotate(225deg) translateY(-1px);
}

.nav-dropdown summary:hover,
.nav-dropdown summary.active {
  color: var(--heading, var(--text));
}

.nav-dropdown-panel {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(100% + 10px);
  min-width: 180px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: flex;
  flex-direction: column;
  z-index: 60;
}

.nav-dropdown-panel a {
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 500;
  font-size: .92rem;
}

.nav-dropdown-panel a:hover {
  background: var(--blue-soft);
  color: var(--heading, var(--text));
  text-decoration: none;
}

.nav-dropdown-panel a.active {
  color: var(--heading, var(--text));
  background: var(--blue-soft);
}

.nav-cta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.nav-cta .btn {
  padding: 10px 20px;
  font-size: .92rem;
}

/* ---------- Theme toggle ---------- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  flex-shrink: 0;
}

.theme-toggle button {
  border: none;
  background: transparent;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: .86rem;
  font-weight: 600;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s ease, color .15s ease;
}

.theme-toggle button.active {
  background: var(--blue-bright);
  color: #fff;
}

/* ---------- Mobile disclosure menu (JS-free) ---------- */

.nav-menu {
  display: none;
  position: relative;
}

.nav-menu summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--heading, var(--text));
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-menu[open] summary {
  border-color: var(--blue-bright);
}

.nav-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.nav-menu-panel a {
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--heading, var(--text));
  font-weight: 500;
}

.nav-menu-panel a:hover {
  background: var(--blue-soft);
  text-decoration: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 920px) {
  .nav-links { display: none; }
  .nav-menu { display: block; }
  .nav-signin { display: none; }
}

@media (max-width: 560px) {
  .nav-cta > .btn { display: none; }
  .theme-toggle .t-lbl { display: none; }
}

/* The signed-in username is itself the account dropdown trigger. */
.nav-dropdown summary.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  text-decoration: none;
  max-width: 240px;
  white-space: nowrap;
}

/* Truncate the username itself (not the whole trigger) so the chevron
   always stays visible with a little breathing room after the name. */
.nav-dropdown summary.nav-user .nav-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.nav-dropdown summary.nav-user::after {
  flex: 0 0 auto;
  margin-left: 2px;
}

.nav-dropdown summary.nav-user:hover { color: var(--blue-bright, #2f70d0); }

/* The user menu sits at the right edge of the bar - anchor its panel to the
   right instead of centering it under the trigger, and give the trigger a
   little breathing room before the next control. */
.nav-user-dropdown {
  margin-right: 8px;
}

.nav-user-dropdown .nav-dropdown-panel {
  left: auto;
  right: 0;
  transform: none;
}

/* Separator above Sign out at the bottom of the user menu. */
.nav-dropdown-separator {
  height: 1px;
  background: var(--line);
  margin: 6px 4px;
}

.nav-dropdown-panel form { margin: 0; }

/* Sign out is styled as a menu item, not a button. */
.nav-dropdown-panel .nav-signout {
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 500;
  font-size: .92rem;
  font-family: inherit;
  background: none;
  border: none;
  text-align: left;
  width: 100%;
  cursor: pointer;
}

.nav-dropdown-panel .nav-signout:hover {
  background: var(--blue-soft);
  color: var(--heading, var(--text));
}

.nav-user-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3fb96f;
  flex: none;
}

.nav-cta form { margin: 0; }

@media (max-width: 920px) {
  .nav-user-dropdown { display: none; }
}

/* assets/site.css */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    background: var(--cream);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display {
    font-family: "Fredoka", "Inter", system-ui, sans-serif;
    font-weight: 600;
    line-height: 1.1;
    color: var(--heading);
    letter-spacing: -0.01em;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

::selection { background: var(--pink-soft); color: var(--navy); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

section { padding: 88px 0; }

/* ---------- Focus ---------- */
/* One branded, visible keyboard indicator for the interactive primitives.
   --blue-bright clears 3:1 on both light and dark surfaces. Inputs keep their
   own border + ring focus style (see Forms above). */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--blue-bright);
    outline-offset: 2px;
    border-radius: 4px;
}
.btn:focus-visible { outline-offset: 3px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    cursor: pointer;
    border: none;
    text-decoration: none !important;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn-primary { background: var(--blue-bright); color: #fff; box-shadow: 0 12px 24px -10px rgba(47, 112, 208, 0.6); }
.btn-primary:hover { background: var(--blue); }
.btn-pink { background: var(--pink-strong); color: #fff; box-shadow: 0 12px 24px -10px rgba(200, 69, 92, 0.6); }
.btn-pink:hover { background: var(--pink-ink); }
.btn-ghost { background: var(--card); color: var(--heading); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--blue-bright); }
.btn-small { padding: 9px 18px; font-size: .9rem; min-height: 44px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Eyebrow ---------- */
.eyebrow {
    display: inline-block;
    font-family: "JetBrains Mono", monospace;
    font-size: .8rem;
    font-weight: 500;
    color: var(--pink-ink);
    background: var(--pink-wash);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 18px;
}
.eyebrow.green { color: var(--green); background: var(--green-soft); }

/* ---------- Page head ---------- */
.page-head { padding: 64px 0 0; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin: 0 0 14px; }
.page-head .lede { font-size: 1.15rem; color: var(--muted); max-width: 640px; }

/* ---------- Forms ---------- */
/* Themed base for every text control so inputs/textareas that live OUTSIDE a
   .field wrapper (bare admin textareas, the model autocomplete input, readonly
   prompt boxes) don't fall back to the browser's white background in dark mode. */
textarea,
select,
input:not([type]),
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
input[type="tel"],
input[type="date"] {
    padding: 13px 16px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: var(--card);
    transition: border-color .15s ease, box-shadow .15s ease;
}
textarea:focus,
select:focus,
input:not([type]):focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus {
    outline: none;
    border-color: var(--blue-bright);
    box-shadow: 0 0 0 4px rgba(47, 112, 208, 0.14);
}
/* Date picker indicator stays visible on the dark card background. */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
}
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .9rem; color: var(--heading); margin-bottom: 6px; }
.field input, .field textarea, .field select {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: var(--card);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none;
    border-color: var(--blue-bright);
    box-shadow: 0 0 0 4px rgba(47, 112, 208, 0.14);
}
.field .hint { font-size: .84rem; color: var(--muted); margin-top: 6px; }
.form-card {
    max-width: 680px;
    margin: 0 auto;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 40px;
}
.form-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.form-error { color: var(--pink-strong); font-size: .9rem; font-weight: 500; margin-top: 4px; }
.validation-summary { background: var(--pink-wash); border: 1px solid var(--pink-soft); color: var(--pink-strong); border-radius: 12px; padding: 14px 18px; margin-bottom: 20px; font-size: .94rem; }
.validation-summary ul { margin: 0; padding-left: 20px; }

/* ---------- Notices / alerts ---------- */
.notice { border-radius: 14px; padding: 14px 20px; font-size: .95rem; margin-bottom: 22px; border: 1px solid var(--line); background: var(--card); }
.notice.success { background: var(--green-soft); border-color: var(--green); color: var(--green); }
:root[data-theme="dark"] .notice.success { color: #a9e8c9; }
.notice.warning { background: var(--pink-wash); border-color: var(--pink-soft); color: var(--pink-strong); }
.notice.info { background: var(--blue-soft); border-color: var(--blue-bright); color: var(--blue); }
:root[data-theme="dark"] .notice.info { color: #a9c8ff; }

/* ---------- Cards & panels ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; margin-bottom: 26px; }
.panel h2 { font-size: 1.5rem; margin: 0 0 14px; }
.panel > p.muted, .muted { color: var(--muted); }
.mono { font-family: "JetBrains Mono", monospace; }

/* ---------- Pills ---------- */
.pill {
    display: inline-block;
    font-family: "JetBrains Mono", monospace;
    font-size: .74rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
}
:root[data-theme="dark"] .pill { color: #a9c8ff; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.pink { background: var(--pink-wash); color: var(--pink-strong); }
:root[data-theme="dark"] .pill.pink { color: var(--pink-ink); }

/* ---------- Plans ---------- */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; align-items: stretch; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .18s ease; }
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.plan.featured { border: 2px solid var(--pink); box-shadow: var(--shadow); }
.plan.current { border: 2px solid var(--green); }
.plan-tag { align-self: flex-start; font-family: "JetBrains Mono", monospace; font-size: .76rem; font-weight: 500; color: #fff; background: var(--pink-strong); padding: 5px 13px; border-radius: 999px; margin-bottom: 18px; }
.plan-tag.green { background: var(--green); }
.plan-tag.blue { background: var(--blue-bright); }
.plan h3 { font-size: 1.7rem; margin: 0 0 2px; }
.plan .plan-sub { color: var(--pink-ink); font-weight: 600; font-size: .98rem; margin: 0 0 22px; }
.plan-price { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.plan-price .amount { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: clamp(2.4rem, 5vw, 3.2rem); color: var(--heading); line-height: 1; }
.plan-price .cadence { color: var(--muted); font-size: 1rem; }
.plan-price .then { font-family: "JetBrains Mono", monospace; font-size: .86rem; color: var(--pink-ink); background: var(--pink-wash); padding: 4px 12px; border-radius: 999px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 28px; }
.plan li { position: relative; padding: 9px 0 9px 32px; color: var(--ink); font-size: .99rem; line-height: 1.55; border-bottom: 1px solid var(--line); }
.plan li:last-child { border-bottom: none; }
.plan li::before { content: "→"; position: absolute; left: 2px; color: var(--pink-deep); font-weight: 700; }
.plan li em { font-style: normal; color: var(--muted); font-size: .92rem; }
.plan .btn { justify-content: center; }
.plan .plan-cta { margin-top: auto; align-self: center; text-align: center; }
.plan .plan-note { color: var(--muted); font-size: .92rem; line-height: 1.55; margin: 0; }

/* ---------- Terms strip ---------- */
.terms-strip { margin-top: 28px; background: var(--blue-soft); border-radius: var(--radius); padding: 26px 30px; display: flex; flex-wrap: wrap; gap: 14px 36px; align-items: center; }
.terms-strip .terms-label { font-family: "JetBrains Mono", monospace; font-size: .82rem; font-weight: 500; color: var(--blue-lift); width: 100%; }
.terms-strip .term { display: flex; align-items: center; gap: 9px; font-size: .95rem; font-weight: 500; color: var(--ink); }
.terms-strip .term .plat { color: var(--blue-lift); font-weight: 700; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { font-family: "JetBrains Mono", monospace; font-size: .76rem; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.table td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table a { font-weight: 600; }

/* ---------- Auth providers ---------- */
.auth-providers { display: grid; gap: 12px; margin: 22px 0; }
.provider-btn {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    width: 100%; padding: 13px 20px; border-radius: 12px;
    border: 1.5px solid var(--line); background: var(--card); color: var(--heading);
    font-family: inherit; font-weight: 600; font-size: .98rem; cursor: pointer;
    transition: border-color .15s ease, transform .15s ease;
    text-decoration: none !important;
}
.provider-btn:hover { border-color: var(--blue-bright); transform: translateY(-1px); }
.provider-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.auth-divider { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .86rem; margin: 24px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.auth-alt { text-align: center; margin-top: 24px; font-size: .95rem; color: var(--muted); }

/* ---------- Account nav (sub pages) ---------- */
.account-grid { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }
.account-side { position: sticky; top: 100px; display: grid; gap: 6px; }
.account-side a { padding: 10px 16px; border-radius: 12px; color: var(--ink); font-weight: 500; font-size: .95rem; }
.account-side a:hover { background: var(--card); text-decoration: none; }
.account-side a.active { background: var(--card); color: var(--blue-bright); font-weight: 600; }
@media (max-width: 800px) { .account-grid { grid-template-columns: 1fr; } .account-side { position: static; display: flex; flex-wrap: wrap; } }

/* ---------- Devices ---------- */
.device-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.device-row:last-child { border-bottom: none; }
.device-row .device-icon { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex-shrink: 0; }
.device-row .device-icon .platform-icon { width: 24px; height: 24px; object-fit: contain; }
.device-row .device-info { flex: 1; min-width: 0; }
.device-row .device-name { font-weight: 600; color: var(--heading); }
.device-row .device-meta { font-size: .84rem; color: var(--muted); }

/* ---------- Invoice ---------- */
.invoice-doc { max-width: 760px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 48px; box-shadow: var(--shadow); }
.invoice-doc .invoice-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 36px; }
.invoice-doc .invoice-brand { display: flex; align-items: center; gap: 12px; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 1.4rem; color: var(--heading); }
.invoice-doc .invoice-brand img { width: 40px; height: 40px; }
.invoice-doc h1 { font-size: 2rem; margin: 0; }
.invoice-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 18px; margin-bottom: 32px; }
.invoice-meta .meta-label { font-family: "JetBrains Mono", monospace; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.invoice-total-row td { font-weight: 700; color: var(--heading); font-size: 1.05rem; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty .empty-icon { font-size: 2.6rem; margin-bottom: 14px; }
.empty p { max-width: 420px; margin: 0 auto 20px; }

/* ---------- Footer ---------- */
footer { background: var(--navy); color: #9fb0d6; padding: 56px 0 32px; margin-top: 96px; }
footer .brand { color: #fff; }
footer .brand span { color: #9fb0d6; font-weight: 400; font-size: .9rem; display: block; margin-top: 8px; }
footer h2 { color: #fff; font-size: .95rem; margin: 0 0 14px; }
footer ul { list-style: none; padding: 0; margin: 0; }
footer li { margin-bottom: 9px; }
footer a { color: #9fb0d6; font-size: .92rem; }
footer a:hover { color: #fff; text-decoration: none; }
.foot-grid { display: grid; grid-auto-flow: column; grid-template-columns: 1.4fr; grid-auto-columns: 1fr; gap: 32px; margin-bottom: 36px; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 22px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: .86rem; color: #6c81ad; }
@media (max-width: 920px) { .foot-grid { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .foot-grid { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr; } }

/* ---------- Scroll progress rail ---------- */
/* Fills horizontally as the page scrolls vertically. Pure CSS scroll-driven
   animation: no-JS, no-support, and reduced-motion users simply never see it. */
.scroll-rail {
    position: fixed;
    top: 0; left: 0;
    height: 3px; width: 100%;
    background: linear-gradient(90deg, var(--blue-bright) 0%, var(--pink) 60%, var(--pink-strong) 100%);
    transform: scaleX(0);
    transform-origin: 0 50%;
    z-index: 60;
    pointer-events: none;
}

@keyframes rail-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@supports (animation-timeline: scroll()) {
@media (prefers-reduced-motion: no-preference) {
        .scroll-rail {
            animation: rail-grow linear both;
            animation-timeline: scroll(root);
        }
    }
}

/* ---------- Reveal ---------- */
/* Hidden initial state only applies when JS is running (.js on <html>, set by
   the layout head script) - a no-JS visitor or headless renderer must see
   content, not a blank page. */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.16, 1, .3, 1), transform .7s cubic-bezier(.16, 1, .3, 1); transition-delay: var(--reveal-delay, 0ms); }
.js [data-reveal].revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .js [data-reveal] { opacity: 1; transform: none; transition: none; }
    .btn, .plan, .provider-btn { transition: none; }
    .btn:hover, .plan:hover, .provider-btn:hover { transform: none; }
}

@media (max-width: 800px) {
    section { padding: 60px 0; }
    .form-card { padding: 26px; }
    .invoice-doc { padding: 28px; }
}

/* Skip-to-content link, visible only on keyboard focus (rendered in the layout). */
.skip-link {
    position: absolute;
    left: 16px;
    top: -64px;
    z-index: 100;
    background: var(--navy);
    color: #fff;
    padding: 10px 18px;
    border-radius: 0 0 12px 12px;
    font-weight: 600;
}
.skip-link:focus { top: 0; text-decoration: none; }

/* ---------- Screenshot enlarge ---------- */
img.shot-zoomable { cursor: zoom-in; }
img.shot-zoomable:focus-visible { outline: 3px solid var(--pink-strong); outline-offset: 3px; }
dialog.shot-zoom {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    border: 0;
    background: transparent;
    cursor: zoom-out;
    display: none;
    align-items: center;
    justify-content: center;
}
dialog.shot-zoom[open] { display: flex; }
dialog.shot-zoom::backdrop { background: rgba(4, 10, 24, .86); }
dialog.shot-zoom img {
    max-width: min(100%, 1800px);
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}
.shot-zoom-close {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
.shot-zoom-close:hover, .shot-zoom-close:focus-visible { background: rgba(255, 255, 255, .26); }

