/* ═══════════════════════════════════════════════════════════════════════════
   FLYYO Corporate Theme
   ═══════════════════════════════════════════════════════════════════════════
   Drop this file into any Flyyo project and import it before your app CSS.
   It provides brand colors, semantic tokens, and shared header/gate styles.

   Usage:
     import './flyyo-theme.css';  // in main.jsx / App.jsx

   Typography:
     Primary:  Roboto (300 Light, 400 Regular, 500 Medium, 700 Bold)
     Fallback: Arial (400 Regular, 700 Bold)
     Nothing else. No system-ui, no serif, no monospace for UI text.

   Brand colors:
     Primary (Navy):     #252F49  rgb(37, 47, 73)
     Accent (Turquoise): #86C0C1  rgb(134, 192, 193)

   Luminance & Contrast (WCAG 2.1):
     #252F49 relative luminance: 0.0291
     #86C0C1 relative luminance: 0.4737
     White (#fff) on #252F49:  13.28:1  ✓ AAA (any size)
     #86C0C1 on #252F49:       9.83:1  ✓ AAA (any size)
     #252F49 on #86C0C1:       9.83:1  ✓ AAA (any size)
     #252F49 on white:         13.28:1  ✓ AAA (any size)
     #86C0C1 on white:          1.85:1  ✗ decorative only

   Header text on #252F49 background:
     rgba(255,255,255, 1.00) → #ffffff  13.28:1  ✓ AAA  (logo, primary text)
     rgba(255,255,255, 0.85) → #dee0e4  10.05:1  ✓ AAA  (subtitle row 1)
     rgba(255,255,255, 0.50) → #929ab4   4.56:1  ✓ AA   (subtitle row 2, muted)
     rgba(255,255,255, 0.40) → #7a8297   3.37:1  ✗      (decorative only)

   Guideline: all readable text must meet WCAG AA (4.5:1). Aim for AAA (7:1)
   on primary content. Use 0.40 and below only for decorative/non-essential.
   ═══════════════════════════════════════════════════════════════════════════ */


/* ─── Typography ────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');


/* ─── Brand Tokens ──────────────────────────────────────────────────────── */

:root {
  /* Font stack */
  --flyyo-font: 'Roboto', Arial, sans-serif;
  /* Corporate palette */
  --flyyo-navy: #252F49;
  --flyyo-turquoise: #86C0C1;

  /* Derived from navy */
  --flyyo-navy-light: #2e3a58;
  /* lighter shade for hover states     */
  --flyyo-navy-dark: #1b2237;
  /* darker shade for active/pressed     */

  /* Derived from turquoise */
  --flyyo-turquoise-soft: rgba(134, 192, 193, 0.15);
  /* tint for backgrounds */
  --flyyo-turquoise-mid: rgba(134, 192, 193, 0.40);
  /* borders, dividers    */
  --flyyo-turquoise-text: #5fa8a9;
  /* readable on white bg — 3.2:1, use ≥18px bold or decorative */

  /* Header text hierarchy (on --flyyo-navy background) */
  --header-text-primary: rgba(255, 255, 255, 1.00);
  /* 13.28:1 AAA — logo, app name      */
  --header-text-secondary: rgba(255, 255, 255, 0.85);
  /* 10.05:1 AAA — subtitle, module     */
  --header-text-tertiary: rgba(255, 255, 255, 0.50);
  /*  4.56:1 AA  — model, version       */
  --header-text-muted: rgba(255, 255, 255, 0.40);
  /*  3.37:1     — decorative, icon rest */
  --header-text-subtle: rgba(255, 255, 255, 0.15);
  /*             — separators, borders   */

  /* Semantic mapping (override per-theme below) */
  --bg-header: var(--flyyo-navy);
}


/* ─── Dark Theme ────────────────────────────────────────────────────────── */

:root,
[data-theme="dark"] {
  --accent: var(--flyyo-turquoise);
  --accent-soft: var(--flyyo-turquoise-soft);
  --accent-text: #1a1a1a;
  /* dark text on turquoise bg — 9.3:1 */
  --gate-bg: var(--flyyo-navy);
}


/* ─── Light Theme ───────────────────────────────────────────────────────── */

[data-theme="light"] {
  --accent: #0d9488;
  /* darker teal for light bg — 4.54:1 on white */
  --accent-soft: var(--flyyo-turquoise-soft);
  --accent-text: #fff;
  --gate-bg: var(--flyyo-navy);
}


/* ─── Base Layout ───────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html, body, #root {
  height: 100%;
}

html {
  scrollbar-gutter: stable;
}

#root {
  overflow-y: scroll;
  scrollbar-width: thin;
  scrollbar-color: rgba(134, 192, 193, 0.25) transparent;
}

#root::-webkit-scrollbar {
  width: 6px;
}

#root::-webkit-scrollbar-track {
  background: transparent;
}

#root::-webkit-scrollbar-thumb {
  background: rgba(134, 192, 193, 0.25);
  border-radius: 3px;
}

#root::-webkit-scrollbar-thumb:hover {
  background: rgba(134, 192, 193, 0.45);
}

body {
  margin: 0;
  font-family: var(--flyyo-font);
  overflow-x: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}


/* ─── Header ────────────────────────────────────────────────────────────── */

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-header);
  color: var(--header-text-primary);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  padding: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.logo img {
  height: 28px;
  display: block;
}

.header-subtitle {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--header-text-secondary);
  line-height: 1.3;
}

.header-model {
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--header-text-tertiary);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-version {
  font-size: 12px;
  color: var(--header-text-muted);
}

.hdr-btn {
  color: var(--header-text-tertiary);
  font-size: 13px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s, background 0.2s;
}

.hdr-btn:hover {
  color: var(--header-text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.hdr-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.hdr-btn.spinning svg {
  animation: spin 0.8s linear infinite;
}

.hdr-sep {
  width: 1px;
  height: 20px;
  background: var(--header-text-subtle);
}

.theme-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
}

.theme-btn {
  background: none;
  border: none;
  color: var(--header-text-muted);
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.theme-btn.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--header-text-primary);
}


/* ─── Login Gate ────────────────────────────────────────────────────────── */

.gate {
  min-height: 100vh;
  background: var(--gate-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gate-card {
  width: 340px;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.gate-logo {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
}

.gate-logo .fly {
  color: var(--flyyo-navy);
}

.gate-logo .yo {
  color: var(--flyyo-turquoise);
}

.gate-subtitle {
  text-align: center;
  color: #64748b;
  font-size: 14px;
  margin-top: 6px;
  margin-bottom: 16px;
}

.gate-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  font-size: 14px;
}

.gate-input:focus {
  outline: none;
  border-color: var(--flyyo-navy);
}

.gate-input.error {
  border-color: #ef4444;
  animation: shake 0.3s ease-in-out;
}

.gate-button {
  width: 100%;
  background: var(--flyyo-navy);
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  margin-top: 14px;
  transition: background 0.2s;
}

.gate-button:hover {
  background: var(--flyyo-navy-light);
}


/* ─── Shared Utilities ──────────────────────────────────────────────────── */

.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--spinner-track, rgba(255, 255, 255, 0.1));
  border-top-color: var(--flyyo-turquoise);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-6px);
  }

  50% {
    transform: translateX(6px);
  }

  75% {
    transform: translateX(-4px);
  }

  100% {
    transform: translateX(0);
  }
}


/* ─── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .header {
    height: auto;
    min-height: 56px;
  }
  .header-inner {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 4px;
  }
  .header-left { gap: 8px; }
  .header-subtitle { font-size: 10px; }
  .header-model { font-size: 8px; }
  .header-controls { gap: 4px; flex-wrap: wrap; }
  .header-version { font-size: 10px; }
  .hdr-btn { padding: 4px 6px; font-size: 11px; }
  .hdr-sep { height: 16px; }
  .theme-btn { font-size: 10px; padding: 3px 8px; }
  .logo img { height: 22px; }
}

@media (max-width: 480px) {
  .header-subtitle { display: none; }
  .hdr-sep { display: none; }
  .header-controls { gap: 3px; }
  .theme-btn { font-size: 9px; padding: 3px 6px; }
  .header-version { font-size: 9px; }
  .hdr-btn { padding: 3px 5px; font-size: 10px; }
}