/* ==========================================================================
   tokens.css — Design tokens (OUNDA Glaspreisliste)
   Visual language derived from the MORO agency presentation:
   deep petrol-navy + warm cream + apricot accent, with a high-contrast
   serif display face and a clean sans for the UI.
   ========================================================================== */

:root {
  /* ---- Brand palette ---- */
  --navy:         #1b3a5c;
  --navy-light:   #2a5080;
  --navy-dark:    #112840;
  --petrol:       #1d4257;

  --apricot:      #f0a500;
  --apricot-soft: #ffd166;
  --apricot-bg:   #fff8ec;
  --apricot-bg-strong: #fff3d8;   /* hover on apricot surfaces (upgrade banner) */

  --coral:        #e8614a;   /* sale / discount accent (MORO red family) */

  --cream:        #f7f0ec;   /* app background */
  --cream-2:      #efe7e0;   /* muted inactive surfaces */
  --white:        #ffffff;   /* always-light: text on brand, light buttons */
  --surface:      #ffffff;   /* cards & panels (themed) */
  --ice:          #eaf2fb;   /* merkliste surface */

  --green:        #2ecc71;   /* toggle "on" */
  --toggle-off:   #cfc7bf;   /* switch track (off state) */
  --pill-muted-bg: #d4ccc4;  /* muted CTA pill on the glasart cards */

  /* ---- Text ---- */
  --text:         #1b3a5c;
  --text-body:    #3a4a5c;
  --text-muted:   #7a8899;
  --text-on-dark: #ffffff;

  /* ---- Lines & borders ---- */
  --border:       #e5ddd8;
  --border-soft:  #f0ebe6;
  --gold-border:  #f0a500;

  /* ---- Type ---- */
  --font-serif: "Playfair Display", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;

  /* ---- Radii ---- */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  /* ---- Shadows ---- */
  --shadow-sm: 0 2px 10px rgba(27, 58, 92, 0.07);
  --shadow:    0 6px 26px rgba(27, 58, 92, 0.12);
  --shadow-lg: 0 16px 50px rgba(27, 58, 92, 0.22);

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 0.15s;
  --t-base: 0.25s;

  /* ---- Layout ---- */
  --topbar-h: 64px;
  --maxw: 1180px;
  --gap: clamp(10px, 1.4vw, 18px);

  /* ---- Fluid display sizes ---- */
  --fs-display: clamp(2rem, 1.2rem + 3.4vw, 3.4rem);
  --fs-h2:      clamp(1.5rem, 1rem + 2vw, 2.4rem);

  color-scheme: light;
}

/* ==========================================================================
   DARK MODE — overrides only the themed semantic tokens.
   --navy stays the petrol brand (used as button/CTA backgrounds, which read as
   raised elements on the darker surfaces); --white stays literally white
   (text on brand, light buttons). Text that was navy now resolves via --text.
   ========================================================================== */
[data-theme="dark"] {
  --cream:        #0e1a26;   /* page background */
  --cream-2:      #1b2a38;   /* muted surfaces / inactive tabs */
  --surface:      #182733;   /* cards & panels */
  --ice:          #15273b;   /* merkliste */

  --text:         #e9eef5;
  --text-body:    #b7c4d2;
  --text-muted:   #8597a8;

  --border:       #2c3f51;
  --border-soft:  #25384a;
  --apricot-bg:   #2b2512;
  --apricot-bg-strong: rgba(240, 165, 0, 0.18);
  --toggle-off:   #3a4d60;
  --pill-muted-bg: #24384c;

  --shadow-sm: 0 2px 10px rgba(0,0,0,0.30);
  --shadow:    0 6px 26px rgba(0,0,0,0.42);
  --shadow-lg: 0 18px 50px rgba(0,0,0,0.58);

  color-scheme: dark;
}

/* A few targeted dark refinements where contrast needs a nudge. */
[data-theme="dark"] .tab.is-active { background: var(--navy-light); }
[data-theme="dark"] .class-card:hover { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .chip--photo { color: var(--apricot-soft); border-color: var(--border-soft); }
[data-theme="dark"] .line__ounda { border-color: var(--border-soft); }
[data-theme="dark"] .merk__close { background: rgba(255, 255, 255, 0.10); }
[data-theme="dark"] .merk__close:hover { background: rgba(255, 255, 255, 0.18); }
[data-theme="dark"] .upgrade__price { color: var(--apricot-soft); }
[data-theme="dark"] .upgrade { background: rgba(240,165,0,0.10); }
[data-theme="dark"] .gltable .row-line td { color: var(--apricot-soft) !important; }
[data-theme="dark"] .merk-card__tag { border-color: var(--border); }
[data-theme="dark"] .addon-sec--base { background: var(--cream-2); }
[data-theme="dark"] .confirm-box { border: 1px solid var(--border); }   /* surface ≈ cards behind */

/* Smooth the switch on the big surfaces (not everything, to avoid jank). */
body, .topbar, .glass-card, .class-card, .config, .merk, .tablesheet, .gltable td, .gltable th {
  transition: background-color var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}

/* Safe-area support for notched iPhones / iPads in standalone PWA mode */
@supports (padding: max(0px)) {
  :root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
  }
}
