/* =================================================================
   SECRET WEAPON - Theme Tokens (Light, Hyper Modern)
   Extends Headliner Group design system.
   White canvas, black ink, single Pink (#E4346F) accent.
   Rounded geometry, generous spacing, soft shadows.
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=League+Spartan:wght@400;500;600;700;800;900&family=Work+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500&display=swap');

:root {
  /* ============== HEADLINER CORE (inherited) ====================== */
  --ink-black: #000000;
  --pure-white: #FFFFFF;

  /* Signal accents */
  --signal-blue:   #4784F6;
  --signal-green:  #7ED957;
  --signal-pink:   #E4346F;
  --signal-yellow: #FFDE59;

  /* Hover / press states for the Pink accent */
  --pink-hover:    #F1487D;
  --pink-press:    #C82A60;
  --pink-tint-5:   rgba(228, 52, 111, 0.05);
  --pink-tint-10:  rgba(228, 52, 111, 0.10);
  --pink-tint-20:  rgba(228, 52, 111, 0.20);
  --pink-ring:     rgba(228, 52, 111, 0.30);

  /* HAL eye. Deliberate one-off used only on the loader orbit core;
     never use elsewhere - the rest of the product stays on Pink. */
  --hal-red:       #E11D2A;
  --hal-red-soft:  #FF4554;
  --hal-red-glow:  rgba(225, 29, 42, 0.55);

  /* ============== NEUTRAL SCALE (warm, soft) ====================== */
  --lt-0:  #FFFFFF;   /* canvas                         */
  --lt-1:  #FAFAF9;   /* subtle background, hover wash  */
  --lt-2:  #F4F4F2;   /* card surface, raised cards     */
  --lt-3:  #E9E8E5;   /* hairlines, input borders idle  */
  --lt-4:  #D6D5D1;   /* stronger borders, dividers     */
  --lt-5:  #ADAAA3;   /* tertiary text, icons-disabled  */
  --lt-6:  #6E6B65;   /* secondary text                 */
  --lt-7:  #3A3835;   /* near-black text on light bg    */
  --lt-8:  #1A1916;   /* primary text                   */

  /* ============== SEMANTIC TOKENS ================================= */

  /* Foregrounds */
  --fg-1: var(--ink-black);       /* primary text */
  --fg-2: var(--lt-6);             /* secondary text */
  --fg-3: var(--lt-5);             /* tertiary text / placeholder */
  --fg-4: var(--lt-4);             /* disabled / icons */
  --fg-on-accent: var(--pure-white); /* type on Pink CTAs */

  /* Backgrounds */
  --bg-canvas: var(--pure-white);
  --bg-subtle: var(--lt-1);
  --bg-card:   var(--pure-white);
  --bg-elevated: var(--pure-white);
  --bg-input:  var(--pure-white);
  --bg-input-hover: var(--lt-1);
  --bg-inverse: var(--ink-black);

  /* Borders */
  --border-subtle:  var(--lt-2);
  --border-default: var(--lt-3);
  --border-strong:  var(--lt-4);
  --border-accent:  var(--signal-pink);

  /* Accent */
  --accent:        var(--signal-pink);
  --accent-hover:  var(--pink-hover);
  --accent-active: var(--pink-press);
  --accent-faint:  var(--pink-tint-10);
  --accent-tint:   var(--pink-tint-5);
  --accent-ring:   var(--pink-ring);

  /* Status */
  --status-info:    var(--signal-blue);
  --status-success: var(--signal-green);
  --status-warning: var(--signal-yellow);
  --status-error:   var(--signal-pink);

  /* ============== TYPE ============================================ */
  --font-display: 'League Spartan', 'Arial Black', system-ui, sans-serif;
  --font-body:    'Work Sans', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --w-regular:  400;
  --w-medium:   500;
  --w-semibold: 600;
  --w-bold:     700;
  --w-black:    900;

  --track-tight:  -0.03em;
  --track-normal:  0;
  --track-wide:    0.04em;

  --lh-tight:  1.0;
  --lh-snug:   1.1;
  --lh-normal: 1.5;
  --lh-loose:  1.65;

  --fs-display-xl: clamp(56px, 9vw, 144px);
  --fs-display-l:  clamp(44px, 7vw, 96px);
  --fs-display-m:  clamp(36px, 5.5vw, 72px);
  --fs-h1: clamp(32px, 4.4vw, 56px);
  --fs-h2: clamp(24px, 3.2vw, 40px);
  --fs-h3: 22px;
  --fs-h4: 18px;
  --fs-eyebrow: 12px;
  --fs-body-lg: 18px;
  --fs-body:    16px;
  --fs-body-sm: 14px;
  --fs-caption: 12px;

  /* ============== SPACING ========================================= */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* ============== RADIUS (rounded, modern) ======================== */
  --r-xs:  4px;
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-2xl: 32px;
  --r-pill: 999px;

  /* ============== SHADOWS (soft, restrained) ====================== */
  --shadow-xs: 0 1px 2px rgba(20, 20, 20, 0.04);
  --shadow-sm: 0 2px 8px rgba(20, 20, 20, 0.05);
  --shadow-md: 0 8px 24px rgba(20, 20, 20, 0.06), 0 2px 6px rgba(20, 20, 20, 0.04);
  --shadow-lg: 0 16px 40px rgba(20, 20, 20, 0.08), 0 4px 12px rgba(20, 20, 20, 0.04);
  --shadow-xl: 0 24px 64px rgba(20, 20, 20, 0.10), 0 8px 24px rgba(20, 20, 20, 0.06);
  --shadow-accent: 0 12px 32px rgba(228, 52, 111, 0.20);
  --shadow-focus: 0 0 0 4px var(--accent-ring);

  /* ============== MOTION ========================================== */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:   cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:   120ms;
  --dur-base:   200ms;
  --dur-slow:   320ms;
  --dur-slower: 480ms;

  /* ============== LAYOUT ========================================== */
  --maxw-content: 1240px;
  --maxw-narrow:  760px;
  --maxw-form:    520px;
  --gutter-mobile: 20px;
  --gutter-desktop: 56px;
}

/* =================================================================
   BASE
   ================================================================= */

html, body {
  background: var(--bg-canvas);
  color: var(--fg-1);
  font-family: var(--font-body);
  font-feature-settings: "ss01", "tnum";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

::selection {
  background: var(--accent);
  color: var(--fg-on-accent);
}

::placeholder {
  color: var(--fg-3);
}

/* =================================================================
   TYPE
   ================================================================= */

.display-xl, .display-l, .display-m, h1, .h1, h2, .h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--track-tight);
  line-height: var(--lh-snug);
  font-weight: var(--w-bold);
  color: var(--fg-1);
}

.display-xl { font-size: var(--fs-display-xl); line-height: var(--lh-tight); font-weight: var(--w-black); }
.display-l  { font-size: var(--fs-display-l);  line-height: var(--lh-tight); font-weight: var(--w-black); }
.display-m  { font-size: var(--fs-display-m);  line-height: var(--lh-tight); font-weight: var(--w-bold); }

h1, .h1 { font-size: var(--fs-h1); }
h2, .h2 { font-size: var(--fs-h2); }

h3, .h3 {
  font-family: var(--font-body);
  font-weight: var(--w-bold);
  font-size: var(--fs-h3);
  text-transform: uppercase;
  letter-spacing: var(--track-tight);
  line-height: var(--lh-snug);
}

h4, .h4 {
  font-family: var(--font-body);
  font-weight: var(--w-semibold);
  font-size: var(--fs-h4);
}

.eyebrow {
  font-family: var(--font-body);
  font-weight: var(--w-bold);
  font-size: var(--fs-eyebrow);
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  color: var(--accent);
}

.subtitle {
  font-family: var(--font-body);
  font-weight: var(--w-bold);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  color: var(--fg-2);
}

.lede {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-normal);
  color: var(--fg-2);
  max-width: 56ch;
}

.body { font-size: var(--fs-body); line-height: var(--lh-normal); }
.body-sm { font-size: var(--fs-body-sm); line-height: var(--lh-normal); color: var(--fg-2); }
.caption { font-size: var(--fs-caption); color: var(--fg-3); }

/* =================================================================
   BUTTONS - rounded, generous, soft hover
   ================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 24px;
  font-family: var(--font-body);
  font-weight: var(--w-bold);
  font-size: 15px;
  letter-spacing: var(--track-tight);
  border: 0;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-standard),
              transform var(--dur-fast) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard);
}

.btn-primary {
  background: var(--accent);
  color: var(--fg-on-accent);
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover  { background: var(--accent-hover); transform: translateY(-1px); }
.btn-primary:active { background: var(--accent-active); transform: translateY(0); }
.btn-primary:focus-visible { box-shadow: var(--shadow-accent), var(--shadow-focus); outline: 0; }
.btn-primary:disabled { background: var(--lt-3); color: var(--lt-5); box-shadow: none; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--bg-canvas);
  color: var(--fg-1);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--lt-1); border-color: var(--fg-1); }
.btn-secondary:focus-visible { box-shadow: var(--shadow-focus); outline: 0; }

.btn-ghost {
  background: transparent;
  color: var(--fg-2);
}
.btn-ghost:hover { color: var(--fg-1); background: var(--lt-1); }

.btn-large { padding: 18px 32px; font-size: 16px; }
.btn-small { padding: 10px 18px; font-size: 13px; }

/* =================================================================
   CARDS - rounded, soft shadow
   ================================================================= */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-xs);
}
.card-flat { box-shadow: none; }
.card-elevated { box-shadow: var(--shadow-md); border-color: var(--border-subtle); }
.card-accent {
  background: var(--accent-tint);
  border-color: var(--pink-tint-20);
}
.card-pad-lg { padding: var(--space-7); }
.card-pad-sm { padding: var(--space-4); }

/* =================================================================
   INPUTS - rounded, generous padding
   ================================================================= */

.field { display: flex; flex-direction: column; gap: var(--space-2); }

.label {
  font-size: 13px;
  font-weight: var(--w-semibold);
  color: var(--fg-1);
}

.label-eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: var(--w-bold);
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  color: var(--fg-2);
}

.input, .select, .textarea {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-input);
  color: var(--fg-1);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color var(--dur-base), background var(--dur-base), box-shadow var(--dur-base);
}
.input:hover, .select:hover, .textarea:hover {
  border-color: var(--border-strong);
}
.input:focus, .select:focus, .textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}
.input-lg { padding: 18px 22px; font-size: 17px; border-radius: var(--r-lg); }
.input-xl { padding: 22px 28px; font-size: 22px; border-radius: var(--r-lg); }
.textarea { min-height: 140px; resize: vertical; line-height: var(--lh-normal); }

.hint { font-size: 13px; color: var(--fg-3); }

/* =================================================================
   FILTER ROW - Include / Exclude options
   ================================================================= */

.filter-group {
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--bg-card);
  overflow: hidden;
}
.filter-group + .filter-group { margin-top: var(--space-3); }

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
}
.filter-header .name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: var(--w-semibold);
  font-size: 14px;
  color: var(--accent);
}
.filter-header .name .info {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1px solid currentColor;
  color: var(--accent);
  font-size: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.filter-header .toggle-mark {
  width: 16px; height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
}
.filter-body {
  padding: 0 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.filter-search {
  padding: 10px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--r-sm);
  font-size: 13px;
  margin-bottom: 8px;
}
.filter-search:focus { border-color: var(--accent); outline: 0; box-shadow: var(--shadow-focus); }

.filter-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px;
  font-size: 14px;
  color: var(--fg-1);
  border-bottom: 1px solid var(--border-subtle);
}
.filter-option:last-child { border-bottom: 0; }
.filter-option:hover { background: var(--lt-1); }
.filter-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--fg-3);
  font-size: 13px;
}
.filter-actions span { padding: 4px 8px; cursor: pointer; border-radius: var(--r-xs); }
.filter-actions span:hover { color: var(--fg-1); background: var(--lt-2); }
.filter-actions .divider {
  width: 1px;
  height: 14px;
  background: var(--lt-3);
  padding: 0;
}
.filter-actions .include.on { color: var(--accent); font-weight: var(--w-semibold); }
.filter-actions .exclude.on { color: var(--fg-1); font-weight: var(--w-semibold); }

/* =================================================================
   BADGES
   ================================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: var(--w-bold);
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  border-radius: var(--r-pill);
  background: var(--lt-2);
  color: var(--fg-2);
}
.badge.accent { background: var(--accent); color: var(--fg-on-accent); }
.badge.success { background: rgba(126, 217, 87, 0.15); color: #2E7D2E; }
.badge.warning { background: rgba(255, 222, 89, 0.25); color: #8A6800; }
.badge.error { background: var(--accent-faint); color: var(--accent); }
.badge.info { background: rgba(71, 132, 246, 0.12); color: #2A56C4; }
.badge.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* =================================================================
   PILLAR RULES - signature Headliner stripe
   ================================================================= */

.pillar-rules {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pillar-rules span {
  height: 4px;
  flex: 1;
  max-width: 64px;
  border-radius: var(--r-pill);
}
.pillar-rules .b { background: var(--signal-blue); }
.pillar-rules .g { background: var(--signal-green); }
.pillar-rules .y { background: var(--signal-yellow); }
.pillar-rules .p { background: var(--signal-pink); }

/* =================================================================
   LOADING SCREENS - dot pulse + pillar rules + status fade
   ================================================================= */

.loading-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-9) var(--space-5);
  min-height: 60vh;
  text-align: center;
}
.loading-tag {
  font-size: var(--fs-eyebrow);
  font-weight: var(--w-bold);
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  color: var(--accent);
  margin-bottom: var(--space-5);
}
.loading-title {
  font-family: var(--font-display);
  font-weight: var(--w-bold);
  font-size: clamp(28px, 4vw, 48px);
  text-transform: uppercase;
  letter-spacing: var(--track-tight);
  line-height: 1.1;
  margin-bottom: var(--space-4);
}
.loading-status {
  font-size: var(--fs-body-lg);
  color: var(--fg-2);
  margin-bottom: var(--space-7);
  min-height: 28px;
  transition: opacity var(--dur-slow) var(--ease-standard);
}
.loading-status.fade { opacity: 0; }

/* The map / dot pulse */
.dot-cluster {
  position: relative;
  width: 240px;
  height: 320px;
  margin: 0 auto var(--space-7);
}
.dot-cluster::before {
  /* abstract UK silhouette as soft glow */
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, var(--accent-tint) 0%, transparent 70%);
  filter: blur(8px);
}
.dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  animation: pulse 2s var(--ease-standard) infinite;
  box-shadow: 0 0 0 0 var(--accent-ring);
}
.dot.s { width: 6px; height: 6px; }
@keyframes pulse {
  0%   { transform: translate(-50%, -50%) scale(1);   opacity: 0.9; box-shadow: 0 0 0 0 var(--accent-ring); }
  70%  { transform: translate(-50%, -50%) scale(1.3); opacity: 0.0; box-shadow: 0 0 0 16px transparent; }
  100% { transform: translate(-50%, -50%) scale(1);   opacity: 0.0; }
}

/* The progress lightning bar */
.lightning {
  position: relative;
  width: min(420px, 80vw);
  height: 3px;
  background: var(--lt-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.lightning-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--pink-hover) 100%);
  border-radius: var(--r-pill);
  transition: width var(--dur-slower) var(--ease-out);
}

/* =================================================================
   STEPS INDICATOR
   ================================================================= */

.steps {
  display: flex;
  align-items: center;
  gap: 10px;
}
.steps-label {
  font-size: var(--fs-eyebrow);
  font-weight: var(--w-bold);
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  color: var(--fg-3);
  margin-right: var(--space-2);
}
.step-seg {
  flex: 1;
  height: 3px;
  max-width: 56px;
  background: var(--lt-2);
  border-radius: var(--r-pill);
  transition: background var(--dur-base) var(--ease-standard);
}
.step-seg.done    { background: var(--fg-1); }
.step-seg.current { background: var(--accent); }

/* =================================================================
   TICK VALIDATOR
   ================================================================= */

.tick-panel { display: flex; flex-direction: column; gap: 2px; }
.tick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--fg-3);
}
.tick-row.pass { color: #2E7D2E; }
.tick-row.fail { color: var(--accent); }
.tick-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  flex: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  background: var(--lt-2);
  color: var(--fg-3);
}
.tick-row.pass .tick-icon { background: rgba(126, 217, 87, 0.18); color: #2E7D2E; }
.tick-row.pass .tick-icon::before { content: '\2713'; }
.tick-row.fail .tick-icon { background: var(--accent-faint); color: var(--accent); }
.tick-row.fail .tick-icon::before { content: '\00D7'; }

/* =================================================================
   TABLES
   ================================================================= */

.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  padding: 14px 20px;
  font-size: 12px;
  font-weight: var(--w-bold);
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  color: var(--fg-3);
  background: var(--lt-1);
  border-bottom: 1px solid var(--border-subtle);
}
.table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--fg-1);
}
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--lt-1); }

/* =================================================================
   PROGRESS BARS
   ================================================================= */

.progress {
  width: 100%;
  height: 8px;
  background: var(--lt-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-pill);
  transition: width var(--dur-slow) var(--ease-out);
}

/* =================================================================
   FOCUS RING (global)
   ================================================================= */

*:focus-visible {
  outline: 0;
  box-shadow: var(--shadow-focus);
}

/* =================================================================
   RESPONSIVE
   ================================================================= */

@media (min-width: 768px) {
  :root { --gutter: var(--gutter-desktop); }
}
