/* ==========================================================================
   vLoganair design tokens — shared by the public site, CrewHub and the
   back office. Light is the base; dark applies when <html> has
   data-theme="dark" (set by /assets/vl/theme.js before first paint).
   ========================================================================== */

:root {
  color-scheme: light;

  /* Brand */
  --vl-brand:        #d01f27;   /* Loganair red */
  --vl-brand-hover:  #ac141c;
  --vl-brand-soft:   rgba(208, 31, 39, .08);
  --vl-brand-ring:   rgba(208, 31, 39, .28);
  --vl-on-brand:     #ffffff;
  --vl-navy:         #070b14;

  /* Surfaces */
  --vl-bg:           #f3f1ed;
  --vl-surface:      #ffffff;
  --vl-surface-2:    #f6f4f0;
  --vl-surface-3:    #ebe7e0;
  --vl-overlay:      rgba(255, 255, 255, .86);

  /* Lines and text */
  --vl-border:       #e2ded6;
  --vl-border-strong:#cdc7bc;
  --vl-text:         #0c1220;
  --vl-muted:        #4d5668;
  --vl-faint:        #8a93a2;

  /* Subtle tints for hovers, stripes and wells */
  --vl-tint-1:       rgba(15, 20, 27, .03);
  --vl-tint-2:       rgba(15, 20, 27, .06);
  --vl-tint-3:       rgba(15, 20, 27, .10);

  /* Status */
  --vl-success:      #15803d;
  --vl-success-soft: rgba(21, 128, 61, .10);
  --vl-warning:      #b45309;
  --vl-warning-soft: rgba(180, 83, 9, .10);
  --vl-danger:       #b91c1c;
  --vl-danger-soft:  rgba(185, 28, 28, .09);
  --vl-info:         #1d4ed8;
  --vl-info-soft:    rgba(29, 78, 216, .09);

  /* Shape and depth */
  --vl-radius-sm:    8px;
  --vl-radius:       12px;
  --vl-radius-lg:    18px;
  --vl-shadow-sm:    0 1px 2px rgba(15, 20, 27, .06);
  --vl-shadow:       0 1px 2px rgba(15, 20, 27, .05), 0 8px 24px -12px rgba(15, 20, 27, .14);
  --vl-shadow-lg:    0 24px 48px -20px rgba(15, 20, 27, .28);

  /* Type */
  --vl-font:         "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --vl-font-mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --vl-brand:        #e0282f;
  --vl-brand-hover:  #ec4148;
  --vl-brand-soft:   rgba(224, 40, 47, .16);
  --vl-brand-ring:   rgba(224, 40, 47, .42);

  --vl-bg:           #0b101b;
  --vl-surface:      #0f1524;
  --vl-surface-2:    #141b2c;
  --vl-surface-3:    #1a2335;
  --vl-overlay:      rgba(11, 16, 27, .84);

  --vl-border:       #1f2840;
  --vl-border-strong:#2c3754;
  --vl-text:         #eef2f8;
  --vl-muted:        #9aa6ba;
  --vl-faint:        #6b778c;

  --vl-tint-1:       rgba(255, 255, 255, .03);
  --vl-tint-2:       rgba(255, 255, 255, .06);
  --vl-tint-3:       rgba(255, 255, 255, .10);

  --vl-success:      #4ade80;
  --vl-success-soft: rgba(74, 222, 128, .12);
  --vl-warning:      #fbbf24;
  --vl-warning-soft: rgba(251, 191, 36, .12);
  --vl-danger:       #f87171;
  --vl-danger-soft:  rgba(248, 113, 113, .12);
  --vl-info:         #60a5fa;
  --vl-info-soft:    rgba(96, 165, 250, .12);

  --vl-shadow-sm:    0 1px 2px rgba(0, 0, 0, .4);
  --vl-shadow:       0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px -14px rgba(0, 0, 0, .6);
  --vl-shadow-lg:    0 28px 56px -24px rgba(0, 0, 0, .75);
}

/* Theme toggle button (same markup everywhere) */
.vl-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--vl-border); background: var(--vl-surface);
  color: var(--vl-muted); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.vl-theme-toggle:hover { color: var(--vl-text); border-color: var(--vl-border-strong); }
.vl-theme-toggle:focus-visible { outline: 2px solid var(--vl-brand-ring); outline-offset: 2px; }
.vl-theme-toggle svg { width: 17px; height: 17px; }
.vl-theme-toggle .vl-icon-sun,
.vl-theme-toggle .vl-icon-moon,
.vl-theme-toggle .vl-icon-auto { display: none; }
.vl-theme-toggle[data-mode="light"]  .vl-icon-sun  { display: block; }
.vl-theme-toggle[data-mode="dark"]   .vl-icon-moon { display: block; }
.vl-theme-toggle[data-mode="system"] .vl-icon-auto { display: block; }

/* Show an element in one theme only (e.g. the two logo variants) */
:root:not([data-theme="dark"]) .vl-only-dark,
:root[data-theme="dark"] .vl-only-light { display: none !important; }

/* Woven tartan accent (public site, CrewHub, back office) */
.tartan {
  background-color: #b3141d;
  background-image:
    repeating-linear-gradient(45deg, rgba(0,0,0,.10) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(10,10,14,.62) 18px 38px, transparent 38px 43px, rgba(255,255,255,.8) 43px 45px, transparent 45px 50px, rgba(10,10,14,.35) 50px 54px, transparent 54px 72px),
    repeating-linear-gradient(0deg,  transparent 0 18px, rgba(10,10,14,.62) 18px 38px, transparent 38px 43px, rgba(255,255,255,.8) 43px 45px, transparent 45px 50px, rgba(10,10,14,.35) 50px 54px, transparent 54px 72px);
}
