/* Exam Codifica Hub — 12 ready palettes. Only the dark chrome changes:
   page background, header, footer, borders, accent. White panels/tables keep dark ink. */

:root {
  --header-from: #3f0d14;
  --header-to: #140508;
}

/* barmejli — هوية Codifica Hub (السماويّ على الحبر) */
html[data-palette="barmejli"] {
  --bg: #F1F6F9; --bg-elevated: #FFFFFF; --surface: #FFFFFF;
  --surface-2: #EAF7FD; --surface-3: #F1F6F9;
  --border: #D6E4EC; --border-strong: #B9CEDC;
  --text: #0A1520; --text-muted: #3D5563; --text-dim: #5A7383;
  --primary: #0A7C94; --primary-strong: #08657A;
  --primary-soft: rgba(10, 124, 148, .12);
  --on-accent: #ffffff;
  --header-from: #FFFFFF; --header-to: #F1F6F9;
}

/* blood — قرمزي دموي */
html[data-palette="blood"] {
  --bg: #140508;
  --bg-elevated: #24080c;
  --surface: #2e0a0f;
  --surface-2: #370c12;
  --surface-3: #430e15;
  --navy: #28090e;
  --border: #4f1018;
  --border-strong: #6f1621;
  --text: #fdf2f3;
  --text-muted: #f3bbc2;
  --text-dim: #ed99a3;
  --primary: #d92b3f;
  --primary-strong: #a92231;
  --primary-soft: rgba(217, 43, 63, .18);
  --on-accent: #0d0305;
  --header-from: #3f0d14;
  --header-to: #140508;
}

/* midnight — أزرق ليلي */
html[data-palette="midnight"] {
  --bg: #070f22;
  --bg-elevated: #0d1931;
  --surface: #101e3a;
  --surface-2: #142443;
  --surface-3: #182c4e;
  --navy: #0e1b34;
  --border: #1d3359;
  --border-strong: #284676;
  --text: #f4f8fd;
  --text-muted: #c7d8f3;
  --text-dim: #abc5ec;
  --primary: #4f86d8;
  --primary-strong: #3e69a8;
  --primary-soft: rgba(79, 134, 216, .18);
  --on-accent: #050a16;
  --header-from: #17294a;
  --header-to: #070f22;
}

/* ocean — أزرق محيطي */
html[data-palette="ocean"] {
  --bg: #04161f;
  --bg-elevated: #07212e;
  --surface: #092837;
  --surface-2: #0b2f40;
  --surface-3: #0d374b;
  --navy: #082431;
  --border: #103f56;
  --border-strong: #165573;
  --text: #f2f9fd;
  --text-muted: #bbe0f2;
  --text-dim: #99d1eb;
  --primary: #2b9fd6;
  --primary-strong: #227ca7;
  --primary-soft: rgba(43, 159, 214, .18);
  --on-accent: #030e14;
  --header-from: #0d3447;
  --header-to: #04161f;
}

/* teal — أزرق مخضر */
html[data-palette="teal"] {
  --bg: #04191b;
  --bg-elevated: #062527;
  --surface: #062d2f;
  --surface-2: #073536;
  --surface-3: #093e3f;
  --navy: #06282a;
  --border: #0a4749;
  --border-strong: #0d6061;
  --text: #f1fafa;
  --text-muted: #b5e7e7;
  --text-dim: #90dbdb;
  --primary: #17b3b3;
  --primary-strong: #128c8c;
  --primary-soft: rgba(23, 179, 179, .18);
  --on-accent: #031012;
  --header-from: #083b3c;
  --header-to: #04191b;
}

/* emerald — أخضر زمردي */
html[data-palette="emerald"] {
  --bg: #051810;
  --bg-elevated: #072418;
  --surface: #092c1e;
  --surface-2: #0a3423;
  --surface-3: #0c3d29;
  --navy: #08281a;
  --border: #0e462f;
  --border-strong: #125f40;
  --text: #f2faf7;
  --text-muted: #b8e7d4;
  --text-dim: #95dbbe;
  --primary: #22b378;
  --primary-strong: #1b8c5e;
  --primary-soft: rgba(34, 179, 120, .18);
  --on-accent: #03100a;
  --header-from: #0b3a27;
  --header-to: #051810;
}

/* forest — أخضر غابات */
html[data-palette="forest"] {
  --bg: #0c1807;
  --bg-elevated: #14240c;
  --surface: #182c0f;
  --surface-2: #1d3312;
  --surface-3: #233c15;
  --navy: #16270d;
  --border: #294519;
  --border-strong: #385d22;
  --text: #f6faf4;
  --text-muted: #d0e5c3;
  --text-dim: #b8d8a4;
  --primary: #6cae42;
  --primary-strong: #548833;
  --primary-soft: rgba(108, 174, 66, .18);
  --on-accent: #081005;
  --header-from: #213914;
  --header-to: #0c1807;
}

/* amber — عنبري ذهبي */
html[data-palette="amber"] {
  --bg: #1d1505;
  --bg-elevated: #2d2008;
  --surface: #36270a;
  --surface-2: #402e0c;
  --surface-3: #4c360f;
  --navy: #302309;
  --border: #583f11;
  --border-strong: #775518;
  --text: #fdf9f2;
  --text-muted: #f5e1bc;
  --text-dim: #f0d19b;
  --primary: #e0a02e;
  --primary-strong: #af7d24;
  --primary-soft: rgba(224, 160, 46, .18);
  --on-accent: #130e03;
  --header-from: #48340e;
  --header-to: #1d1505;
}

/* copper — نحاسي */
html[data-palette="copper"] {
  --bg: #1d1007;
  --bg-elevated: #2b180b;
  --surface: #341c0d;
  --surface-2: #3c2110;
  --surface-3: #472713;
  --navy: #2e1a0c;
  --border: #522d16;
  --border-strong: #6e3c1e;
  --text: #fcf6f3;
  --text-muted: #efd1bf;
  --text-dim: #e7ba9f;
  --primary: #cc7038;
  --primary-strong: #9f572c;
  --primary-soft: rgba(204, 112, 56, .18);
  --on-accent: #130a05;
  --header-from: #442512;
  --header-to: #1d1007;
}

/* rose — وردي عميق */
html[data-palette="rose"] {
  --bg: #1d0913;
  --bg-elevated: #2d0f1c;
  --surface: #361321;
  --surface-2: #401626;
  --surface-3: #4c1b2d;
  --navy: #30101e;
  --border: #581f33;
  --border-strong: #772b45;
  --text: #fdf5f7;
  --text-muted: #f5c8d6;
  --text-dim: #f0acc2;
  --primary: #e0537f;
  --primary-strong: #af4163;
  --primary-soft: rgba(224, 83, 127, .18);
  --on-accent: #13060c;
  --header-from: #48192b;
  --header-to: #1d0913;
}

/* plum — عنابي */
html[data-palette="plum"] {
  --bg: #180919;
  --bg-elevated: #240c1f;
  --surface: #2c0e24;
  --surface-2: #341028;
  --surface-3: #3d122c;
  --navy: #280d21;
  --border: #461431;
  --border-strong: #5f1a3e;
  --text: #faf2f6;
  --text-muted: #e7bccf;
  --text-dim: #db9bb7;
  --primary: #b32e6a;
  --primary-strong: #8c2453;
  --primary-soft: rgba(179, 46, 106, .18);
  --on-accent: #100610;
  --header-from: #3a112b;
  --header-to: #180919;
}

/* royal — بنفسجي ملكي */
html[data-palette="royal"] {
  --bg: #100a25;
  --bg-elevated: #1b1236;
  --surface: #221740;
  --surface-2: #281c4b;
  --surface-3: #302258;
  --navy: #1e143a;
  --border: #382964;
  --border-strong: #4e3986;
  --text: #f9f6ff;
  --text-muted: #ded1fd;
  --text-dim: #cdbafc;
  --primary: #9770f8;
  --primary-strong: #7657c1;
  --primary-soft: rgba(151, 112, 248, .18);
  --on-accent: #0a0618;
  --header-from: #2e2053;
  --header-to: #100a25;
}

/* graphite — جرافيت فحمي */
html[data-palette="graphite"] {
  --bg: #131518;
  --bg-elevated: #1d2024;
  --surface: #23262b;
  --surface-2: #292d32;
  --surface-3: #30353b;
  --navy: #1f2226;
  --border: #373d43;
  --border-strong: #4a525a;
  --text: #f8f9fa;
  --text-muted: #dadfe3;
  --text-dim: #c7cfd5;
  --primary: #8b9aa8;
  --primary-strong: #6c7883;
  --primary-soft: rgba(139, 154, 168, .18);
  --on-accent: #0c0e10;
  --header-from: #2d3238;
  --header-to: #131518;
}

/* palette picker swatches */
.palette-picker { display:flex; flex-wrap:wrap; gap:.5rem; margin-top:.75rem; }
.palette-chip { width:46px; height:46px; border-radius:12px; cursor:pointer; border:2px solid #e6d9d9; display:grid; place-items:center; transition: transform .12s ease, box-shadow .12s ease; }
.palette-chip:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.18); }
.palette-chip[aria-pressed="true"] { border-color:#1a0c0f; box-shadow: 0 0 0 3px rgba(0,0,0,.12); }
