/* ============================================================
   FINANZPLANER — Design Tokens
   Editorial, book-like, minimal. Arial-first.
   ============================================================ */

:root {
  /* ---------- Color: Ink ---------- */
  --ink-900: #0B1220;   /* Primary text */
  --ink-700: #1F2A40;
  --ink-500: #4B5566;

  /* ---------- Color: Brand Navy ---------- */
  --navy-900: #13294B;  /* Brand primary */
  --navy-800: #1A3461;
  --navy-700: #234680;
  --navy-100: #DDE4EF;
  --navy-50:  #EEF2F8;

  /* ---------- Color: Mint (accent / growth) ---------- */
  --mint-600: #2BC183;
  --mint-500: #3DDC97;  /* Accent primary */
  --mint-300: #8DECC1;
  --mint-100: #C7F4DF;
  --mint-50:  #E8FBF2;

  /* ---------- Color: Paper (page surfaces) ---------- */
  --paper-50:  #F7F5F0; /* Page background */
  --paper-100: #EFEAE0; /* Card / accent surface */
  --paper-200: #E3DDD0; /* Divider, subtle border */
  --paper-300: #C9C2B2;

  /* ---------- Color: Neutrals ---------- */
  --gray-600: #6B6F78;
  --gray-500: #8A8F99;
  --gray-400: #B2B6BE;
  --gray-200: #E5E7EB;
  --gray-100: #F1F2F4;
  --white:    #FFFFFF;

  /* ---------- Semantic ---------- */
  --color-text:        var(--ink-900);
  --color-text-muted:  var(--ink-500);
  --color-text-subtle: var(--gray-600);
  --color-bg:          var(--paper-50);
  --color-surface:     var(--white);
  --color-surface-alt: var(--paper-100);
  --color-border:      var(--paper-200);
  --color-border-strong: var(--ink-900);
  --color-brand:       var(--navy-900);
  --color-accent:      var(--mint-500);
  --color-accent-hover:var(--mint-600);
  --color-danger:      #C8553D;
  --color-warning:     #E0A33C;
  --color-success:     var(--mint-600);

  /* ---------- Typography ---------- */
  --font-display: "Arial Black", "Arial Bold", Arial, sans-serif;
  --font-body:    Arial, "Helvetica Neue", Helvetica, sans-serif;
  --font-mono:    "Courier New", ui-monospace, monospace;

  /* Type scale (editorial — large display, comfortable body) */
  --fs-display-2xl: 128px;
  --fs-display-xl:  96px;
  --fs-display-lg:  72px;
  --fs-display-md:  56px;
  --fs-display-sm:  40px;
  --fs-h1: 32px;
  --fs-h2: 24px;
  --fs-h3: 20px;
  --fs-body-lg: 18px;
  --fs-body:    16px;
  --fs-small:   14px;
  --fs-micro:   12px;
  --fs-label:   11px;

  /* Line heights */
  --lh-tight: 0.95;
  --lh-snug:  1.1;
  --lh-base:  1.5;
  --lh-loose: 1.65;

  /* Tracking */
  --ls-tight:  -0.02em;
  --ls-normal: 0em;
  --ls-wide:   0.08em;
  --ls-label:  0.14em;

  /* ---------- Spacing (4px base) ---------- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  /* ---------- Radius (sharp by default) ---------- */
  --r-0: 0px;
  --r-1: 2px;
  --r-2: 4px;     /* maximum allowed in this system */

  /* ---------- Borders ---------- */
  --bw-1: 1px;
  --bw-2: 2px;
  --bw-3: 3px;

  /* ---------- Shadows (very subtle, editorial) ---------- */
  --shadow-1: 0 1px 0 rgba(11, 18, 32, 0.04);
  --shadow-2: 0 2px 8px rgba(11, 18, 32, 0.06), 0 1px 2px rgba(11, 18, 32, 0.04);
  --shadow-3: 0 8px 24px rgba(11, 18, 32, 0.10), 0 2px 6px rgba(11, 18, 32, 0.05);

  /* ---------- Layout ---------- */
  --container: 1200px;
  --container-narrow: 720px;
  --container-wide:   1440px;
  --nav-h: 64px;
}

/* ============================================================
   Base reset / element defaults
   ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-base);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  margin: 0;
  color: var(--color-text);
}

p { margin: 0; text-wrap: pretty; }

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img, svg { display: block; max-width: 100%; }

/* ============================================================
   Utility — Typography classes
   ============================================================ */
.t-display-2xl { font-family: var(--font-display); font-size: var(--fs-display-2xl); line-height: var(--lh-tight); letter-spacing: var(--ls-tight); font-weight: 900; }
.t-display-xl  { font-family: var(--font-display); font-size: var(--fs-display-xl);  line-height: var(--lh-tight); letter-spacing: var(--ls-tight); font-weight: 900; }
.t-display-lg  { font-family: var(--font-display); font-size: var(--fs-display-lg);  line-height: var(--lh-tight); letter-spacing: var(--ls-tight); font-weight: 900; }
.t-display-md  { font-family: var(--font-display); font-size: var(--fs-display-md);  line-height: var(--lh-snug);  letter-spacing: var(--ls-tight); font-weight: 900; }
.t-display-sm  { font-family: var(--font-display); font-size: var(--fs-display-sm);  line-height: var(--lh-snug);  letter-spacing: var(--ls-tight); font-weight: 900; }
.t-h1          { font-family: var(--font-display); font-size: var(--fs-h1); line-height: 1.15; letter-spacing: var(--ls-tight); font-weight: 900; }
.t-h2          { font-family: var(--font-display); font-size: var(--fs-h2); line-height: 1.2;  font-weight: 900; }
.t-h3          { font-family: var(--font-display); font-size: var(--fs-h3); line-height: 1.25; font-weight: 900; }
.t-body-lg     { font-size: var(--fs-body-lg); line-height: var(--lh-loose); }
.t-body        { font-size: var(--fs-body); line-height: var(--lh-base); }
.t-small       { font-size: var(--fs-small); line-height: 1.5; }
.t-micro       { font-size: var(--fs-micro); line-height: 1.5; }
.t-label       { font-family: var(--font-display); font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase; font-weight: 900; }
.t-mono        { font-family: var(--font-mono); }

.muted    { color: var(--color-text-muted); }
.subtle   { color: var(--color-text-subtle); }
.on-navy  { color: var(--paper-50); }
.on-navy .muted { color: rgba(247,245,240,0.65); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--fs-body);
  line-height: 1;
  padding: 14px 22px;
  border: 1px solid transparent;
  border-radius: var(--r-0);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease, transform 120ms ease;
  white-space: nowrap;
  letter-spacing: 0;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--navy-900);
  color: var(--paper-50);
}
.btn--primary:hover { background: var(--ink-900); }

.btn--accent {
  background: var(--mint-500);
  color: var(--ink-900);
}
.btn--accent:hover { background: var(--mint-600); color: var(--ink-900); }

.btn--secondary {
  background: transparent;
  color: var(--navy-900);
  border-color: var(--navy-900);
}
.btn--secondary:hover { background: var(--navy-900); color: var(--paper-50); }

.btn--ghost {
  background: transparent;
  color: var(--ink-900);
}
.btn--ghost:hover { background: var(--paper-100); }

.btn--sm { padding: 8px 14px; font-size: var(--fs-small); }
.btn--lg { padding: 18px 28px; font-size: var(--fs-body-lg); }
.btn--block { width: 100%; }

/* ============================================================
   Inputs
   ============================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.field__label {
  font-family: var(--font-display);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  font-weight: 900;
  color: var(--ink-900);
}
.input {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  padding: 14px 16px;
  border: 1px solid var(--ink-900);
  background: var(--white);
  color: var(--ink-900);
  border-radius: var(--r-0);
  outline: none;
  width: 100%;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input::placeholder { color: var(--gray-500); }
.input:focus {
  border-color: var(--mint-600);
  box-shadow: inset 0 -2px 0 0 var(--mint-500);
}
.input--error {
  border-color: var(--color-danger);
  box-shadow: inset 0 -2px 0 0 var(--color-danger);
}
.field__hint {
  font-size: var(--fs-micro);
  color: var(--color-text-muted);
}
.field__error {
  font-size: var(--fs-micro);
  color: var(--color-danger);
  font-weight: 700;
}

/* OTP digit input */
.otp-row { display: flex; gap: var(--s-2); }
.otp-cell {
  width: 56px;
  height: 64px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 28px;
  border: 1px solid var(--ink-900);
  background: var(--white);
  color: var(--ink-900);
  outline: none;
}
.otp-cell:focus { border-color: var(--mint-600); box-shadow: inset 0 -3px 0 0 var(--mint-500); }
.otp-cell.filled { background: var(--paper-100); }

/* ============================================================
   Cards & surfaces
   ============================================================ */
.card {
  background: var(--white);
  border: 1px solid var(--color-border);
  padding: var(--s-6);
}
.card--paper { background: var(--paper-100); border-color: var(--paper-200); }
.card--navy  { background: var(--navy-900); color: var(--paper-50); border-color: var(--navy-900); }

.rule {
  height: 1px;
  background: var(--ink-900);
  border: 0;
  margin: var(--s-6) 0;
}
.rule--thin { background: var(--color-border); }
.rule--thick { height: 3px; }

/* ============================================================
   Chips & badges
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 4px 10px;
  font-family: var(--font-display);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  font-weight: 900;
  background: var(--paper-100);
  color: var(--ink-900);
  border: 1px solid transparent;
}
.chip--mint { background: var(--mint-500); color: var(--ink-900); }
.chip--navy { background: var(--navy-900); color: var(--paper-50); }
.chip--outline { background: transparent; border-color: var(--ink-900); }

/* ============================================================
   Progress
   ============================================================ */
.progress {
  height: 4px;
  background: var(--paper-200);
  position: relative;
  overflow: hidden;
}
.progress__fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--mint-500);
  transition: width 240ms ease;
}
.progress--thick { height: 8px; }
.progress--on-navy { background: rgba(255,255,255,0.15); }

/* ============================================================
   Stat block (editorial)
   ============================================================ */
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-5) 0;
}
.stat__number {
  font-family: var(--font-display);
  font-size: var(--fs-display-lg);
  line-height: 0.9;
  letter-spacing: var(--ls-tight);
  font-weight: 900;
}
.stat__label {
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

/* ============================================================
   Layout helpers
   ============================================================ */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--s-6); }
.container--narrow { max-width: var(--container-narrow); }
.container--wide { max-width: var(--container-wide); }
.stack-1 { display: flex; flex-direction: column; gap: var(--s-1); }
.stack-2 { display: flex; flex-direction: column; gap: var(--s-2); }
.stack-3 { display: flex; flex-direction: column; gap: var(--s-3); }
.stack-4 { display: flex; flex-direction: column; gap: var(--s-4); }
.stack-5 { display: flex; flex-direction: column; gap: var(--s-5); }
.stack-6 { display: flex; flex-direction: column; gap: var(--s-6); }
.stack-8 { display: flex; flex-direction: column; gap: var(--s-8); }
.row { display: flex; align-items: center; }
.row-2 { display: flex; align-items: center; gap: var(--s-2); }
.row-3 { display: flex; align-items: center; gap: var(--s-3); }
.row-4 { display: flex; align-items: center; gap: var(--s-4); }
.row-6 { display: flex; align-items: center; gap: var(--s-6); }
.between { display: flex; align-items: center; justify-content: space-between; }
.grow { flex: 1; }

/* ============================================================
   Logo / wordmark
   ============================================================ */
.wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.04em;
  text-transform: lowercase;
  font-size: 22px;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  color: var(--ink-900);
}
.wordmark__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--mint-500);
  transform: translateY(-2px);
}
.wordmark--light { color: var(--paper-50); }

/* ============================================================
   Focus visible
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--mint-500);
  outline-offset: 2px;
}
