/* =========================================================
   WAHAJ prototype — design tokens.
   Premium and quiet, in the spirit of apple.com: a black canvas (white in the light theme), neutral greys
   with no tint, the WAHAJ green (#00FF6F) for action, progress and "you are here", and purple as the one
   secondary colour (XP, AI, things under way). No gradients, no shadows: depth comes from surface steps.
   ========================================================= */
:root {
  color-scheme: dark;
  /* the education sponsor's logo: white here, black in the light theme */
  --qf-ink: #ffffff;
  /* surfaces: one neutral ladder */
  --void: #000000;
  --bg: #000000;
  --bg-deep: #000000;
  --side: #000000;
  --panel: #111112;
  --panel-2: #161617;
  --tile: #1d1d1f;
  --tile-hi: #232325;
  --line: #232325;
  --line-2: #2c2c2e;
  --line-3: #3a3a3c;
  /* text */
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --muted: #86868b;
  --faint: #545458;
  /* brand · WAHAJ green, the same in both themes for every fill */
  --accent: #00FF6F;
  --accent-fill: #00FF6F;
  --accent-hi: #00FF6F;
  --accent-deep: #00FF6F;
  --accent-ink: #000000;
  --accent-soft: rgba(0, 255, 111, .10);
  --accent-soft-2: rgba(0, 255, 111, .16);
  --accent-line: rgba(0, 255, 111, .45);
  --glow: none;
  /* secondary · purple */
  --accent-2: #8B5CF6;
  --accent-2-text: #A78BFA;
  --accent-2-soft: rgba(139, 92, 246, .14);
  --accent-2-line: rgba(139, 92, 246, .45);
  --green-100: #C9F8DD; --green-200: #00FF6F; --green-300: #00FF6F; --green-400: #00FF6F; --green-500: #00FF6F;
  --green-600: #00FF6F; --green-700: #10894A; --green-800: #0C6238; --green-900: #232325;
  /* accent family (fill / text): purple carries XP, AI and rewards; blue stays for water and data */
  --nebula-500: #8B5CF6; --nebula-400: #A78BFA;
  --orbit-500: #3B82F6; --orbit-400: #60A5FA;
  --solar-500: #8B5CF6;
  --ember-500: #8B5CF6; --ember-400: #A78BFA;
  --tide-400: #22D3EE; --pulse-400: #F472B6;
  --flare-500: #FF4FA3; --flare-400: #FF5CAE;
  --xp-bar: #8B5CF6;
  /* status: orange only for warnings, red only for errors */
  --warn: #FF9F0A;
  --orange: #FF9F0A;
  --red: #FF4FA3;
  --blue: #A78BFA;
  --sky: #A78BFA;
  /* shape, space, motion */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 980px;
  --shadow-float: none;
  --shadow-modal: none;
  --motion-fast: 120ms cubic-bezier(.2, 0, 0, 1);
  --motion-base: 200ms cubic-bezier(.2, 0, 0, 1);
  --motion-slow: 320ms cubic-bezier(.16, 1, .3, 1);
  --ease-reward: cubic-bezier(.34, 1.56, .64, 1);
  /* type: Inter for Latin (the closest open face to Apple's SF), Readex Pro for Arabic, JetBrains Mono for data */
  --font-display: "Inter", "Readex Pro", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font: "Inter", "Readex Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --hand: "Caveat", "Segoe Script", "Bradley Hand", cursive}

*, *::before, *::after { box-sizing: border-box}
html, body { height: 100%}
body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer}
input, select, textarea { font: inherit; color: inherit}
img { display: block; max-width: 100%}
[hidden] { display: none !important}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px}
.tnum { font-variant-numeric: tabular-nums}

/* ---------- stage: fixed design canvas, scaled to fit ---------- */
#viewport {
  position: fixed; inset: 0;
  background: #111112;
  overflow: hidden}
#stage {
  position: absolute; left: 50%; top: 50%;
  width: 1448px; height: 1086px;
  transform-origin: 50% 50%;
  background: var(--bg);
  overflow: hidden;
  box-shadow: none}
#stage.part1 { width: 1448px; height: 1086px; background: #000000}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important}
}

/* screen enter */
.screen { position: absolute; inset: 0}
.fade-in { animation: fadeIn .35s ease both}
.rise-in { animation: riseIn .45s cubic-bezier(.2,.7,.2,1) both}
@keyframes fadeIn { from { opacity: 0} to { opacity: 1} }
@keyframes riseIn { from { opacity: 0; transform: translateY(10px)} to { opacity: 1; transform: none} }
@keyframes pulseRing { 0% { box-shadow: none} 100% { outline: 12px solid rgba(0,255,111,0); outline-offset: 0; box-shadow: none} }
@keyframes spin { to { transform: rotate(360deg)} }
@keyframes blink { 50% { opacity: .35} }

/* ---------- prototype navigator (outside the stage) ---------- */
#proto-nav-btn {
  position: fixed; inset-inline-start: 10px; bottom: 10px; z-index: 50;
  display: inline-flex; align-items: center; gap: 8px; height: 36px;
  padding: 0 9px; border-radius: 999px;
  background: rgba(15, 15, 15, 0.85); border: 1px solid var(--line-2); color: var(--text-2);
  font-size: 13px; backdrop-filter: blur(8px);
  opacity: .5; transition: opacity .2s, border-color .2s, padding .2s}
#proto-nav-btn span { display: none}
#proto-nav-btn:hover, #proto-nav-btn:focus-visible, #proto-nav-btn[aria-expanded="true"] { opacity: 1; border-color: var(--accent-line); color: var(--text); padding-block: 0 0; padding-inline: 9px 12px}
#proto-nav-btn:hover span, #proto-nav-btn:focus-visible span, #proto-nav-btn[aria-expanded="true"] span { display: inline}
#proto-nav {
  position: fixed; inset-inline-start: 14px; bottom: 58px; z-index: 51;
  width: 300px; max-height: calc(100% - 80px); overflow: auto;
  background: rgba(13, 13, 13, 0.97); border: 1px solid var(--line-2); border-radius: 14px;
  padding: 10px; box-shadow: none;
  font-size: 13px}
#proto-nav h4 { margin: 10px 8px 6px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500}
#proto-nav button.nav-item { display: flex; width: 100%; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--text-2); text-align: start}
#proto-nav button.nav-item:hover { background: var(--tile); color: var(--text)}
#proto-nav button.nav-item.on { color: var(--accent); background: rgba(135, 135, 135, 0.1)}
#proto-nav .num { width: 22px; color: var(--faint); font-variant-numeric: tabular-nums}
#proto-nav .reset { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px}
#proto-nav .hint { color: var(--faint); font-size: 12px; padding: 6px 8px 2px; line-height: 1.45}

/* =========================================================
   Shared components
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 44px; padding: 0 20px; border-radius: 10px;
  font-weight: 500; font-size: 16px; white-space: nowrap;
  transition: transform .12s ease, background .2s, border-color .2s, box-shadow .2s, color .2s, opacity .2s;
  user-select: none}
.btn:active { transform: translateY(1px) scale(.99)}
.btn-primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: none}
.btn-primary:hover { background: var(--accent-hi); box-shadow: none}
.btn-primary[disabled], .btn-primary.is-disabled { background: #2c2c2e; color: #5f8a7e; box-shadow: none; cursor: not-allowed}
.btn-ghost { background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text)}
.btn-ghost:hover { border-color: var(--line-3); background: var(--tile)}
.btn-outline { border: 1px solid var(--accent-line); color: var(--accent); background: transparent}
.btn-outline:hover { background: rgba(135, 135, 135, 0.1)}
.btn .ico { flex: none}
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--text-2); transition: background .2s, color .2s}
.icon-btn:hover { background: var(--tile); color: var(--text)}
.link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer}
.link:hover { color: var(--accent-hi)}
.muted { color: var(--muted)}
.accent { color: var(--accent)}
.ico { display: inline-block; vertical-align: middle; flex: none}

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r)}
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r)}
.clickable { cursor: pointer; transition: border-color .2s, background .2s, transform .15s, box-shadow .2s}
.clickable:hover { border-color: var(--line-3)}

.eyebrow { font-size: 13px; letter-spacing: .28em; text-transform: uppercase; font-weight: 500}
.sec-title { font-size: 16px; letter-spacing: .02em; font-weight: 500; text-transform: uppercase; margin: 0}

.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px;
  border-radius: 999px; background: #161617; border: 1px solid var(--line-2);
  font-size: 13px; color: var(--text-2); white-space: nowrap}
.pill-tab {
  height: 38px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-2);
  background: #111112; color: var(--text-2); font-size: 14px; white-space: nowrap;
  transition: all .18s}
.pill-tab:hover { color: var(--text); border-color: var(--line-3)}
.pill-tab.on { border-color: var(--accent); color: var(--accent); background: rgba(124, 124, 124, 0.06); outline: 1px solid rgba(0,255,111,0.35); outline-offset: -1px; box-shadow: none}

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap;
  background: rgba(10, 10, 10, 0.82); border: 1.5px solid var(--accent); color: var(--accent);
  backdrop-filter: blur(4px)}
.badge.blue { border-color: #8b5cf6; color: #C2D8FC}
.badge.gray { border-color: #98989d; color: #e5e5ea}
.badge.warn { border-color: var(--warn); color: var(--warn)}
.badge.solid { background: var(--accent); color: var(--accent-ink); border-color: var(--accent)}

.status-tag { display: inline-flex; align-items: center; justify-content: center; height: 24px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; border: 1px solid}
.status-tag.good { color: var(--accent); border-color: rgba(0,255,111,0.35); background: rgba(124, 124, 124, 0.07)}
.status-tag.warn { color: var(--warn); border-color: rgba(255, 159, 10, 0.5); background: rgba(255, 159, 10, 0.08)}

.progress { position: relative; height: 6px; border-radius: 99px; background: #232325; overflow: hidden}
.progress > i { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; border-radius: inherit; background: var(--accent); transition: width .6s cubic-bezier(.2,.7,.2,1)}
.progress.orange > i { background: var(--orange)}
.progress.warn > i { background: var(--warn)}
.progress.red > i { background: var(--red)}
.progress.blue > i { background: var(--blue)}

.dots { display: inline-flex; gap: 5px}
.dots i { width: 7px; height: 7px; border-radius: 50%; background: #424245}
.dots i.on { background: var(--accent)}

.check {
  width: 22px; height: 22px; border-radius: 5px; border: 1.5px solid #6e6e73; display: inline-grid; place-items: center; flex: none;
  transition: background .15s, border-color .15s; color: var(--accent-ink)}
.check.on { background: var(--accent); border-color: var(--accent)}
.check.current { border-radius: 50%; border-color: var(--accent); background: transparent; position: relative}
.check.current::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent)}

.radio {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.88);
  display: grid; place-items: center; flex: none; transition: all .2s; color: var(--accent-ink)}
.radio.on { background: var(--accent); border-color: var(--accent); box-shadow: none}
.radio.dot.on { background: transparent; border-color: var(--accent)}
.radio.dot.on::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: none}

/* input */
.field { display: flex; align-items: center; gap: 14px; height: 60px; padding-block: 0 0; padding-inline: 22px 18px; border-radius: 10px; background: #0a0a0b; border: 1px solid #232325; transition: border-color .2s, box-shadow .2s}
.field:focus-within { border-color: var(--accent-line); outline: 3px solid rgba(0,255,111,0.08); outline-offset: 0; box-shadow: none}
.field.error { border-color: rgba(255,92,174,0.7)}
.field input { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: 0; font-size: 18px; color: var(--text)}
.field input::placeholder { color: #86868b}
.field .ico { color: #d2d2d7}
.field-error { color: #F792C4; font-size: 14px; margin-top: 6px}

/* dropdown menu */
.dd-menu {
  position: absolute; z-index: 60; min-width: 160px; max-height: 320px; overflow: auto;
  background: #111112; border: 1px solid var(--line-3); border-radius: 12px; padding: 6px;
  box-shadow: none; animation: riseIn .18s ease both}
.dd-menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 15px; color: var(--text-2); text-align: start}
.dd-menu button:hover { background: var(--tile-hi); color: var(--text)}
.dd-menu button.on { color: var(--accent)}
.dd-menu .dd-sep { height: 1px; background: var(--line); margin: 6px 4px}
.dd-menu .dd-head { padding: 8px 12px 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted)}

/* toast */
#toasts { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; display: grid; gap: 10px; justify-items: center; pointer-events: none}
.toast {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding-block: 10px 10px; padding-inline: 14px 18px; border-radius: 12px;
  background: rgba(18, 18, 18, 0.96); border: 1px solid var(--line-3); box-shadow: none;
  font-size: 15px; color: var(--text); animation: riseIn .25s ease both; pointer-events: auto; max-width: 620px}
.toast .t-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(135, 135, 135, 0.16); color: var(--accent); flex: none}
.toast.warn .t-ico { background: rgba(255, 159, 10, 0.14); color: var(--warn)}
.toast.out { animation: fadeOut .3s ease forwards}
@keyframes fadeOut { to { opacity: 0; transform: translateY(6px)} }

/* modal */
.modal-wrap { position: absolute; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(4, 4, 4, 0.62); backdrop-filter: blur(6px); animation: fadeIn .2s ease both}
.modal {
  width: 620px; max-width: calc(100% - 80px); max-height: calc(100% - 80px); display: flex; flex-direction: column;
  background: #111112; border: 1px solid var(--line-3); border-radius: 18px; box-shadow: none;
  animation: riseIn .28s cubic-bezier(.2,.7,.2,1) both; overflow: hidden}
.modal.wide { width: 880px}
.modal.xl { width: 1080px}
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 14px}
.modal-head h3 { margin: 0; font-size: 24px; font-weight: 600; line-height: 1.2}
.modal-head p { margin: 6px 0 0; color: var(--muted); font-size: 15px; line-height: 1.45}
.modal-head .icon-btn { margin-inline-start: auto; margin-top: -6px; margin-inline-end: -8px}
.modal-body { padding: 4px 24px 20px; overflow: auto; font-size: 15.5px; line-height: 1.55; color: var(--text-2)}
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px 22px; border-top: 1px solid var(--line)}
.modal-body h5 { color: var(--text); font-size: 16px; margin: 16px 0 4px; font-weight: 600}
.modal-body p { margin: 0 0 10px}
.modal-body ul { margin: 0 0 10px; padding-inline-start: 20px}
.modal-body textarea { width: 100%; min-height: 150px; resize: vertical; padding: 14px 16px; border-radius: 12px; background: #0a0a0b; border: 1px solid var(--line-2); color: var(--text); font-size: 16px; line-height: 1.5; outline: none}
.modal-body textarea:focus { border-color: var(--accent-line)}
.modal-body .row-input { display: grid; gap: 6px; margin-bottom: 14px}
.modal-body label.lbl { font-size: 14px; color: var(--text); font-weight: 500}
.modal-body .txt { height: 48px; padding: 0 14px; border-radius: 10px; background: #0a0a0b; border: 1px solid var(--line-2); color: var(--text); font-size: 16px; outline: none}
.modal-body .txt:focus { border-color: var(--accent-line)}

/* popover (hotspots on scenes) */
.pop {
  position: absolute; z-index: 40; width: 260px; padding: 14px 16px; border-radius: 12px;
  background: rgba(12, 12, 12, 0.96); border: 1px solid var(--accent-line); box-shadow: none;
  font-size: 14px; line-height: 1.45; color: var(--text-2); animation: riseIn .2s ease both}
.pop b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; font-weight: 600}
.pop .pop-meta { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap}
.hotspot { position: absolute; z-index: 5; border-radius: 8px; cursor: pointer; transition: box-shadow .2s, background .2s}
.hotspot:hover, .hotspot.on { outline: 2px solid var(--accent); outline-offset: 0; box-shadow: none; background: rgba(124, 124, 124, 0.06)}
.show-hotspots .hotspot { outline: 2px solid rgba(0,255,111,0.7); outline-offset: 0; box-shadow: none}

/* scrollbars */
.scroll { overflow: auto; scrollbar-width: thin; scrollbar-color: #333336 transparent}
.scroll::-webkit-scrollbar { width: 6px; height: 6px}
.scroll::-webkit-scrollbar-thumb { background: #333336; border-radius: 6px}

/* brand mark */
.logo-mark { display: block}
.wordmark { display: block}
.hand { font-family: var(--hand)}

.dd-menu.tall { max-height: 480px}

/* controls behave like an app: a double-click never highlights their text (fields stay selectable) */
[data-act], [data-nav], button { -webkit-user-select: none; user-select: none}
input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text}
