/*
 * Third-Party Mock Console — shared design tokens
 *
 * Brand assets preserved from the original mark: deep ink-teal ground (#12252b),
 * mint stroke (#74ddd0) and coral stroke (#ef7658).
 *
 * Everything else is rebuilt around one idea: this is an instrument panel for
 * simulating third-party authorisation, not a marketing page. So the palette is
 * structural (a dark spine, a paper work surface), the accent is rationed to the
 * single primary action per screen, and the type scale keeps only three working
 * sizes instead of the twelve hairline sizes the old CSS carried.
 */

:root {
  /* ---- Ground and surfaces ---------------------------------------------- */
  /* Vben's light frame: a grey page behind white working surfaces. The rail is
     white too, separated from the page by a border rather than by a dark
     field, which is why the whole shell reads lighter than the old ink spine. */
  --ground: #f1f3f5;
  --surface: #ffffff;
  --surface-sunken: #f4f6f8;
  --spine: #ffffff;           /* sidebar + header ground */
  --spine-raised: #f2f4f7;    /* hover step on the sidebar */
  --spine-line: #e5e7eb;

  /* ---- Ink --------------------------------------------------------------- */
  --ink: #1f2937;             /* running text, full strength */
  --ink-2: #52606d;           /* secondary labels */
  --ink-3: #8a949e;           /* tertiary captions only */
  --ink-on-spine: #1f2937;    /* text on the now-white spine */
  --ink-on-spine-2: #6b7280;

  /* ---- Structure --------------------------------------------------------- */
  --line: #e5e7eb;
  --line-strong: #d1d5db;

  /* ---- Brand ------------------------------------------------------------- */
  /* Blue is the structural colour: primary buttons, active nav, focus ring. */
  --brand: #2563eb;
  --brand-deep: #1d4ed8;
  --brand-wash: #eff6ff;

  /* One accent, reserved for the single primary action of a screen. */
  --accent: #2563eb;
  --accent-deep: #1d4ed8;
  --accent-wash: #eff6ff;

  /* ---- Semantic ---------------------------------------------------------- */
  --ok: #15803d;
  --ok-wash: #f0fdf4;
  --warn: #a16207;
  --warn-wash: #fefce8;
  --bad: #b91c1c;
  --bad-wash: #fef2f2;
  --info: #1d4ed8;
  --info-wash: #eff6ff;

  /* ---- Type -------------------------------------------------------------- */
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-code: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* Three working sizes plus one display step. Nothing below 12px. */
  --t-display: clamp(1.875rem, 3vw, 2.5rem);
  --t-title: 1.125rem;
  --t-body: 0.9375rem;
  --t-small: 0.8125rem;
  --t-micro: 0.75rem;

  --lh-tight: 1.15;
  --lh-body: 1.6;

  /* ---- Space ------------------------------------------------------------- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;

  /* One pair of tight margins, used everywhere. */
  --gutter: 24px;
  --rail: 252px;

  /* ---- Shape ------------------------------------------------------------- */
  /* Rounded, not square. The old 2/4/6px read as a spreadsheet; these are the
     radii of a modern application surface. --r-full is for pills. */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-full: 999px;

  /* ---- Depth ------------------------------------------------------------- */
  /* Three ambient levels plus a coloured lift for the primary action. Shadows
     are soft and low-opacity: a tool that is stared at for hours must not
     flicker at the edges. */
  --shadow-1: 0 1px 2px rgb(16 24 40 / 4%), 0 1px 3px rgb(16 24 40 / 6%);
  --shadow-2: 0 2px 4px rgb(16 24 40 / 4%), 0 4px 12px rgb(16 24 40 / 8%);
  --shadow-3: 0 8px 20px rgb(16 24 40 / 8%), 0 16px 40px rgb(16 24 40 / 10%);
  --shadow-4: 0 16px 40px rgb(16 24 40 / 12%), 0 32px 72px rgb(16 24 40 / 16%);
  --shadow-brand: 0 4px 14px color-mix(in srgb, var(--brand) 28%, transparent);
  --shadow-brand-hover: 0 6px 20px color-mix(in srgb, var(--brand) 36%, transparent);

  /* ---- Gradients --------------------------------------------------------- */
  /* Used for primary fills and for the page wash behind content. Two stops,
     same hue family: a light-to-dark lift, never a "trust gradient". */
  --grad-brand: linear-gradient(135deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
  --grad-brand-hover: linear-gradient(135deg, #4f8ef7 0%, #3b82f6 55%, #2563eb 100%);
  --grad-surface: linear-gradient(180deg, #ffffff 0%, #fcfdfe 100%);
  --grad-wash: radial-gradient(
      1200px 600px at 12% -10%,
      color-mix(in srgb, var(--brand) 7%, transparent) 0%,
      transparent 60%
    ),
    radial-gradient(900px 500px at 92% 4%, rgb(99 102 241 / 5%) 0%, transparent 55%);

  /* ---- Motion ------------------------------------------------------------ */
  --dur-feedback: 100ms;
  --dur-state: 180ms;
  --dur-enter: 260ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
}

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

/* ---- Dark theme ---------------------------------------------------------- */
/* Only the surfaces and ink flip. The brand, the accent and the whole spacing
   scale are identical in both themes, so every component built on the tokens
   re-themes without a single per-component override.
   Not pure black, not pure white: #0f1416 / #e9efed avoid the edge vibration
   both extremes cause. */
[data-theme="dark"] {
  --ground: #101618;
  --surface: #161e21;
  --surface-sunken: #1d272a;
  --spine: #0b1113;
  --spine-raised: #1b2629;
  --spine-line: #223035;

  --ink: #e9efed;
  --ink-2: #a7b8b4;
  --ink-3: #7b8d8a;
  --ink-on-spine: #eef5f3;
  --ink-on-spine-2: #8fa3a1;

  --line: #26343a;
  --line-strong: #35474d;

  /* Blue is the structural colour: primary buttons, active nav, focus ring.
     Lifted in value for the dark theme so it still passes contrast on a dark
     surface. */
  --brand: #3b82f6;
  --brand-deep: #60a5fa;
  --brand-wash: #17243a;

  /* Blue primary stays blue in the dark theme: the console's action colour does
     not change identity with the surface, it only lifts in value. */
  --accent: #3b82f6;
  --accent-deep: #60a5fa;
  --accent-wash: #17243a;

  --ok: #4cc38a;
  --ok-wash: #14301f;
  --warn: #dcb04a;
  --warn-wash: #2e2616;
  --bad: #ef7a6d;
  --bad-wash: #331b19;
  --info: #7ab6dc;
  --info-wash: #162732;

  /* On a dark ground a shadow cannot darken what is already dark, so depth is
     carried by a light rim plus a deeper ambient. */
  --shadow-1: 0 1px 2px rgb(0 0 0 / 30%), inset 0 1px 0 rgb(255 255 255 / 4%);
  --shadow-2: 0 2px 6px rgb(0 0 0 / 36%), inset 0 1px 0 rgb(255 255 255 / 5%);
  --shadow-3: 0 10px 26px rgb(0 0 0 / 44%), inset 0 1px 0 rgb(255 255 255 / 6%);
  --shadow-4: 0 20px 50px rgb(0 0 0 / 52%), inset 0 1px 0 rgb(255 255 255 / 7%);
  --shadow-brand: 0 4px 16px color-mix(in srgb, var(--brand) 40%, transparent);
  --shadow-brand-hover: 0 8px 26px color-mix(in srgb, var(--brand) 50%, transparent);
  --grad-surface: linear-gradient(180deg, #1a2428 0%, #161e21 100%);
  --grad-wash: radial-gradient(
      1200px 600px at 12% -10%,
      rgb(59 130 246 / 10%) 0%,
      transparent 62%
    ),
    radial-gradient(900px 500px at 92% 4%, rgb(129 140 248 / 7%) 0%, transparent 58%);
}

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}

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

body {
  margin: 0;
  min-height: 100vh;
  /* A fixed wash behind everything, so the page has depth without any element
     needing its own decorative gradient. */
  background-color: var(--ground);
  background-image: var(--grad-wash);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

code,
kbd,
pre {
  font-family: var(--font-code);
}

/* Numerals that align across rows, wherever a count is shown. */
.tabular {
  font-variant-numeric: tabular-nums;
}

/* ---- Focus: one visible ring, brand tinted, never removed ----------------- */
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---- Motion opt-out ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}