/* Theme system */

:root {
  color-scheme: light;
  --bg: #e3e6ee;
  --surface: #edeff5;
  --ink: #232b3d;
  --ink-soft: #586178;
  --line: #c9cfdf;
  --emerald: #6674e8;
  --emerald-deep: #4f5fc7;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #24283a;
    --surface: #2d3247;
    --ink: #f2f4fa;
    --ink-soft: #b5bdd0;
    --line: #454d68;
    --emerald: #8792ff;
    --emerald-deep: #6f7bf0;
  }
}

html[data-theme="light"] {
  --bg: #e3e6ee;
  --surface: #edeff5;
  --ink: #232b3d;
  --ink-soft: #586178;
  --line: #c9cfdf;
}

html[data-theme="dark"] {
  --bg: #24283a;
  --surface: #2d3247;
  --ink: #f2f4fa;
  --ink-soft: #b5bdd0;
  --line: #454d68;
}

/* Theme switcher button */
.theme-switcher {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}

.theme-switcher:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--surface);
}

.theme-switcher:active {
  transform: scale(0.92);
}

/* Lamp icon */
.theme-icon {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: #171a22;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

.theme-rays {
  stroke-width: 1.8;
}

html[data-theme="dark"] .theme-icon {
  stroke: #ffffff;
}


/* Smooth transitions */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

html.no-transition * {
  transition: none !important;
}

/* Responsive */
@media (max-width: 640px) {
  .theme-switcher {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }
  
  .theme-icon {
    width: 28px;
    height: 28px;
  }
}

.nav-cta .theme-switcher {
  position: relative;
  inset: auto;
  margin-inline-start: 4px;
}

.theme-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
}

.theme-slot .theme-switcher {
  position: relative;
  inset: auto;
}

@media (max-width: 640px) {
  .theme-slot {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .nav-cta .theme-switcher {
    margin-inline-start: 2px;
  }
}

body > #themeSwitcher {
  position: fixed;
  top: 22px;
  left: 22px;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(39,48,68,.14);
  background: var(--surface);
}

html[data-theme="dark"] body > #themeSwitcher {
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}

/* ---- Panel / admin colors (light + dark) ---- */
:root{
  --card:#edeff5;--card-soft:#d9deea;--tint:#d7ddf6;--tint2:#dfe3f5;--tint-line:#b9c2ec;
  --head-bg:rgba(227,230,238,.9);--glass:rgba(237,239,245,.82);--glass-hi:rgba(255,255,255,.35);
  --warn-soft:#f1e8d3;--warn-line:#dcc68f;--gold:#d6a84f
}
html[data-theme="dark"]{
  --card:#2d3247;--card-soft:#343a52;--tint:#39415b;--tint2:#323852;--tint-line:#4c5578;
  --head-bg:rgba(36,40,58,.9);--glass:rgba(45,50,71,.85);--glass-hi:rgba(255,255,255,.06);
  --warn-soft:#3d3a34;--warn-line:#6b5a35;--gold:#e6bb68;
  --emerald:#8792ff;--emerald-deep:#6f7bf0;
  --danger:#ff8a80
}
html[data-theme="dark"] body{background:radial-gradient(circle at 85% 0%,#2f3550 0%,#24283a 55%),#24283a}
html[data-theme="dark"] .btn-ghost{color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .btn-ghost:hover{color:var(--gold);border-color:var(--gold)}


/* ===== Typography: Ravi FaNum for headings and body, Vazirmatn as fallback (change fonts here) ===== */
:root{
  --font-body:'Ravi FaNum','Vazirmatn',Tahoma,'Segoe UI',sans-serif;
  --font-head:'Ravi FaNum','Vazirmatn',Tahoma,'Segoe UI',sans-serif;
}
body:not(.admin) :is(h1,h2,h3,h4),
body:not(.admin) .logo,
body:not(.admin) .p-brand,
body:not(.admin) .brand b,
body:not(.admin) .eyebrow,
body:not(.admin) .bio-formula span,
body:not(.admin) #home div > b{
  font-family:var(--font-head);font-weight:600;font-synthesis:none;letter-spacing:0;line-height:1.6
}
body:not(.admin) .logo,body:not(.admin) .p-brand{font-weight:600}
body:not(.admin) h1{line-height:1.6}
body:not(.admin) .eyebrow{font-size:15px;font-weight:500}
body:not(.admin) .logo{font-size:24px}
body:not(.admin) .p-brand{font-size:20px}
body:not(.admin) h2{font-size:32px}
body:not(.admin) .bio-head h3{font-size:26px}
body:not(.admin) .bio-block h4{font-size:19px}
body:not(.admin) .bio-formula span{font-size:17px}
body:not(.admin) .product h3{font-size:18px}
body:not(.admin) .p-view h2{font-size:26px}
body:not(.admin) .auth-page-card h1{font-size:30px}
body:not(.admin) .card h3{font-size:20px}
body:not(.admin) .step h3{font-size:19px}
body:not(.admin) .hero h1{font-size:46px;line-height:1.55;max-width:560px}
body:not(.admin) .hero .lede{font-size:16px}
@media(max-width:640px){body:not(.admin) .hero h1{font-size:33px}body:not(.admin) h2{font-size:27px}body:not(.admin) .bio-head h3{font-size:23px}}

html,body,button,input,select,textarea,option,optgroup{font-family:var(--font-body)}
svg text{font-family:var(--font-body)}
button,input,select,textarea{font-family:inherit}
