/* theme-dark.css — dark mode for the Sarevi boards and demo. Not part of the Afi design system: the live
   product ships in light only, and this sheet is the portfolio's addition. It sits outside ds/ and
   sarevi-afi.js (both generated), so a fresh export doesn't wipe it. theme.js sets data-theme="dark" on <html>.

   1. The Whitelabel design system's dark theme, verbatim (WhitelabelDesignsystem/src/styles/tokens/theme-dark.css).
      ds/afi-modern uses the same token names, so the flipped ramps and re-pointed roles apply as they are.
   2. Afi's own values where a flip reads wrong: the navy action colour, the Afi blue links, the chart series
      and the media tiles. The same values as the Visual Identity boards.
   3. The colour cross-fade while switching (theme.js).
   4. Colours sarevi-afi.js writes for itself rather than reading from a token.
*/

/* 1. Whitelabel dark theme */
:root[data-theme="dark"]{
  color-scheme:dark;

  /* neutral: 0 = canvas, 900 = text */
  --color-neutral-0:#121212;--color-neutral-25:#171717;--color-neutral-50:#1c1c1c;--color-neutral-100:#242424;--color-neutral-200:#2e2e2e;--color-neutral-300:#3d3d3d;--color-neutral-400:#575757;--color-neutral-500:#7a7a7a;--color-neutral-600:#9e9e9e;--color-neutral-700:#bdbdbd;--color-neutral-800:#d6d6d6;--color-neutral-900:#f2f2f2;--color-neutral-500-20:#d6d6d633;
  /* control fills sit a step above the surface so inputs still read as wells */
  --color-control-0:#121212;--color-control-25:#191919;--color-control-50:#1f1f1f;--color-control-100:#262626;--color-control-200:#303030;--color-control-300:#404040;--color-control-400:#5c5c5c;--color-control-500:#8c8c8c;--color-control-600:#adadad;--color-control-700:#c7c7c7;--color-control-800:#dedede;--color-control-900:#ededed;--color-control-950:#f7f7f7;
  --color-zinc-0:#121212;--color-zinc-25:#191919;--color-zinc-50:#1c1c1c;--color-zinc-100:#262626;--color-zinc-200:#303030;--color-zinc-300:#404040;--color-zinc-400:#5c5c5c;--color-zinc-500:#8c8c8c;--color-zinc-600:#adadad;--color-zinc-700:#c7c7c7;--color-zinc-800:#dedede;--color-zinc-900:#ededed;--color-zinc-700-20:#c7c7c733;
  /* action: 700 = rest (near white), 600 = hover, 800 = pressed */
  --color-primary-0:#0a0a0a;--color-primary-25:#121212;--color-primary-50:#1a1a1a;--color-primary-100:#262626;--color-primary-200:#3a3a3a;--color-primary-300:#5c5c5c;--color-primary-400:#858585;--color-primary-500:#adadad;--color-primary-600:#d4d4d4;--color-primary-700:#ededed;--color-primary-800:#ffffff;--color-primary-900:#ffffff;

  /* status: 50 = a deep tint for backgrounds, 300 = border, 500 = icon/dot, 700 = text */
  --color-info-25:#0c1526;--color-info-50:#0f1d36;--color-info-100:#14284a;--color-info-200:#1c3a6b;--color-info-300:#2b5296;--color-info-500:#4a8ff7;--color-info-700:#93b7fd;--color-info-900:#dce8fe;
  --color-success-25:#06170d;--color-success-50:#0a2214;--color-success-100:#0e301c;--color-success-200:#14472a;--color-success-300:#1d6b3f;--color-success-500:#22c55e;--color-success-700:#6cdca0;--color-success-900:#d3f8e2;
  --color-warning-25:#1a1305;--color-warning-50:#241a06;--color-warning-100:#33240a;--color-warning-200:#4d360e;--color-warning-300:#7a5512;--color-warning-500:#f59e0b;--color-warning-700:#fec84b;--color-warning-900:#fef0c7;
  --color-error-25:#1f0b0b;--color-error-50:#2a0f0f;--color-error-100:#3d1414;--color-error-200:#5c1d1d;--color-error-300:#8f2c2c;--color-error-500:#f05252;--color-error-700:#fda29b;--color-error-900:#fee4e2;

  /* data-viz: monochrome light to dark on a dark canvas */
  --color-data-viz-series-1:#ededed;--color-data-viz-series-2:#8f8f8f;--color-data-viz-series-3:#575757;--color-data-viz-series-4:#2e2e2e;--color-data-viz-series-5:#4ade80;--color-data-viz-series-6:#22c55e;--color-data-viz-series-7:#f05252;--color-data-viz-series-8:#fca5a5;
  --color-data-viz-positive-subtle:#14532d;--color-data-viz-positive-default:#4ade80;--color-data-viz-positive-strong:#86efac;--color-data-viz-negative-subtle:#7f1d1d;--color-data-viz-negative-default:#f05252;
  --color-data-viz-neutral-axis:#3d3d3d;--color-data-viz-neutral-grid:#242424;--color-data-viz-neutral-label:#bdbdbd;--color-data-viz-neutral-tooltip-background:#1c1c1c;--color-data-viz-neutral-tooltip-border:#2e2e2e;--color-data-viz-neutral-tooltip-text:#f2f2f2;
  --chart-pattern-ink:rgba(0,0,0,.7);

  /* accent highlight: deep lime / pink glows, so light text still reads on them */
  --color-accent-lime-100:#1f2606;--color-accent-lime-300:#36420c;--color-accent-lime-500:#556b12;
  --color-accent-pink-100:#2b0f1a;--color-accent-pink-300:#4a1a2e;--color-accent-pink-500:#7a2850;
  --accent-highlight-wash:rgba(255,255,255,.08);--accent-highlight-wash-soft:rgba(255,255,255,.05);

  /* brand accent: links and the chart ramp middle */
  --brand-accent:#a3a3a3;--brand-accent-strong:#ededed;--brand-accent-light:#5c5c5c;--brand-ink:#f7f7f7;

  /* surfaces: raised things get lighter in the dark */
  --background-canvas:var(--color-neutral-0);--background-surface:var(--color-neutral-25);--background-elevated:var(--color-neutral-50);
  --background-hover:var(--color-neutral-50);--background-active:var(--color-neutral-100);--background-selected:var(--color-neutral-200);
  --background-subtle:rgba(255,255,255,.08);
  /* lines are translucent white, so they read the same on every surface depth */
  --borders-default:rgba(255,255,255,.12);--borders-subtle:rgba(255,255,255,.07);--borders-hover:rgba(255,255,255,.28);
  --overlay-blanket:#000000b3;
  --card-media-gradient:linear-gradient(180deg,#262626,#1c1c1c);--card-media-gradient-hover:linear-gradient(180deg,#3a3a3a,#262626);

  /* shadows: more black, since a dark shadow barely shows on a dark page */
  --elevation-1:0 1px 2px 0 #00000080, 0 4px 8px 0 #00000040;
  /* 2 and up float over the page: a faint light edge keeps them apart from a dark page */
  --elevation-2:0 0 0 1px rgba(255,255,255,.08), 0 2px 6px 0 #0000004d, 0 8px 20px -4px #00000080;
  --elevation-3:0 0 0 1px rgba(255,255,255,.08), 0 2px 6px 0 #0000004d, 0 16px 40px -8px #00000080;
  --elevation-4:0 0 0 1px rgba(255,255,255,.10), 0 4px 10px 0 #0000004d, 0 20px 48px -8px #00000099;
  --elevation-5:0 0 0 1px rgba(255,255,255,.10), 0 4px 10px 0 #0000004d, 0 24px 56px -8px #00000099;
  --elevation-6:0 0 0 1px rgba(255,255,255,.12), 0 8px 16px 0 #00000066, 0 32px 72px -8px #000000b3;
  --elevation-sticky:0 8px 20px 0 rgba(0,0,0,.5), 0 1px 3px 0 rgba(0,0,0,.4);
  --elevation-sticky-soft:0 8px 20px 0 rgba(0,0,0,.5);
  --elevation-card:var(--elevation-1);--elevation-tooltip:var(--elevation-2);--elevation-menu:var(--elevation-3);--elevation-drawer:var(--elevation-4);--elevation-dialog:var(--elevation-5);

  /* buttons: light faces with a soft bottom edge; no white top highlight on the dark ones */
  --button-sheen:linear-gradient(180deg, #ffffff00 0%, #00000014 100%);
  --button-raised-primary:inset 0 -1px 0 0 #00000040, inset 0 0 0 1px #ffffff;
  --button-raised-neutral:inset 0 -1px 0 0 #00000066, inset 0 0 0 1px #ffffff1f, inset 0 1px 0 0 #ffffff0f;
  --button-raised-danger:inset 0 -1px 0 0 #00000040, inset 0 0 0 1px #fca5a5;
  --button-pressed-primary:inset 0 1px 6px 0 #00000059;
  --button-pressed-secondary:inset 0 1px 4px 0 #00000099;
  --button-destructive-background:#f87171;--button-destructive-background-hover:#fca5a5;--button-destructive-pressed-background:#ef4444;
  --button-ghost-hover:color-mix(in srgb,var(--color-primary-700) 8%,transparent);--button-ghost-active:color-mix(in srgb,var(--color-primary-700) 14%,transparent);
}

/* 2. Afi brand in the dark */
:root[data-theme="dark"]{
  /* action: skin-modern.css points the brand roles at --color-afi-navy-*. They take the Whitelabel's light grey,
     not a light teal: 700 = rest, 600 = hover, 800 = pressed. The button edge stays the Whitelabel's white. */
  --color-afi-navy-600:#d4d4d4;--color-afi-navy-700:#ededed;--color-afi-navy-800:#ffffff;

  /* Afi blue: links read it, so it lightens to hold on the dark surfaces. The highlight gradient keeps its light
     stops so the white figure on it still reads. */
  --brand-afi-blue:#6cbfec;--brand-afi-blue-strong:#c2e2ee;--brand-afi-ink:#f2f2f2;
  --highlight-gradient-from:color-mix(in srgb,#007cbc 78%,#062d3f);--highlight-gradient-via:#007cbc;--highlight-gradient-to:color-mix(in srgb,#007cbc 78%,#8fb0ff);

  --color-data-viz-series-1:#a3d0e1;--color-data-viz-series-2:#3aaee6;--color-data-viz-series-3:#3d5b69;--color-data-viz-series-4:#2e2e2e;--color-data-viz-series-5:#72c971;--color-data-viz-series-6:#4fa94e;--color-data-viz-series-7:#eb5656;--color-data-viz-series-8:#eb8787;

  --card-media-gradient:linear-gradient(180deg,#14425c,#0d3047);--card-media-gradient-hover:linear-gradient(180deg,#1d5a7c,#124361);
}

/* 3. The switch: colours only, the same timing as the site's --duration-theme-fade and --ease-theme */
:root[data-theme-switching],
:root[data-theme-switching] *,
:root[data-theme-switching] *::before,
:root[data-theme-switching] *::after{
  transition:background-color 500ms cubic-bezier(.22,.61,.36,1),border-color 500ms cubic-bezier(.22,.61,.36,1),color 500ms cubic-bezier(.22,.61,.36,1),fill 500ms cubic-bezier(.22,.61,.36,1),stroke 500ms cubic-bezier(.22,.61,.36,1) !important;
}

/* 4. sarevi-afi.js */
/* Brand-filled hero surfaces (the Resumen savings card, the feature and highlight metric cards) keep Afi's deep navy with
   light text rather than taking the light action fill: a large light block would glare on a dark page.
   They read the brand roles through var(), so re-pointing the roles on the card itself is enough. */
:root[data-theme="dark"] .afi-card-v2.a-save,
:root[data-theme="dark"] .afi-metric-card--feature,
:root[data-theme="dark"] .afi-metric-card--highlight{
  --brand-background-default:#062d3f;--brand-background-hover:#174557;--brand-background-pressed:#052636;--content-inverse:#f2f2f2;
}

/* sarevi-afi.js pins the stage to color-scheme: light, so the browser's own colours inside it (the drawer
   <dialog>'s text, form controls, scrollbars) stay light. */
:root[data-theme="dark"][data-brand="afi"] .stage{color-scheme:dark}
