/* fino.bot — the same design system as the desktop app (Fino/frontend/src/index.css).
   Tokens, panels, type scale, tile and button sizes are copied from there so the site reads
   as the same product: one accent (the logo blue #0079FC), white + two grays, hairline
   borders, status colours as small dots and tints rather than fills. Dark follows the
   OS; the light theme is the app's light theme. No external resources: the two variable
   fonts are served from /static/fonts (DM Sans for every UI surface, Manrope for the
   lowercase "fino" wordmark only, as the app does). */

@font-face {
  font-family: "DM Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url(/static/fonts/dm-sans-latin-opsz.woff2) format("woff2-variations");
}
@font-face {
  font-family: "Manrope Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/static/fonts/manrope-latin.woff2) format("woff2-variations");
}

/* ---- tokens: the app's light theme, then its dark theme by OS preference ---- */
:root {
  --background: #ffffff;
  --foreground: #16171c;
  --card: #f4f5f7;
  --popover: #ffffff;
  --secondary: #e8eaef;
  --muted: #e9ebf0;
  --muted-foreground: #5b5e6b;
  --subtle: #6b6e7b;
  --accent: color-mix(in srgb, #0079fc 10%, transparent);
  --destructive: #c92a3c;
  --border: rgba(0, 0, 0, 0.09);
  --input: rgba(0, 0, 0, 0.15);
  --brand: #0079fc;
  --brand-ink: #0063cf;
  --ok: #3a7a10;
  --warn: #8f6408;
  --hover: #e9ebf0;
  --sidebar: #f6f7f9;
  --radius: 0.5rem;
  --font-sans: "DM Sans Variable", ui-sans-serif, system-ui, sans-serif;
  --font-brand: "Manrope Variable", ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #1a1b20;
    --foreground: #ffffff;
    --card: #222329;
    --popover: #2a2b33;
    --secondary: #2a2b33;
    --muted: #26272e;
    --muted-foreground: #a2a4b1;
    --subtle: #6c6e7c;
    --accent: color-mix(in srgb, #0079fc 14%, transparent);
    --destructive: #ed5564;
    --border: rgba(255, 255, 255, 0.06);
    --input: rgba(255, 255, 255, 0.11);
    --brand: #0079fc;
    --brand-ink: #6eb3fd;
    --ok: #95bf47;
    --warn: #e3b341;
    --hover: #2a2b33;
    --sidebar: #141519;
    color-scheme: dark;
  }
}

/* ---- the public pages are FIXED DARK: the hero, the 404, the congrats page (html.ts layout) ----
   PINNED LITERALS, deliberately not references to the dark block above and deliberately outside
   any prefers-color-scheme query: these pages are dark whatever the OS says, with nothing for a
   client to honour and nothing that flips. The values are the dark theme's, copied, so the
   pages look exactly as they did in dark mode; if the dark theme ever changes, change these on
   purpose or leave the public pages where the owner approved them. Every other page keeps the
   token system above untouched. */
body.fixed-dark {
  --background: #1a1b20;
  --foreground: #ffffff;
  --card: #222329;
  --popover: #2a2b33;
  --secondary: #2a2b33;
  --muted: #26272e;
  --muted-foreground: #a2a4b1;
  --subtle: #6c6e7c;
  --accent: color-mix(in srgb, #0079fc 14%, transparent);
  --destructive: #ed5564;
  --border: rgba(255, 255, 255, 0.06);
  --input: rgba(255, 255, 255, 0.11);
  --brand: #0079fc;
  --brand-ink: #6eb3fd;
  --ok: #95bf47;
  --warn: #e3b341;
  --hover: #2a2b33;
  --sidebar: #141519;
  color-scheme: dark;
}

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { font-family: var(--font-sans); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--background); color: var(--foreground); font-size: 14px; line-height: 1.5; display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
button:not(:disabled) { cursor: pointer; }
code { font-family: inherit; }
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* the brand lockup (GateBrand in the app): the mark in brand blue + the lowercase wordmark */
.lockup { display: flex; align-items: center; justify-content: center; gap: 10px; }
.lockup .mark { height: 36px; width: auto; color: var(--brand); }
.lockup .wordmark { font-family: var(--font-brand); font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; text-transform: lowercase; transform: translateY(-1px); }

/* ---- chrome ---- */
.topbar { height: 52px; background: var(--sidebar); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
/* The header brand is the kit's <Lockup> (@fino/ui), to the pixel: a 20px mark, an 18px
   wordmark and an 8px gap. The public pages and the dashboard sit one click apart, so a
   header that changes size between them reads as two different sites (owner, 2026-10-11).
   If Lockup's sizes ever change, these change with them. */
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--foreground); text-decoration: none; }
.brand:hover { text-decoration: none; }
/* Two files, one shown: the gradient mark reads on dark, the solid one on light (the
   gradient's white end vanishes on a white page). Same swap the kit's <LogoMark> does with
   dark:hidden / hidden dark:block. */
.brand .mark { height: 20px; width: auto; display: block; }
.brand .mark.dark { display: none; }
@media (prefers-color-scheme: dark) {
  .brand .mark.light { display: none; }
  .brand .mark.dark { display: block; }
}
/* The pinned-dark pages are dark whatever the OS says, so they always take the gradient. */
body.fixed-dark .brand .mark.light { display: none; }
body.fixed-dark .brand .mark.dark { display: block; }
.brand .wordmark { font-family: var(--font-brand); font-size: 18px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; text-transform: lowercase; }
.nav { display: flex; align-items: center; gap: 8px; }
.nav form { margin: 0; }
main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px; }
.footer { border-top: 1px solid var(--border); padding: 14px 24px; display: flex; gap: 6px; align-items: center; font-size: 11px; font-weight: 600; color: var(--subtle); }
.footer a { color: inherit; }

/* ---- type ---- */
.subtle { color: var(--subtle); }
.tiny { font-size: 11.5px; font-weight: 600; color: var(--subtle); }
.label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--subtle); }
.label .icon { color: var(--brand); }

/* ---- layout ---- */
.stack { display: flex; flex-direction: column; gap: 12px; }

/* the 24px icon tile from the app's GateTile, in a tone */
.ic-tile { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 10px; flex-shrink: 0; }
.ic-tile.brand { background: var(--accent); color: var(--brand); }
.ic-tile.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.ic-tile.destructive { background: color-mix(in srgb, var(--destructive) 14%, transparent); color: var(--destructive); }
.ic-tile.lg { width: 36px; height: 36px; border-radius: 12px; }

/* ---- buttons: the app's sm size (h-7, 0.8rem) and default (h-8) ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 10px; border: 1px solid transparent; background: var(--popover); color: var(--foreground); font-size: 0.8rem; font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none; transition: background-color 120ms, opacity 120ms, transform 60ms; }
.btn:hover { text-decoration: none; background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 14px; height: 14px; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: color-mix(in srgb, var(--brand) 80%, transparent); }
.btn.ghost { background: transparent; color: var(--muted-foreground); }
.btn.ghost:hover { background: var(--hover); color: var(--foreground); }
.btn.lg { height: 36px; padding: 0 14px; font-size: 14px; font-weight: 600; border-radius: 12px; }
.btn.lg .icon { width: 16px; height: 16px; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 50%, transparent); }

/* ---- notices ---- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: color-mix(in srgb, var(--muted) 40%, transparent); margin: 0; }
.notice .icon { margin-top: 1px; }
.notice b { display: block; font-size: 13px; }
.notice span { display: block; font-size: 13px; color: var(--muted-foreground); }
.notice.ok { border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.notice.ok .icon, .notice.ok b { color: var(--ok); }
.notice.warn { border-color: color-mix(in srgb, var(--warn) 30%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.notice.warn .icon, .notice.warn b { color: var(--warn); }
.notice.err { border-color: color-mix(in srgb, var(--destructive) 30%, transparent); background: color-mix(in srgb, var(--destructive) 10%, transparent); }
.notice.err .icon, .notice.err b { color: var(--destructive); }
.notice.brand { border-color: color-mix(in srgb, var(--brand) 30%, transparent); background: var(--accent); }
.notice.brand .icon, .notice.brand b { color: var(--brand-ink); }

/* ---- the gate card (welcome / sign-in) ---- */
.gate-wrap { display: flex; justify-content: center; padding: 32px 0; }
.gate { width: 100%; max-width: 480px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 28px 24px 20px; display: flex; flex-direction: column; gap: 18px; text-align: center; align-items: center; }
.gate .title { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.gate .body { font-size: 14px; color: var(--muted-foreground); margin: 4px 0 0; }
.gate .actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.gate .foot { font-size: 11px; font-weight: 600; color: var(--subtle); display: flex; gap: 6px; }
.gate form { margin: 0; }

/* ---- the congrats page (html.ts welcomeCongrats): the mark draws itself, the words sit in its clear half ----
   One pass: the stroke draws over 1.6 s, the fill tints in, the words rise; every animation
   runs once (iteration-count 1, fill-mode forwards) and the last ends at 2.6 s. Nothing loops,
   nothing pulses. Reduced motion: the finished composition, nothing moving. */
.congrats { position: relative; flex: 1; min-height: calc(100vh - 52px); overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 48px 24px 96px 52%; }
.congrats .draw { position: absolute; top: 50%; left: 50%; height: 118vh; width: auto; transform: translate(-96%, -50%); pointer-events: none; }
.congrats .ink { fill: var(--brand); opacity: 0; animation: congrats-ink 0.6s ease-out 1.5s 1 forwards; }
.congrats .line { fill: none; stroke: var(--brand); stroke-width: 4; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: congrats-draw 1.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s 1 forwards; }
@keyframes congrats-draw { to { stroke-dashoffset: 0; } }
@keyframes congrats-ink { to { opacity: 0.16; } }
.congrats-inner { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; max-width: 560px; }
/* the burst canvas (app.js): behind the words and the button, above the mark, never clickable */
.burst { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.congrats-h1 { margin: 0; font-size: clamp(44px, 6.2vw, 84px); font-weight: 800; letter-spacing: -0.05em; line-height: 0.96; }
.congrats-h1 span { display: block; }
.congrats-h1 .in { color: var(--brand-ink); }
.congrats-where { margin: 22px 0 0; font-size: 17px; color: var(--muted-foreground); }
.congrats .btn.xl { margin-top: 20px; }
.congrats .rise { opacity: 0; transform: translateY(16px); animation: congrats-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 1 forwards; }
.congrats-h1 .rise:first-child { animation-delay: 1.6s; }
.congrats-h1 .in { animation-delay: 1.72s; }
.congrats .congrats-where { animation-delay: 1.9s; }
.congrats .btn.rise { animation-delay: 2s; }
@keyframes congrats-rise { to { opacity: 1; transform: none; } }
@media (prefers-color-scheme: dark) { @keyframes congrats-ink { to { opacity: 0.22; } } }
@media (prefers-reduced-motion: reduce) {
  .congrats .line { animation: none; stroke-dashoffset: 0; }
  .congrats .ink { animation: none; opacity: 0.16; }
  .congrats .rise { animation: none; opacity: 1; transform: none; }
}
/* 390: the mark sits high and to the right, cropped by the right edge, and ends above the
   words, which take the lower third at full width; the two never share a line. */
@media (max-width: 760px) {
  .congrats { padding: 80px 16px 48px; justify-content: flex-end; min-height: calc(100vh - 52px); }
  .congrats .draw { height: 64vh; top: 34%; left: 68%; transform: translate(-50%, -50%); }
  .congrats .line { stroke-width: 5; opacity: 0.7; }
  .congrats-inner { max-width: none; width: 100%; }
  .congrats-h1 { font-size: clamp(44px, 13vw, 64px); }
  .congrats .btn.xl { width: 100%; }
}

/* ---- the public root: the hero ----
   One screen, one action, in the house style rather than the references' full-bleed blue: a
   soft brand glow and a dot grid behind a large headline (CSS only; no image, no animation).
   The canvas is NOT white: src/html.ts puts `is-hero fixed-dark` on <body> for the hero and
   the bare pages, so --background is the dark theme's #1a1b20 whatever the OS says (see
   body.fixed-dark above). The topbar sits on that canvas, and there is no footer at all --
   html.ts emits the footer only on the pages that are neither hero nor bare. */
body.is-hero .topbar { background: transparent; border-bottom-color: transparent; }
body.is-hero main { max-width: none; padding: 0; display: flex; }
.hero { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 52px); padding: 48px 24px 96px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 50% 38%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
    radial-gradient(circle, var(--input) 1px, transparent 1.2px) 0 0 / 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 45%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 45%, #000 40%, transparent 100%); }
.hero-inner { position: relative; width: 100%; max-width: 760px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 22px; }
.hero-h1 { font-size: clamp(40px, 7.2vw, 76px); font-weight: 800; letter-spacing: -0.045em; line-height: 0.98; margin: 6px 0 0; text-wrap: balance; }
.hero-lead { font-size: 17px; line-height: 1.5; color: var(--muted-foreground); margin: 0; max-width: 560px; text-wrap: pretty; }
.hero-cta { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 6px; }
.btn.xl { height: 48px; padding: 0 22px; font-size: 16px; font-weight: 700; border-radius: 14px; gap: 8px; }
.btn.xl .icon { width: 18px; height: 18px; }
.btn.primary.xl { box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--brand) 60%, transparent); }
.btn.primary:disabled { background: var(--secondary); color: var(--subtle); box-shadow: none; cursor: not-allowed; }
.hero-cta .tiny.warn { color: var(--warn); }

/* ---- 404 (html.ts notFound): the mark, faded and large, carries the page; the copy sits in its clear half ---- */
.nf { position: relative; flex: 1; display: flex; align-items: center; justify-content: flex-start; min-height: calc(100vh - 52px); padding: 48px 24px 96px; overflow: hidden; }
.nf-inner { position: relative; display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 22px; max-width: 720px; margin-left: clamp(0px, 8vw, 120px); }
.nf-status { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; color: var(--subtle); font-variant-numeric: tabular-nums; }
.nf-h1 { font-size: clamp(34px, 5.2vw, 56px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; margin: 0; text-wrap: balance; }
.nf-link { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: var(--brand-ink); }
.nf-link:hover { text-decoration: none; color: var(--brand); }
.nf-markwrap { position: absolute; right: -6vw; top: 50%; transform: translateY(-50%); height: 120vh; width: auto; color: var(--brand); opacity: 0.07; pointer-events: none; }
.nf-markwrap .mark { height: 100%; width: auto; display: block; }

/* ---- responsive ---- */
@media (max-width: 860px) {
  main { padding: 16px; }
  .topbar, .footer { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 480px) {
  .hero { padding: 24px 16px 48px; }
  .nf { padding: 24px 16px 64px; }
  .nf-inner { margin-left: 0; }
  .nf-markwrap { right: -30vw; opacity: 0.06; }
  .hero-inner { gap: 18px; }
  .hero-lead { font-size: 15px; }
  .btn.xl { width: 100%; max-width: 320px; }
}
