/* MarkerPin design tokens. Values come from the brand guide (brand/guidelines/index.html).
   Four layers. Components use only semantic (2) and component (3) tokens, never primitives or raw values.
     1. Primitive    the brand palette and scales. Change only together with the brand guide.
     2. Semantic     what a value means (surface, text, action, status).
     3. Component    sizes of recurring parts.
     4. Subscriber   the only overrides a subscriber's own branding may set, public pages only. */

@import url("fonts/fonts.css");

/* 1. Primitive ------------------------------------------------------------ */
:root {
  /* Brand colors (guide 07) */
  --ink-950: #15171C;      /* Ink: text, the M */
  --ink-800: #2A2D35;      /* hover on ink */
  --slate-600: #5B6170;    /* Slate: secondary text, 6.2:1 on white */
  --slate-400: #9AA0AC;    /* decorative only: placeholders' icons, chart grid. Never text. */
  --mist-200: #E3E4E8;     /* Mist: dividers, borders */
  --fog-100: #F5F6F7;      /* Fog: subtle surfaces (guide 07, UI colors) */
  --paper: #FFFFFF;        /* Paper */
  --orange-500: #FF5A1F;   /* Survey orange: one highlight per view, large text only */
  --orange-600: #E84A12;   /* hover on orange */
  --orange-700: #C2410C;   /* Orange text: links and small orange text, 5.2:1 */
  --orange-50: #FFF1EB;    /* selected rows, current-plan wash */

  /* Status (guide 07, UI colors). Every status also carries an icon and text. */
  --red-700: #B42318;   --red-50: #FEF3F2;     /* 6.6:1 on white */
  --amber-700: #8A5300; --amber-50: #FFF8E6;   /* 6.3:1 on white */
  --green-700: #067647; --green-50: #ECFDF3;   /* 5.7:1 on white */

  /* Type (guide 08) */
  --font-sans: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Atkinson Hyperlegible Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --text-12: 0.75rem;  --text-13: 0.8125rem; --text-14: 0.875rem; --text-16: 1rem;
  --text-18: 1.125rem; --text-20: 1.25rem;   --text-24: 1.5rem;   --text-32: 2rem;
  --text-40: 2.5rem;   --text-48: 3rem;      --text-56: 3.5rem;
  --weight-regular: 400; --weight-medium: 500; --weight-semibold: 600; --weight-bold: 700; --weight-display: 800;
  --leading-tight: 1.1; --leading-snug: 1.3; --leading-body: 1.6;

  /* Space, 4 px base */
  --space-1: 4px;  --space-2: 8px;   --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-8: 32px;  --space-10: 40px; --space-12: 48px; --space-16: 64px;
  --space-20: 80px; --space-24: 96px;

  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px; --radius-full: 999px;
  --shadow-raised: 0 1px 2px rgba(21, 23, 28, .06), 0 4px 12px rgba(21, 23, 28, .06);
  --shadow-overlay: 0 12px 40px rgba(21, 23, 28, .18);

  --duration-fast: 120ms; --duration-base: 200ms; --ease-out: cubic-bezier(.2, .8, .2, 1);
  /* Breakpoints (media queries can't read custom properties; use these numbers):
     phone floor 320, design 360 · tablet 768 · desktop 1024 · wide 1440 */
}

/* 2. Semantic ------------------------------------------------------------- */
:root {
  --surface: var(--paper);
  --surface-subtle: var(--fog-100);
  --surface-raised: var(--paper);
  --surface-ink: var(--ink-950);         /* closing bands, footer of the website */
  --surface-selected: var(--orange-50);
  --surface-muted: var(--mist-200);       /* tracks, hover fills, empty cells */

  --text: var(--ink-950);
  --text-muted: var(--slate-600);
  --text-on-ink: #FFFFFF;
  --text-on-ink-muted: #B9BDC7;          /* 9.5:1 on ink */

  --border: var(--mist-200);
  --accent: var(--orange-500);           /* the stake: current-item bars, active tab, current plan. Never text on white, never a fill behind body text */
  --text-accent: var(--orange-700);      /* eyebrows and small orange text: 5.2:1 */
  --text-disabled: var(--slate-400);     /* decorative and disabled only, never content */
  --border-strong: var(--slate-600);     /* inputs: 3:1 against the surface (WCAG 1.4.11) */

  --action: var(--orange-500);           /* the one primary button per view */
  --action-hover: var(--orange-600);
  --text-on-action: var(--ink-950);      /* ink on orange 5.75:1; white is 3.1:1 and fails */
  --link: var(--orange-700);
  --focus-ring: var(--orange-700);       /* 2 px ring, 2 px offset */
  --focus-ring-on-ink: #FFFFFF;

  --status-danger: var(--red-700);     --status-danger-bg: var(--red-50);
  --status-warning: var(--amber-700);  --status-warning-bg: var(--amber-50);
  --status-success: var(--green-700);  --status-success-bg: var(--green-50);
  --status-info: var(--ink-950);       --status-info-bg: var(--fog-100);

  --body-size: var(--text-16);
  --body-leading: var(--leading-body);
}

/* 3. Component ------------------------------------------------------------ */
:root {
  --button-height: 44px;  --button-height-sm: 36px; --button-radius: var(--radius-md);
  --field-height: 44px;   --field-radius: var(--radius-md);
  --chip-height: 32px;
  --card-radius: var(--radius-lg);
  --meter-height: 8px;
  --ad-slot-height: 250px;
  --logo-max-height: 40px;
  --website-width: 1200px;
  --reading-width: 720px;
  --portal-sidebar-width: 248px;
  --header-height: 68px;
}

/* 4. Subscriber theming (public pages only) --------------------------------
   Public pages are neutral by default: ink actions, ink links with an underline. They never use
   MarkerPin orange, so the same template works for any subscriber.
   On plans with own branding the server sets exactly these on <body class="public">, after checking contrast:
     --action            the subscriber's accent (buttons, active chip, month-strip fill)
     --action-hover      the accent darkened ~8%
     --text-on-action    #FFFFFF or #15171C, whichever contrasts more with the accent
     --link              the accent if it reaches 4.5:1 on white, otherwise var(--text) (links stay underlined)
   plus the logo image in the top bar. Nothing else may be overridden: fonts, surfaces, status colors
   and sizes stay ours, so every subscriber's page stays accessible. */
.public {
  --action: var(--ink-950);
  --action-hover: var(--ink-800);
  --text-on-action: #FFFFFF;
  --link: var(--ink-950);
  --focus-ring: var(--ink-950);
  --body-size: var(--text-18);           /* outdoor reading */
}
