/*
 * Control Center design tokens (Icelandair / Áróra look).
 *
 * Light ("Lights on") is the Icelandair site: white, navy ink, bright-blue links,
 * a green call-to-action and magenta accent bars. Dark ("Lights off") is Áróra:
 * a near-black navy sky with mint ink and an aurora purple-to-mint gradient.
 *
 * scripts/cc_theme.js sets <html data-theme="light|dark"> before first paint.
 * Every Control Center document (shell, nav frame, content pages, login) links
 * this file; component styles live in cc-theme.css and the pages themselves.
 */
:root {
  color-scheme: light;

  --cc-font: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --cc-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* surfaces */
  --cc-bg: #ffffff;
  --cc-band: #f4f4f4;           /* grey band behind forms (Flight Status) */
  --cc-surface: #ffffff;
  --cc-surface-2: #f7f8fa;      /* zebra rows, subtle fills */
  --cc-tint: #e8f0fd;           /* light-blue panel (site footer) */

  /* text */
  --cc-ink: #001b71;            /* Icelandair navy: headings, nav, strong UI */
  --cc-text: #1c2852;
  --cc-muted: #5d6888;
  --cc-link: #1d5bd6;           /* bright blue: links, eyebrows, focus */

  /* lines */
  --cc-border: #d9dee8;
  --cc-border-strong: #001b71;

  /* actions */
  --cc-primary: #001b71;
  --cc-primary-hover: #0b2c9c;
  --cc-on-primary: #ffffff;
  --cc-cta: #50e08d;            /* green "Search" button */
  --cc-cta-hover: #3fd07c;
  --cc-on-cta: #001b71;
  --cc-accent: #ff3ec0;         /* magenta accent bar (logo, newsletter) */
  --cc-event: #d63384;          /* current event name */

  /* table states */
  --cc-row-hover: #eef3fd;
  --cc-row-selected: #d9e5fb;

  /* feedback */
  --cc-danger: #c4262e;
  --cc-warning: #b25e00;
  --cc-success: #12804a;
  --cc-info: #001b71;

  /* headline fill: plain navy in light, aurora gradient in dark */
  --cc-headline: #1d5bd6;
  --cc-headline-gradient: none;

  /* chart series (dashboard): pale but distinguishable. Checked with the dataviz
     validator on #ffffff (lightness band, chroma, colour-blind and normal-vision
     separation all pass; under 3:1 contrast, so charts keep their labels/legends).
     Order matters: neighbours in this list sit next to each other in the charts. */
  --cc-series-1: #6ea1e2;   /* soft blue */
  --cc-series-2: #e7a170;   /* apricot */
  --cc-series-3: #1aa598;   /* sea teal */
  --cc-series-4: #bda3ec;   /* lavender */
  --cc-series-5: #c1628a;   /* dusty rose */
  --cc-series-6: #c7b261;   /* sand */
  --cc-chart-grid: #e3e7ef;
  --cc-chart-hole: #ffffff;

  --cc-radius: 2px;
  --cc-radius-lg: 4px;
  --cc-shadow: 0 1px 2px rgba(0, 27, 113, 0.06), 0 4px 14px rgba(0, 27, 113, 0.08);
  --cc-shadow-pop: 0 10px 40px rgba(0, 27, 113, 0.18);
  --cc-focus-ring: 0 0 0 3px rgba(29, 91, 214, 0.28);
}

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

  --cc-bg: #000a1f;
  --cc-band: #031330;
  --cc-surface: #061633;
  --cc-surface-2: #0a1c3d;
  --cc-tint: #0c2148;

  --cc-ink: #7ef0c0;            /* Áróra mint */
  --cc-text: #dde6f5;
  --cc-muted: #91a1c2;
  --cc-link: #7ef0c0;

  --cc-border: #1a2c54;
  --cc-border-strong: #7ef0c0;

  --cc-primary: #7ef0c0;
  --cc-primary-hover: #a3f5d4;
  --cc-on-primary: #000a1f;
  --cc-cta: #50e08d;
  --cc-cta-hover: #74e9a6;
  --cc-on-cta: #000a1f;
  --cc-accent: #ff5cc8;
  --cc-event: #ff6fcf;

  --cc-row-hover: #0d2249;
  --cc-row-selected: #123166;

  --cc-danger: #ff7a85;
  --cc-warning: #ffb45c;
  --cc-success: #6ee7a8;
  --cc-info: #7ef0c0;

  --cc-headline: #7ef0c0;
  --cc-headline-gradient: linear-gradient(100deg, #b98cf5 0%, #9fb3ea 35%, #74e3b5 70%, #6fe0b0 100%);

  --cc-series-1: #65d1ff;
  --cc-series-2: #ffb563;
  --cc-series-3: #84f0c5;
  --cc-series-4: #c4a0ff;
  --cc-series-5: #ff8aa0;
  --cc-series-6: #8aa0bd;
  --cc-chart-grid: #1c2e56;
  --cc-chart-hole: #061633;

  --cc-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.35);
  --cc-shadow-pop: 0 12px 44px rgba(0, 0, 0, 0.6);
  --cc-focus-ring: 0 0 0 3px rgba(126, 240, 192, 0.3);
}

/* Áróra-style gradient headline; plain colour where gradients are off */
.cc-headline {
  color: var(--cc-headline);
}
:root[data-theme="dark"] .cc-headline {
  background-image: var(--cc-headline-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* "Lights on / Lights off" switch, shared by the nav and the login page */
.cc-lights {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--cc-link);
  cursor: pointer;
}
.cc-lights .cc-lights-track {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 13px;
  border: 2px solid var(--cc-link);
  flex-shrink: 0;
  transition: border-color 160ms ease;
}
.cc-lights .cc-lights-knob {
  position: absolute;
  top: 2px;
  left: 22px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cc-link);
  color: var(--cc-bg);
  display: grid;
  place-items: center;
  font-size: 11px;
  transition: left 160ms ease, background 160ms ease;
}
:root[data-theme="dark"] .cc-lights .cc-lights-knob {
  left: 2px;
}
/* both states are in the markup; show the one matching the theme */
.cc-lights .cc-when-dark { display: none; }
:root[data-theme="dark"] .cc-lights .cc-when-dark { display: inline; }
:root[data-theme="dark"] .cc-lights .cc-when-light { display: none; }
.cc-lights:focus-visible {
  outline: none;
}
.cc-lights:focus-visible .cc-lights-track {
  box-shadow: var(--cc-focus-ring);
}
@media (prefers-reduced-motion: reduce) {
  .cc-lights .cc-lights-track,
  .cc-lights .cc-lights-knob { transition: none; }
}
