/* ═══════════════════════════════════════════════════════════════════════════
   hiLina Theme — Design Tokens & Base Styles
   Source of truth: lina-onboarding-prd.html + lina-onboarding-prototype.html
   Light theme only (no dark mode in V1).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Font Faces ── */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/hilina/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/hilina/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/hilina/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Keep DM Sans from portfolio_v3 fonts */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/portfolio_v3/dm-sans-latin.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/portfolio_v3/dm-sans-latin.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/portfolio_v3/dm-sans-latin.woff2") format("woff2");
}

/* Keep Playfair Display italic for wordmark "hi" */
@font-face {
  font-family: "Playfair Display";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/portfolio_v3/playfair-display-latin.woff2") format("woff2");
}


/* ═══════════════════════════════════════════════════════════════════════════
   Design Tokens — scoped under .tcfo-theme-hilina
   ═══════════════════════════════════════════════════════════════════════════ */
.tcfo-theme-hilina {
  color-scheme: light;

  /* ── hiLina color tokens ── */
  --hl-bg: #E5E9F4;
  --hl-surface: #FFFFFF;
  --hl-lina-panel: #EFF3FF;
  --hl-cobalt: #0031FF;
  --hl-cobalt-mid: #2B55FF;
  --hl-cobalt-soft: rgba(0, 49, 255, 0.07);
  --hl-cobalt-ring: rgba(0, 49, 255, 0.15);
  --hl-green: #00B85C;
  --hl-yellow: #F2C200;
  --hl-red: #E8002E;
  --hl-amber: #E07B10;
  --hl-txt: #080C1E;
  --hl-txt2: #485080;
  --hl-txtm: #9098C0;
  --hl-bdr: rgba(0, 15, 60, 0.08);
  --hl-bdr-mid: rgba(0, 15, 60, 0.13);

  /* ── Border radius tokens ── */
  --hl-radius-card: 16px;
  --hl-radius-inner: 12px;
  --hl-radius-btn: 10px;
  --hl-radius-pill: 20px;
  --hl-radius-greeting: 14px;
  --hl-radius-metric: 12px;

  /* ── Shadow tokens ── */
  --hl-shadow-card: 0 2px 8px rgba(0, 10, 60, 0.06),
    0 8px 32px rgba(0, 10, 60, 0.05);
  --hl-shadow-sm: 0 1px 3px rgba(0, 10, 60, 0.06),
    0 4px 16px rgba(0, 10, 60, 0.04);

  /* ── Font stacks ── */
  --hl-font-headline: "Inter", "Segoe UI", system-ui, sans-serif;
  --hl-font-body: "DM Sans", "Segoe UI", sans-serif;
  --hl-font-mono: "JetBrains Mono", "SFMono-Regular", "Consolas", monospace;
  --hl-font-wordmark-hi: "Playfair Display", Georgia, serif;

  /* ── Map to Basecoat variable slots ── */
  --font-sans: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", monospace;

  --background: var(--hl-bg);
  --foreground: var(--hl-txt);
  --card: var(--hl-surface);
  --card-foreground: var(--hl-txt);
  --popover: var(--hl-surface);
  --popover-foreground: var(--hl-txt);
  --primary: var(--hl-cobalt);
  --primary-foreground: #FFFFFF;
  --secondary: var(--hl-cobalt-soft);
  --secondary-foreground: var(--hl-cobalt);
  --muted: #F0F2FA;
  --muted-foreground: var(--hl-txtm);
  --accent: #F0F2FA;
  --accent-foreground: var(--hl-txt);
  --destructive: var(--hl-red);
  --border: var(--hl-bdr);
  --input: #F0F2FA;
  --ring: rgba(0, 49, 255, 0.08);
  --radius: var(--hl-radius-btn);
  --radius-sm: 8px;
  --radius-xs: 4px;
  --radius-full: 999px;

  /* ── Basecoat --color-* aliases ── */
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);

  /* ── Shadow ── */
  --shadow-sm: 0 1px 2px rgba(0, 10, 60, 0.04);
  --shadow-card: var(--hl-shadow-sm);
  --shadow-elevated: var(--hl-shadow-card);
  --shadow-floating: 0 12px 32px rgba(0, 10, 60, 0.14),
    0 4px 12px rgba(0, 10, 60, 0.06);

  /* ── TrueCFO compat tokens ── */
  --tcfo-page-bg: var(--hl-bg);
  --tcfo-surface-2: var(--hl-surface);
  --tcfo-surface-3: #F0F2FA;
  --tcfo-surface-4: #F8F9FE;
  --tcfo-line-soft: var(--hl-bdr);
  --tcfo-line-faint: rgba(0, 15, 60, 0.05);
  --tcfo-text-soft: var(--hl-txt2);
  --tcfo-text-faint: var(--hl-txtm);
  --tcfo-blue: var(--hl-cobalt);
  --tcfo-amber: var(--hl-amber);
  --tcfo-amber-dim: rgba(224, 123, 16, 0.08);
  --tcfo-emerald: var(--hl-green);
  --tcfo-emerald-dim: rgba(0, 184, 92, 0.08);
  --tcfo-red: var(--hl-red);
  --tcfo-red-dim: rgba(232, 0, 46, 0.06);
  --tcfo-display-font: var(--hl-font-headline);
  --tcfo-body-font: var(--hl-font-body);
  --tcfo-mono-font: var(--hl-font-mono);

  /* ── Apply to body ── */
  background: var(--hl-bg);
  color: var(--hl-txt);
  font-family: var(--hl-font-body);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Transparent bg for page-level body classes ── */
.tcfo-theme-hilina.auth-page,
.tcfo-theme-hilina.tcfo-page,
.tcfo-theme-hilina.dashboard-v2,
.tcfo-theme-hilina #app {
  background: transparent;
}

/* ── Form elements inherit font ── */
.tcfo-theme-hilina,
.tcfo-theme-hilina button,
.tcfo-theme-hilina input,
.tcfo-theme-hilina select,
.tcfo-theme-hilina textarea {
  font-family: var(--hl-font-body);
}

/* Headlines and labels use Inter */
.tcfo-theme-hilina h1,
.tcfo-theme-hilina h2,
.tcfo-theme-hilina h3,
.tcfo-theme-hilina h4,
.tcfo-theme-hilina h5,
.tcfo-theme-hilina h6 {
  font-family: var(--hl-font-headline);
  color: var(--hl-txt);
}

/* ── Custom scrollbar ── */
.tcfo-theme-hilina ::-webkit-scrollbar { width: 5px; }
.tcfo-theme-hilina ::-webkit-scrollbar-track { background: transparent; }
.tcfo-theme-hilina ::-webkit-scrollbar-thumb {
  background: var(--hl-txtm);
  border-radius: 3px;
}

/* ── Card reveal animation ── */
@keyframes hl-card-reveal {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Links ── */
.tcfo-theme-hilina a {
  transition: color 0.18s ease, opacity 0.18s ease;
}
.tcfo-theme-hilina a:hover {
  color: var(--hl-cobalt);
}

/* ── Cards ── */
.tcfo-theme-hilina .card {
  background: var(--hl-surface);
  border: 1px solid var(--hl-bdr);
  border-radius: var(--hl-radius-card);
  box-shadow: var(--hl-shadow-sm);
  color: var(--hl-txt);
}

/* ── Buttons (Basecoat overrides) ── */
.tcfo-theme-hilina .btn {
  font-family: var(--hl-font-headline);
  font-weight: 600;
  border-radius: var(--hl-radius-btn);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  letter-spacing: 0;
}
.tcfo-theme-hilina .btn:active {
  transform: scale(0.99);
}

.tcfo-theme-hilina .btn-primary {
  background: var(--hl-cobalt);
  border-color: var(--hl-cobalt);
  color: #FFFFFF;
  font-weight: 700;
}
.tcfo-theme-hilina .btn-primary:hover {
  background: var(--hl-cobalt-mid);
  border-color: var(--hl-cobalt-mid);
  color: #FFFFFF;
}

.tcfo-theme-hilina .btn-outline {
  border: 1.5px solid var(--hl-bdr-mid);
  background: var(--hl-surface);
  color: var(--hl-txt);
}
.tcfo-theme-hilina .btn-outline:hover {
  border-color: var(--hl-cobalt);
  background: var(--hl-cobalt-soft);
  color: var(--hl-cobalt);
}

.tcfo-theme-hilina .btn-link {
  color: var(--hl-txtm);
  font-family: var(--hl-font-body);
  font-weight: 400;
}
.tcfo-theme-hilina .btn-link:hover {
  color: var(--hl-txt2);
}

/* ── Inputs ── */
.tcfo-theme-hilina .input,
.tcfo-theme-hilina input[type="text"],
.tcfo-theme-hilina input[type="email"],
.tcfo-theme-hilina input[type="password"] {
  background: #F0F2FA;
  border: 1.5px solid rgba(0, 15, 60, 0.1);
  border-radius: var(--hl-radius-btn);
  font-family: var(--hl-font-headline);
  font-size: 14px;
  color: var(--hl-txt);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tcfo-theme-hilina .input:focus,
.tcfo-theme-hilina input[type="text"]:focus,
.tcfo-theme-hilina input[type="email"]:focus,
.tcfo-theme-hilina input[type="password"]:focus {
  border-color: var(--hl-cobalt);
  box-shadow: 0 0 0 3px rgba(0, 49, 255, 0.08);
  outline: none;
}
.tcfo-theme-hilina .input::placeholder {
  color: #C0C5D8;
}

/* ── Labels ── */
.tcfo-theme-hilina .label {
  font-family: var(--hl-font-headline);
  font-weight: 600;
  font-size: 13px;
  color: var(--hl-txt);
}

/* ── Badges ── */
.tcfo-theme-hilina .badge {
  font-family: var(--hl-font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  border-radius: var(--hl-radius-pill);
}
.tcfo-theme-hilina .badge-primary {
  background: rgba(0, 49, 255, 0.06);
  border: 1px solid rgba(0, 49, 255, 0.15);
  color: var(--hl-cobalt);
}
.tcfo-theme-hilina .badge-secondary {
  background: rgba(0, 15, 60, 0.04);
  color: var(--hl-txt2);
}
.tcfo-theme-hilina .badge-outline {
  border: 1px solid var(--hl-bdr);
  background: transparent;
  color: var(--hl-txtm);
}
.tcfo-theme-hilina .badge-destructive {
  background: rgba(232, 0, 46, 0.08);
  color: var(--hl-red);
}

/* ── Alerts ── */
.tcfo-theme-hilina .alert {
  border-radius: var(--hl-radius-btn);
  font-family: var(--hl-font-body);
  border: 1px solid var(--hl-bdr);
}
.tcfo-theme-hilina .alert-destructive {
  background: rgba(232, 0, 46, 0.04);
  border-color: rgba(232, 0, 46, 0.18);
  color: var(--hl-red);
}

/* ── Focus visible ── */
.tcfo-theme-hilina :focus-visible {
  outline: 2px solid var(--hl-cobalt);
  outline-offset: 2px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .tcfo-theme-hilina,
  .tcfo-theme-hilina * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   hiLina Wordmark
   "hi" = Playfair Display italic, cobalt
   "Lina" = Inter 800, primary text (dark) or white on dark bg
   Same baseline, always live type, never rasterize.
   ═══════════════════════════════════════════════════════════════════════════ */
.hl-wordmark {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  gap: 0;
  line-height: 1;
}
.hl-wordmark-hi {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: var(--hl-cobalt);
}
.hl-wordmark-lina {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 800;
  color: var(--hl-txt);
}

/* Size variants */
.hl-wordmark--lg .hl-wordmark-hi { font-size: 26px; }
.hl-wordmark--lg .hl-wordmark-lina { font-size: 25px; }

.hl-wordmark--md .hl-wordmark-hi { font-size: 20px; }
.hl-wordmark--md .hl-wordmark-lina { font-size: 19px; }

.hl-wordmark--sm .hl-wordmark-hi { font-size: 18px; }
.hl-wordmark--sm .hl-wordmark-lina { font-size: 17px; }

.hl-wordmark--xs .hl-wordmark-hi { font-size: 14px; }
.hl-wordmark--xs .hl-wordmark-lina { font-size: 13px; }

/* Dark background variant */
.hl-wordmark--dark .hl-wordmark-hi { color: #4472FF; }
.hl-wordmark--dark .hl-wordmark-lina { color: #FFFFFF; }

/* Muted text class */
.hl-text-muted {
  color: var(--hl-txtm);
  font-family: var(--hl-font-body);
}

/* Monospace numbers */
.hl-mono {
  font-family: var(--hl-font-mono);
}


/* ═══════════════════════════════════════════════════════════════════════════
   RYG (Red/Yellow/Green) Metric Colors
   ═══════════════════════════════════════════════════════════════════════════ */
.hl-ryg-green { color: var(--hl-green); }
.hl-ryg-yellow { color: var(--hl-yellow); }
.hl-ryg-red { color: var(--hl-red); }

.hl-ryg-bg-green { background-color: var(--hl-green); }
.hl-ryg-bg-yellow { background-color: var(--hl-yellow); }
.hl-ryg-bg-red { background-color: var(--hl-red); }


/* ═══════════════════════════════════════════════════════════════════════════
   Utility classes
   ═══════════════════════════════════════════════════════════════════════════ */
.hl-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;
}

.hl-text-center { text-align: center; }
.hl-text-cobalt { color: var(--hl-cobalt); }
