/* Design tokens (docs/DESIGN.md section 1). Screens use these only, never raw colours. Light is the default; dark is
   the Night shift palette, chosen by the theme button (data-theme on <html>) or, with no choice saved, by the system. */

@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 300; font-display: swap; src: url(../fonts/poppins-latin-300-normal.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/poppins-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/poppins-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/poppins-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/poppins-latin-700-normal.woff2) format('woff2'); }

:root {
  color-scheme: light;
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;

  /* 1.1 Surfaces and text */
  --ground: #F6F6F4;
  --paper: #FFFFFF;
  --strip: #F4F5F3;
  --track: #E9ECE8;
  --line: #E3E7E3;
  --field-line: #7C8680;   /* input borders: 3:1 against --paper (WCAG 1.4.11) */
  --ink: #16201B;
  --soft: #4F5A53;
  --chip: rgba(255, 255, 255, .7);
  --bar: rgba(255, 255, 255, .84);
  --glow: rgba(31, 107, 74, .15);
  --glow-2: rgba(240, 160, 110, .12);

  /* 1.2 Brand and actions (company colours from Settings replace --g and --hero) */
  --g: #1F6B4A;
  --on-g: #FFFFFF;
  --on-hero: #FFFFFF;
  --hero: linear-gradient(150deg, #25785A, #1F6B4A 55%, #164F37);

  /* 1.3 Status */
  --ok-bg: #E3F1EA;   --ok-fg: #1F6B4A;
  --warn-bg: #FDF3D3; --warn-fg: #7A5F14;
  --due-bg: #FBEAE8;  --due-fg: #A1322A;
  --vb-bg: #ECE6F7;   --vb-fg: #4B2C9A;

  /* Attendance switch, selected segment */
  --att-p-bg: #1F6B4A; --att-p-fg: #FFFFFF;
  --att-v-bg: #F2C94C; --att-v-fg: #3D2E00;
  --att-a-bg: #5A6660; --att-a-fg: #FFFFFF;
  --att-m-bg: #A1322A; --att-m-fg: #FFFFFF;

  /* 1.4 Language colours (palette names used by languages.palette) */
  --lang-blue-bg: #DCE7FD;   --lang-blue-fg: #1D3F8F;
  --lang-amber-bg: #FCEBC7;  --lang-amber-fg: #7A4A00;
  --lang-green-bg: #D6F0E0;  --lang-green-fg: #135A33;
  --lang-violet-bg: #E6DEFA; --lang-violet-fg: #4B2C9A;

  /* 1.5 Shape, depth, motion */
  --r-pill: 99px;
  --r-strip: 14px;
  --r-tile: 22px;
  --r-card: 28px;
  --r-bar: 24px;
  --shadow: 0 1px 2px rgba(40, 34, 26, .05), 0 22px 44px -22px rgba(40, 34, 26, .26);
  --shadow-hero: 0 24px 48px -22px rgba(31, 107, 74, .6);
  --blur: blur(16px);
  --rise: rise .6s cubic-bezier(.16, .84, .24, 1) both;
}

/* Dark (Night shift). Two selectors with the same values: the saved choice, and the system setting when nothing is
   saved. Keep them identical. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0F1419; --paper: #171D24; --strip: #141A20; --track: #1C232B; --line: #26303A;
  --ink: #E6EBF0; --soft: #9AA6B2;
  --field-line: #66727F; --on-hero: #FFFFFF;
  --chip: rgba(255, 255, 255, .05); --bar: rgba(23, 29, 36, .8);
  --glow: rgba(108, 182, 255, .12); --glow-2: rgba(245, 160, 91, .08);
  --g: #6CB6FF; --on-g: #0F1419;
  --hero: linear-gradient(150deg, #2B5A88, #1E4268 55%, #16304D);
  --ok-bg: #163029; --ok-fg: #4FC3A1;
  --warn-bg: #33301A; --warn-fg: #E9C46A;
  --due-bg: #3A2717; --due-fg: #F5A05B;
  --vb-bg: #2B2445; --vb-fg: #C9B8FF;
  --att-p-bg: #4FC3A1; --att-p-fg: #0F1419;
  --att-v-bg: #E9C46A; --att-v-fg: #0F1419;
  --att-a-bg: #9AA6B2; --att-a-fg: #0F1419;
  --att-m-bg: #F5A05B; --att-m-fg: #0F1419;
  --lang-blue-bg: #1C2B45;   --lang-blue-fg: #A9CBFF;
  --lang-amber-bg: #3A2E14;  --lang-amber-fg: #F2C46B;
  --lang-green-bg: #17342A;  --lang-green-fg: #86D9AC;
  --lang-violet-bg: #2B2445; --lang-violet-fg: #C9B8FF;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 22px 44px -22px rgba(0, 0, 0, .75);
  --shadow-hero: 0 24px 48px -22px rgba(0, 0, 0, .8);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --ground: #0F1419; --paper: #171D24; --strip: #141A20; --track: #1C232B; --line: #26303A;
    --ink: #E6EBF0; --soft: #9AA6B2;
    --field-line: #66727F; --on-hero: #FFFFFF;
    --chip: rgba(255, 255, 255, .05); --bar: rgba(23, 29, 36, .8);
    --glow: rgba(108, 182, 255, .12); --glow-2: rgba(245, 160, 91, .08);
    --g: #6CB6FF; --on-g: #0F1419;
    --hero: linear-gradient(150deg, #2B5A88, #1E4268 55%, #16304D);
    --ok-bg: #163029; --ok-fg: #4FC3A1;
    --warn-bg: #33301A; --warn-fg: #E9C46A;
    --due-bg: #3A2717; --due-fg: #F5A05B;
    --vb-bg: #2B2445; --vb-fg: #C9B8FF;
    --att-p-bg: #4FC3A1; --att-p-fg: #0F1419;
    --att-v-bg: #E9C46A; --att-v-fg: #0F1419;
    --att-a-bg: #9AA6B2; --att-a-fg: #0F1419;
    --att-m-bg: #F5A05B; --att-m-fg: #0F1419;
    --lang-blue-bg: #1C2B45;   --lang-blue-fg: #A9CBFF;
    --lang-amber-bg: #3A2E14;  --lang-amber-fg: #F2C46B;
    --lang-green-bg: #17342A;  --lang-green-fg: #86D9AC;
    --lang-violet-bg: #2B2445; --lang-violet-fg: #C9B8FF;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 22px 44px -22px rgba(0, 0, 0, .75);
    --shadow-hero: 0 24px 48px -22px rgba(0, 0, 0, .8);
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  :root { --rise: none; }
}
