/* ================================================================
   KYC — Cyber Brutalism · Dual-Mode Interface
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,700;1,400&display=swap');

/* ── Force hidden ──────────────────────────────────────────────── */
[hidden] { display: none !important; }

/* ================================================================
   DARK MODE (default)
   ================================================================ */
:root {
  /* Backgrounds — moderate dark slate, neither black nor gray */
  --bg:        #1A1A22;
  --panel:     #222230;
  --card:      #1E1E28;
  --card-2:    #191920;
  --border:    #2E2E34;
  --border-2:  #424249;

  /* Neon accent */
  --neon:      #D7FF2F;
  --neon-alt:  #C7FF00;
  --neon-dim:  rgba(215,255,47,.18);
  --neon-glow: rgba(215,255,47,.65);
  --neon-text: #D7FF2F;   /* neon used AS text — full brightness in dark */

  /* Semantic colors */
  --red:       #FF4545;
  --red-dim:   rgba(255,69,69,.08);
  --amber:     #FFC040;
  --amber-dim: rgba(255,192,64,.08);

  /* Text hierarchy */
  --text:      #F2F2F5;
  --text-sub:  #B0B0C2;
  --text-dim:  #72727F;
  --text-dead: #36363E;

  /* Decorative */
  --grid-color: rgba(50,50,58,.55);
  --scan-color: rgba(0,0,0,.06);

  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --ease: .16s cubic-bezier(.4,0,.2,1);
}

/* ================================================================
   LIGHT MODE
   ================================================================ */
html[data-theme="light"] {
  /* Backgrounds — cool blue-slate, professional fintech atmosphere */
  --bg:        #DDE3EF;
  --panel:     #D0D8E8;
  --card:      #EBF0F9;
  --card-2:    #E1E8F4;
  --border:    #B0BDD4;
  --border-2:  #8094B2;

  /* Soft azure accent — calm blue that breathes on light backgrounds */
  --neon:      #4D8FDE;
  --neon-alt:  #6AA3E8;
  --neon-dim:  rgba(77,143,222,.14);
  --neon-glow: rgba(77,143,222,.38);
  --neon-text: #1C54A8;   /* deep calm blue — readable on light bg */

  /* Semantic colors */
  --red:       #C01818;
  --red-dim:   rgba(192,24,24,.09);
  --amber:     #8C5400;
  --amber-dim: rgba(140,84,0,.09);

  /* Text hierarchy — deep blue-black for high contrast */
  --text:      #060A18;
  --text-sub:  #28344E;
  --text-dim:  #556080;
  --text-dead: #9AAABF;

  /* Decorative */
  --grid-color: rgba(0,20,80,.06);
  --scan-color: rgba(0,20,80,.03);
}

/* ── Theme transition ──────────────────────────────────────────── */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition:
    background-color .32s ease,
    border-color .32s ease,
    color .26s ease,
    box-shadow .32s ease,
    opacity .26s ease !important;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html   { scroll-behavior: smooth; font-size: 17.5px; }
body   {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 1rem;
}
img    { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; border: none; background: none; }
ul     { list-style: none; }

/* ── Background canvas (replaces static grid) ──────────────────── */
#bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── Scanlines ─────────────────────────────────────────────────── */
body::after {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    var(--scan-color) 3px,
    var(--scan-color) 4px
  );
  pointer-events: none;
  z-index: 9998;
}

/* ── Layout ────────────────────────────────────────────────────── */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* ── Header ────────────────────────────────────────────────────── */
.header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--neon) 30%, var(--neon) 70%, transparent 100%);
  opacity: .28;
  pointer-events: none;
}
.header-inner {
  max-width: 960px;
  margin: auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 13px;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 0 16px var(--neon-glow);
  flex-shrink: 0;
}
.logo-icon {
  width: 34px; height: 34px;
  border: 2px solid var(--neon);
  box-shadow: 0 0 10px var(--neon-dim), inset 0 0 6px var(--neon-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.logo-icon::before,
.logo-icon::after {
  content: '';
  position: absolute;
  height: 1.5px; width: 8px;
  background: var(--neon);
  top: 50%;
}
.logo-icon::before { left:  -9px; }
.logo-icon::after  { right: -9px; }
.logo-dot {
  width: 10px; height: 10px;
  background: var(--neon);
  box-shadow: 0 0 7px var(--neon);
  display: block;
  animation: blink 2.8s ease-in-out infinite;
}
@keyframes blink {
  0%, 75%, 100% { opacity: 1; }
  85%           { opacity: 0; }
}

/* ── Theme toggle button ───────────────────────────────────────── */
.theme-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border-2);
  background: var(--panel);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: border-color var(--ease), color var(--ease);
}
.theme-btn:hover {
  border-color: var(--neon);
  color: var(--neon-text);
}
.theme-icon {
  position: absolute;
  width: 16px; height: 16px;
  transition: transform .32s cubic-bezier(.4,0,.2,1), opacity .28s ease;
}
/* Dark mode: show moon, hide sun */
.icon-moon { transform: rotate(0deg);   opacity: 1; }
.icon-sun  { transform: rotate(-90deg); opacity: 0; }
/* Light mode: show sun, hide moon */
html[data-theme="light"] .icon-moon { transform: rotate(90deg);  opacity: 0; }
html[data-theme="light"] .icon-sun  { transform: rotate(0deg);   opacity: 1; }

/* HUD coordinates */
.hud-coords {
  display: flex;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: .08em;
  color: var(--text-dead);
}
.hud-coords span::before { content: '// '; color: var(--neon); opacity: .4; }

/* Header tagline */
.header-tagline {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 0 22px var(--neon-glow);
}

/* ── Language switcher ─────────────────────────────────────────── */
.lang-switch {
  display: flex;
  align-items: center;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border-2);
  padding: 3px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  outline: none;
  direction: ltr;
  transition: border-color var(--ease);
}
.lang-switch:hover { border-color: var(--neon); }
.lang-switch:focus-visible {
  border-color: var(--neon);
  box-shadow: 0 0 0 2px var(--neon-dim);
}
.lang-switch-pill {
  position: absolute;
  top: 3px; left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: var(--neon);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
  will-change: transform;
}
.lang-switch[data-lang="ar"] .lang-switch-pill { transform: translateX(100%); }
.lang-opt {
  position: relative;
  z-index: 1;
  padding: 4px 13px;
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--text-dim);
  transition: color .2s;
  min-width: 36px;
  text-align: center;
  line-height: 1;
}
.lang-switch[data-lang="en"] .lang-opt-en { color: #000; }
.lang-switch[data-lang="ar"] .lang-opt-ar { color: #000; }

/* ── Main ──────────────────────────────────────────────────────── */
.main {
  flex: 1;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* ── Stepper ───────────────────────────────────────────────────── */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 36px;
}
.stepper-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 7px;
}
.stepper-item span {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color var(--ease);
}
.step-badge {
  width: 42px; height: 42px;
  border: 1.5px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: .78rem; font-weight: 700;
  color: var(--text-dim);
  background: var(--panel);
  transition: all var(--ease);
  position: relative;
}
.stepper-item.active .step-badge {
  border-color: var(--neon);
  color: var(--neon-text);
  background: var(--neon-dim);
  box-shadow: 0 0 18px var(--neon-glow), inset 0 0 8px var(--neon-dim);
}
.stepper-item.active .step-badge::before {
  content: '';
  position: absolute; inset: -4px;
  border: 1px solid var(--neon);
  opacity: .18;
}
.stepper-item.done .step-badge {
  border-color: var(--neon);
  color: #000;
  background: var(--neon);
}
.stepper-item.active span { color: var(--neon-text); }
.stepper-item.done span   { color: var(--text-sub); }

.stepper-line {
  flex: 1;
  height: 1px;
  background: var(--border-2);
  min-width: 44px; max-width: 90px;
  margin: 0 4px; margin-bottom: 20px;
  position: relative; overflow: hidden;
}
.stepper-item.done + .stepper-line::after {
  content: '';
  position: absolute; inset: 0;
  background: var(--neon); opacity: .5;
}

/* ── Panel ─────────────────────────────────────────────────────── */
.panel { animation: fadeIn .22s ease; }
.panel.hidden { display: none; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ── Card ──────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  position: relative;
}
html[data-theme="dark"] .card {
  box-shadow: 0 4px 32px rgba(0,0,0,.55), 0 0 0 1px rgba(215,255,47,.05);
}
html[data-theme="light"] .card {
  box-shadow: 0 6px 36px rgba(0,20,80,.18), 0 1px 6px rgba(0,20,80,.10), 0 0 0 1px rgba(100,140,220,.10);
}

/* Top-two corner brackets */
.card::before,
.card::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border-color: var(--neon);
  border-style: solid;
  opacity: .96;
  z-index: 2;
  pointer-events: none;
}
.card::before { top: -1px;  left: -1px;  border-width: 2px 0 0 2px; }
.card::after  { top: -1px;  right: -1px; border-width: 2px 2px 0 0; }

/* Bottom two corners via child div */
.card-corners {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 2;
}
.card-corners::before,
.card-corners::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border-color: var(--neon);
  border-style: solid;
  opacity: .96;
}
.card-corners::before { bottom: -1px; left:  -1px; border-width: 0 0 2px 2px; }
.card-corners::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.card-head {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border-2);
  position: relative;
}
.card-head h2 {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.step-prefix {
  color: var(--neon);
  font-size: 1em;
  font-weight: 700;
  text-shadow: 0 0 10px var(--neon), 0 0 22px var(--neon-glow);
  flex-shrink: 0;
}
.card-head p {
  font-family: var(--font-body);
  color: var(--text-sub);
  font-size: .97rem;
  line-height: 1.58;
}
.card-head .sys-label {
  position: absolute;
  top: 22px; right: 28px;
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dead);
}

.card-body {
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.card-foot {
  padding: 16px 28px;
  border-top: 1px solid var(--border-2);
  background: var(--panel);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .84rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: all var(--ease);
}
.btn-primary {
  background: var(--neon);
  color: #000;
  border: 2px solid var(--neon);
}
.btn-primary:hover:not(:disabled) {
  background: var(--neon-alt);
  border-color: var(--neon-alt);
  box-shadow: 0 0 20px var(--neon-glow);
}
.btn-primary:disabled {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-2);
  cursor: not-allowed;
  box-shadow: none;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-sub);
}
.btn-outline:hover { border-color: var(--neon); color: var(--neon-text); }

.btn-ghost {
  background: transparent;
  color: var(--text-sub);
  padding: 10px 16px;
  border: 1px solid var(--border-2);
  font-family: var(--font-mono);
  font-size: .82rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.btn-ghost:hover { color: var(--text); border-color: var(--neon); }

.btn-success {
  background: var(--neon);
  color: #000;
  border-color: var(--neon);
}
.btn-success:hover { background: var(--neon-alt); box-shadow: 0 0 20px var(--neon-glow); }

/* ── Tips panel — DO / AVOID split ─────────────────────────────── */
.tips-panel {
  padding: 14px 16px 16px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.tips-hd {
  margin-bottom: 11px;
}
.tips-title {
  font-family: var(--font-mono);
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--neon-text);
}
.tips-title::before { content: none; }
.tips-body {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 0 16px;
  align-items: start;
}
.tips-sep {
  align-self: stretch;
  background: var(--border-2);
  opacity: .35;
}
.tips-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tips-col-hd {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3px;
}
.t-badge {
  width: 17px; height: 17px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  font-weight: 900;
  flex-shrink: 0;
  line-height: 1;
  font-family: var(--font-mono);
}
.t-do   { background: var(--neon-dim); color: var(--neon-text); border: 1px solid var(--neon); }
.t-dont { background: var(--red-dim);  color: var(--red);       border: 1px solid var(--red);  }
.t-col-label {
  font-family: var(--font-mono);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
}
.tips-do   .t-col-label { color: var(--neon-text); }
.tips-dont .t-col-label { color: var(--red); }
.tip-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-family: var(--font-body);
  font-size: .775rem;
  color: var(--text-sub);
  line-height: 1.42;
}
.t-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.tips-do   .t-dot { background: var(--neon-text); opacity: .6; }
.tips-dont .t-dot { background: var(--red);       opacity: .6; }

/* ── Upload zone ───────────────────────────────────────────────── */
.upload-zone {
  border: 1.5px dashed var(--border-2);
  background: var(--card-2);
  padding: 44px 20px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color var(--ease), background var(--ease);
  overflow: hidden;
}
/* Targeting corner — top-left */
.upload-zone::before {
  content: '';
  position: absolute;
  top: 14px; left: 14px;
  width: 18px; height: 18px;
  border-top: 1.5px solid var(--border-2);
  border-left: 1.5px solid var(--border-2);
  transition: border-color var(--ease);
  pointer-events: none;
}
/* Targeting corner — bottom-right */
.upload-zone::after {
  content: '';
  position: absolute;
  bottom: 14px; right: 14px;
  width: 18px; height: 18px;
  border-bottom: 1.5px solid var(--border-2);
  border-right: 1.5px solid var(--border-2);
  transition: border-color var(--ease);
  pointer-events: none;
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--neon);
  background: var(--neon-dim);
  box-shadow: 0 0 0 1px var(--neon-glow), inset 0 0 28px var(--neon-dim);
}
.upload-zone:hover::before,
.upload-zone:hover::after,
.upload-zone.drag-over::before,
.upload-zone.drag-over::after {
  border-color: var(--neon);
  opacity: .96;
}
.file-hidden {
  position: absolute; inset: 0;
  opacity: 0; width: 100%; height: 100%; cursor: pointer;
}
.upload-body {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.upload-icon {
  width: 42px; height: 42px;
  color: var(--text-dim);
  transition: color var(--ease);
}
.upload-zone:hover .upload-icon,
.upload-zone.drag-over .upload-icon { color: var(--neon-text); }

.upload-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text);
}
.upload-sub  { color: var(--text-dim); font-size: .82rem; }
.upload-hint {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: .72rem;
  letter-spacing: .06em;
}

/* ── Preview ───────────────────────────────────────────────────── */
.preview-row  { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; position: relative; }
.preview-col  { flex: 1; min-width: 200px; max-width: 480px; display: flex; flex-direction: column; gap: 10px; }
.preview-col--single { flex: 0 1 480px; }
.preview-label {
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-dim);
  text-align: center;
}
.preview-img-wrap {
  background: var(--card-2);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.preview-img-wrap::before,
.preview-img-wrap::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border-color: var(--neon);
  border-style: solid;
  opacity: .5; z-index: 2;
  pointer-events: none;
}
.preview-img-wrap::before { top: 5px;    left: 5px;   border-width: 1.5px 0 0 1.5px; }
.preview-img-wrap::after  { bottom: 5px; right: 5px;  border-width: 0 1.5px 1.5px 0; }
.preview-img-wrap img { width: 100%; height: 220px; object-fit: cover; }
.preview-img-wrap--full img { height: 280px; object-fit: contain; }

/* ── Feedback banners ──────────────────────────────────────────── */
.feedback {
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: .82rem;
  letter-spacing: .03em;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-width: 1px;
  border-style: solid;
}
.feedback.ok {
  background: rgba(215,255,47,.06);
  color: var(--neon-text);
  border-color: rgba(215,255,47,.2);
  border-left: 3px solid var(--neon);
}
.feedback.error {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(255,69,69,.22);
  border-left: 3px solid var(--red);
}
.feedback.warn {
  background: var(--amber-dim);
  color: var(--amber);
  border-color: rgba(255,192,64,.22);
  border-left: 3px solid var(--amber);
}
.feedback::before {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  flex-shrink: 0;
  margin-top: 2px;
  opacity: .96;
}
.feedback.ok::before    { content: '[OK]'; }
.feedback.error::before { content: '[ERR]'; }
.feedback.warn::before  { content: '[WARN]'; }

/* ── Loading ───────────────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: .82rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-sub);
}
.spinner {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-2);
  border-top-color: var(--neon);
  border-radius: 50%;
  animation: spin .55s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Mode tabs ─────────────────────────────────────────────────── */
.tabs {
  display: flex;
  border: 1px solid var(--border);
}
.tab {
  flex: 1;
  padding: 9px 16px;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--panel);
  border: none;
  transition: all var(--ease);
}
.tab + .tab { border-left: 1px solid var(--border); }
.tab:hover  { color: var(--text-sub); background: var(--card-2); }
.tab.active {
  background: var(--neon-dim);
  color: var(--neon-text);
  border-bottom: 2px solid var(--neon);
}

/* ── Camera ────────────────────────────────────────────────────── */
.cam-hint {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .04em;
  color: var(--text-sub);
  line-height: 1.6;
}
.cam-no-access {
  text-align: center;
  padding: 42px 20px;
  border: 1px dashed var(--border-2);
  background: var(--card-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.cam-no-access p {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-sub);
}
.cam-active {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}
.cam-frame {
  position: relative;
  width: 100%; max-width: 480px;
  background: #000;
  aspect-ratio: 4/3;
  border: 1px solid var(--border);
  overflow: hidden;
}
.cam-frame::before,
.cam-frame::after {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  border-color: var(--neon);
  border-style: solid;
  z-index: 10;
  pointer-events: none;
  opacity: .96;
}
.cam-frame::before { top: 10px;    left: 10px;  border-width: 2px 0 0 2px; }
.cam-frame::after  { bottom: 10px; right: 10px; border-width: 0 2px 2px 0; }

#cam-video, #id-cam-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-overlay {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.cam-guide-text {
  position: absolute;
  bottom: 10px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.8);
  color: var(--neon);
  padding: 4px 14px;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  border: 1px solid rgba(215,255,47,.28);
}
.cam-controls { display: flex; justify-content: center; }
.btn-capture {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--neon);
  color: #000;
  padding: 13px 34px;
  font-family: var(--font-mono);
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  border: none;
  transition: all var(--ease);
}
.btn-capture:hover  { background: var(--neon-alt); box-shadow: 0 0 22px var(--neon-glow); }
.btn-capture:active { transform: scale(.98); }
.capture-dot {
  width: 11px; height: 11px;
  background: #000;
  display: inline-block;
  border-radius: 50%;
  flex-shrink: 0;
}
.retake-btn { margin-top: -8px; }

/* ── Review ────────────────────────────────────────────────────── */
.review-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}
.review-item { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.review-label {
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
}
.review-img-wrap {
  width: 210px; height: 140px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card-2);
  position: relative;
}
.review-img-wrap::before,
.review-img-wrap::after {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  border-color: var(--neon);
  border-style: solid;
  opacity: .5; z-index: 2;
  pointer-events: none;
}
.review-img-wrap::before { top: 5px;    left: 5px;   border-width: 1.5px 0 0 1.5px; }
.review-img-wrap::after  { bottom: 5px; right: 5px;  border-width: 0 1.5px 1.5px 0; }
.review-img-wrap img { width: 100%; height: 100%; object-fit: contain; }
.review-arrow {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.badge-ok {
  background: var(--neon-dim);
  color: var(--neon-text);
  border: 1px solid rgba(215,255,47,.22);
}

.summary-box {
  background: var(--card-2);
  border: 1px solid var(--border);
  padding: 16px 20px;
}
.summary-box h3 {
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text-dim);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.summary-box h3::before {
  content: '//';
  color: var(--neon-text);
  opacity: .6;
  font-size: .85em;
}
.summary-box ul { display: flex; flex-direction: column; gap: 9px; }
.summary-box li {
  font-family: var(--font-mono);
  font-size: .83rem;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-sub);
}
.summary-ok   { color: var(--neon-text); }
.summary-info { color: var(--text-dim); }

.privacy-note {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
}

/* ── Result card ───────────────────────────────────────────────── */
.success-card {
  text-align: center;
  padding: 56px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.success-icon { font-size: 2.8rem; line-height: 1; }
.success-card h2 {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text);
}
.success-card > p {
  font-family: var(--font-body);
  color: var(--text-sub);
  font-size: .92rem;
  line-height: 1.8;
  max-width: 440px;
}
.result-score {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 28px;
  border: 1px solid var(--border-2);
  background: var(--card-2);
  position: relative;
}
.result-score::before,
.result-score::after {
  content: '';
  position: absolute;
  width: 9px; height: 9px;
  border-style: solid;
  opacity: .55;
}
.result-score::before { top: -1px;    left: -1px;   border-width: 1.5px 0 0 1.5px; }
.result-score::after  { bottom: -1px; right: -1px;  border-width: 0 1.5px 1.5px 0; }
.score-match { color: var(--neon-text); border-color: rgba(215,255,47,.22); }
.score-match::before,
.score-match::after  { border-color: var(--neon); }
.score-fail  { color: var(--red);   border-color: rgba(255,69,69,.22); }
.score-fail::before,
.score-fail::after   { border-color: var(--red); }
.score-review{ color: var(--amber); border-color: rgba(255,192,64,.22); }
.score-review::before,
.score-review::after { border-color: var(--amber); }
.result-score .score-label {
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.result-score strong {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}

/* ── RTL overrides ─────────────────────────────────────────────── */
[dir="rtl"] { letter-spacing: 0; }
[dir="rtl"] .header-inner   { flex-direction: row-reverse; }
[dir="rtl"] .logo            { flex-direction: row-reverse; }
[dir="rtl"] .hud-coords     { flex-direction: row-reverse; }
[dir="rtl"] .card-foot      { flex-direction: row-reverse; }
[dir="rtl"] .stepper        { direction: ltr; }
[dir="rtl"] .review-grid    { direction: ltr; }
[dir="rtl"] .tabs           { flex-direction: row-reverse; }
[dir="rtl"] .preview-row    { flex-direction: row-reverse; }
[dir="rtl"] .card-head,
[dir="rtl"] .card-body      { text-align: right; }
[dir="rtl"] .privacy-note   { text-align: right; }
[dir="rtl"] .feedback       { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .loading        { flex-direction: row-reverse; }
[dir="rtl"] .upload-body    { direction: rtl; }
[dir="rtl"] .cam-no-access  { direction: rtl; }
[dir="rtl"] .success-card   { direction: rtl; text-align: center; align-items: center; }
[dir="rtl"] .result-score   { flex-direction: row-reverse; }
[dir="rtl"] .tips-title::before { content: none; }
[dir="rtl"] .tips-title::after  { content: none; }
[dir="rtl"] .tips-body          { direction: rtl; }
[dir="rtl"] .summary-box             { direction: rtl; text-align: right; }
[dir="rtl"] .summary-box h3::before  { content: none; }
[dir="rtl"] .summary-box h3::after   { content: ' //'; color: var(--neon-text); opacity: .6; font-size: .85em; }
[dir="rtl"] .card-head h2   { justify-content: flex-start; }
[dir="rtl"] .card-head .sys-label { right: auto; left: 28px; }
[dir="rtl"] .feedback.ok    { border-left: 1px solid rgba(215,255,47,.2);  border-right: 3px solid var(--neon);  }
[dir="rtl"] .feedback.error { border-left: 1px solid rgba(255,69,69,.22);  border-right: 3px solid var(--red);   }
[dir="rtl"] .feedback.warn  { border-left: 1px solid rgba(255,192,64,.22); border-right: 3px solid var(--amber); }
[dir="rtl"] .feedback.ok::before    { content: '[تم]';    }
[dir="rtl"] .feedback.error::before { content: '[خطأ]';   }
[dir="rtl"] .feedback.warn::before  { content: '[تنبيه]'; }

/* ── Responsive ────────────────────────────────────────────────── */

/* Tablet Landscape / Small Laptop (≤ 900px) */
@media (max-width: 900px) {
  .header-inner { padding: 12px 20px; }
  .main         { padding: 32px 18px 70px; }
  .card-head    { padding: 22px 24px 18px; }
  .card-body    { padding: 20px 24px; gap: 18px; }
  .card-foot    { padding: 14px 24px; }
}

/* Tablet Portrait (≤ 768px) */
@media (max-width: 768px) {
  html { font-size: 16.5px; }
  .header-inner    { padding: 10px 18px; gap: 10px; }
  .logo            { font-size: .95rem; gap: 10px; }
  .logo-icon       { width: 30px; height: 30px; }
  .header-tagline  { font-size: .88rem; }
  .main            { padding: 26px 16px 64px; }
  .card-head       { padding: 20px 20px 16px; }
  .card-body       { padding: 18px 20px; gap: 16px; }
  .card-foot       { padding: 14px 20px; }
  .card-head h2    { font-size: 1.1rem; }
  .stepper         { margin-bottom: 26px; }
  .step-badge      { min-width: 54px; height: 32px; padding: 0 8px; }
  .stepper-item span { font-size: .62rem; }
  .upload-zone     { padding: 34px 16px; }
  .review-img-wrap { width: 185px; height: 124px; }
  .result-score    { padding: 14px 22px; gap: 14px; }
  .success-card    { padding: 46px 28px; }
  .tips-panel      { padding: 12px 14px 14px; }
  .preview-img-wrap--full img { height: 240px; }
}

/* Mobile (≤ 560px) */
@media (max-width: 560px) {
  html { font-size: 15.5px; }
  .header-tagline  { display: none; }
  .header-inner    { padding: 10px 14px; gap: 8px; }
  .logo            { font-size: .88rem; gap: 8px; }
  .logo-icon       { width: 27px; height: 27px; }
  .logo-dot        { width: 7px; height: 7px; }
  .main            { padding: 18px 10px 60px; }
  .card-head       { padding: 16px 16px 14px; }
  .card-body       { padding: 15px 16px; gap: 15px; }
  .card-foot       { padding: 12px 16px; }
  .card-head h2    { font-size: 1rem; gap: 8px; }
  .stepper         { margin-bottom: 20px; }
  .stepper-line    { min-width: 18px; max-width: 50px; }
  .step-badge      { min-width: 46px; height: 30px; font-size: .78rem; padding: 0 7px; }
  .preview-row     { flex-direction: column; }
  .preview-img-wrap--full img { height: 210px; }
  .review-arrow    { transform: rotate(90deg); }
  .review-img-wrap { width: 95%; height: 140px; }
  .main            { padding: 18px 10px 60px; }
  .success-card    { padding: 36px 18px; gap: 14px; }
  .score-value     { font-size: 2.2rem; }
  .result-score    { flex-wrap: wrap; justify-content: center; gap: 10px; padding: 14px 16px; }
  .upload-zone     { padding: 26px 12px; }
  .tips-body       { grid-template-columns: 1fr; gap: 10px 0; }
  .tips-sep        { display: none; }
  .review-grid     { gap: 14px; }
  .tabs .tab-btn   { font-size: .7rem; padding: 9px 10px; }
  .btn             { font-size: .82rem; padding: 10px 18px; }
}

/* Small Mobile (≤ 420px) */
@media (max-width: 420px) {
  html { font-size: 14.5px; }
  .header-inner    { padding: 8px 12px; gap: 6px; }
  .logo            { font-size: .82rem; gap: 7px; }
  .logo-icon       { width: 24px; height: 24px; }
  .logo-dot        { width: 6px; height: 6px; }
  .main            { padding: 14px 8px 56px; }
  .card-head       { padding: 14px 13px 12px; }
  .card-body       { padding: 13px 13px; gap: 13px; }
  .card-foot       { padding: 11px 13px; }
  .card-head h2    { font-size: .92rem; gap: 7px; }
  .stepper-item span { display: none; }
  .step-badge      { min-width: 40px; height: 28px; font-size: .72rem; padding: 0 6px; }
  .stepper-line    { min-width: 14px; max-width: 36px; }
  .result-score    { flex-direction: column; align-items: center; gap: 8px; padding: 12px 14px; }
  .success-card    { padding: 28px 14px; gap: 12px; }
  .score-value     { font-size: 1.9rem; }
  .upload-zone     { padding: 22px 10px; }
  .preview-img-wrap--full img { height: 180px; }
  .btn             { font-size: .78rem; padding: 9px 14px; }
}
