/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  --hero-bg:    #060e1a;
  --panel-bg:   #ffffff;
  --ink:        #0d1b2a;
  --ink-muted:  #4b607a;
  --ink-subtle: #8fa3b8;
  --border:     #dde4ec;
  --field-bg:   #f7f9fc;
  --brand:      #0ea5e9;
  --brand-2:    #3b82f6;
  --brand-grad: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
  --red:        #dc2626;
  --r:          10px;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Manrope", sans-serif;
  background: var(--hero-bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

[dir="rtl"] body,
[dir="rtl"] .panel { font-family: "Tajawal", "Manrope", sans-serif; }

/* ── Page: side-by-side split ────────────────────────────────── */
.page {
  display: flex;
  min-height: 100vh;
}

/* ════════════════════════════════════════════════════════════════
   HERO (left)
   ════════════════════════════════════════════════════════════════ */
.hero {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}

/* Ambient glow orbs */
.glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(90px);
}
.g1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(14,165,233,.22) 0%, transparent 70%);
  top: -120px; left: -120px;
}
.g2 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(59,130,246,.18) 0%, transparent 70%);
  bottom: -80px; right: -60px;
}

/* Expanding pulse rings */
.ring {
  position: absolute;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: ring-pulse 7s ease-in-out infinite;
}
.r1 { width: 260px; height: 260px; border: 1px solid rgba(14,165,233,.20); animation-delay: 0s; }
.r2 { width: 460px; height: 460px; border: 1px solid rgba(59,130,246,.12); animation-delay: 2s; }
.r3 { width: 660px; height: 660px; border: 1px solid rgba(14,165,233,.06); animation-delay: 4s; }

@keyframes ring-pulse {
  0%, 100% { opacity: .35; transform: translate(-50%,-50%) scale(.95); }
  50%       { opacity: 1;   transform: translate(-50%,-50%) scale(1.05); }
}

/* Hero content */
.hero-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}

.hero-logo {
  width: 76px; height: 76px;
  border-radius: 22px;
  border: 1.5px solid rgba(255,255,255,.1);
  box-shadow: 0 0 48px rgba(14,165,233,.35), 0 2px 8px rgba(0,0,0,.4);
}

.hero-name {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -.04em;
  background: linear-gradient(140deg, #f0f9ff 0%, #bae6fd 55%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.05;
}

.hero-tagline {
  color: rgba(186,230,253,.65);
  font-size: 0.92rem;
  font-weight: 500;
  max-width: 270px;
  line-height: 1.65;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.hero-chips span {
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid rgba(14,165,233,.28);
  background: rgba(14,165,233,.08);
  color: rgba(186,230,253,.8);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: .04em;
  white-space: nowrap;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 16px 26px;
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  backdrop-filter: blur(8px);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.stat-item b {
  font-size: 1.5rem;
  font-weight: 800;
  color: #e0f2fe;
  line-height: 1;
}
.stat-item small {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: rgba(186,230,253,.45);
}
.stat-sep {
  width: 1px;
  height: 34px;
  background: rgba(255,255,255,.09);
}

/* ════════════════════════════════════════════════════════════════
   PANEL (right form)
   ════════════════════════════════════════════════════════════════ */
.panel {
  width: 460px;
  flex-shrink: 0;
  background: var(--panel-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 48px 40px;
  /* subtle left border separating panel from hero */
  box-shadow: -1px 0 0 rgba(255,255,255,.06);
}

/* Lang switch — top corner, respects RTL via inset-inline-end */
.lang-switch {
  position: absolute;
  top: 20px;
  inset-inline-end: 20px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--field-bg);
  color: var(--ink-muted);
  font-family: "Manrope", "Tajawal", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, color .15s, background .15s;
  z-index: 5;
}
.lang-switch:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: #f0f9ff;
}

/* Mobile-only logo */
.panel-logo { display: none; }

.panel-inner {
  width: 100%;
  max-width: 340px;
}

.panel-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--ink);
  margin-bottom: 6px;
  line-height: 1.2;
}

.panel-sub {
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ── Flash messages ──────────────────────────────────────────── */
.flash {
  border-radius: var(--r);
  padding: 11px 14px;
  font-size: 0.83rem;
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.4;
}
.flash-danger, .flash-error {
  background: #fef2f2;
  color: var(--red);
  border: 1px solid #fecaca;
}

/* ── Form ────────────────────────────────────────────────────── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.field input {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  background: var(--field-bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(14,165,233,.12);
}
.field input::placeholder { color: var(--ink-subtle); }

/* Password show/hide */
.pw-wrap { position: relative; }
.pw-wrap input { padding-inline-end: 42px; }

.pw-toggle {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: 10px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--ink-subtle);
  cursor: pointer;
  padding: 4px;
  line-height: 0;
  transition: color .15s;
}
.pw-toggle:hover { color: var(--brand); }

/* ── Submit button ───────────────────────────────────────────── */
.btn-login {
  width: 100%;
  margin-top: 4px;
  padding: 13px;
  border: none;
  border-radius: var(--r);
  background: var(--brand-grad);
  color: #fff;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(14,165,233,.3);
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s;
}
.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(14,165,233,.42);
}
.btn-login:active { transform: translateY(0); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 780px) {
  /* Hero disappears, form takes full viewport */
  .hero { display: none; }

  .panel {
    width: 100%;
    min-height: 100vh;
    padding: 32px 24px;
    background: radial-gradient(ellipse at 75% 5%, #dbeafe 0%, #f0f9ff 40%, #fff 75%);
    box-shadow: none;
  }

  .panel-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 22px;
  }
  .panel-logo img {
    width: 58px; height: 58px;
    border-radius: 15px;
    box-shadow: 0 8px 24px rgba(14,165,233,.2);
  }

  .panel-title { font-size: 1.5rem; }
}

@media (max-width: 400px) {
  .panel { padding: 28px 18px; }
  .panel-title { font-size: 1.35rem; }
}

/* ── Panel controls (lang + dark toggle grouped) ─────────────── */
.panel-controls {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
}
.panel-ctrl-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--field-bg);
  color: var(--ink-muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, color .15s, background .15s;
  font-family: "Manrope", "Tajawal", sans-serif;
  line-height: 1;
}
.panel-ctrl-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: #f0f9ff;
}

/* ── Dark mode ───────────────────────────────────────────────── */
[data-theme="dark"] {
  --panel-bg:   #161b22;
  --ink:        #e6edf3;
  --ink-muted:  #8b949e;
  --ink-subtle: #6e7681;
  --border:     #30363d;
  --field-bg:   #0d1117;
}
[data-theme="dark"] .panel {
  background: var(--panel-bg);
  box-shadow: -1px 0 0 rgba(255,255,255,.04);
}
[data-theme="dark"] .field input {
  color: var(--ink);
}
[data-theme="dark"] .field input:focus {
  background: #1c2128;
  box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}
[data-theme="dark"] .panel-ctrl-btn,
[data-theme="dark"] .lang-switch {
  background: #21262d;
  border-color: var(--border);
  color: var(--ink-muted);
}
[data-theme="dark"] .panel-ctrl-btn:hover,
[data-theme="dark"] .lang-switch:hover {
  background: #30363d;
  color: var(--brand);
  border-color: var(--brand);
}
[data-theme="dark"] .flash-danger,
[data-theme="dark"] .flash-error {
  background: rgba(220,38,38,.12);
  border-color: rgba(220,38,38,.3);
  color: #fca5a5;
}
[data-theme="dark"] .panel-sub,
[data-theme="dark"] .panel-title { color: var(--ink); }
[data-theme="dark"] .otp-hint { color: var(--ink-subtle); }

@media (max-width: 780px) {
  [data-theme="dark"] .panel {
    background: radial-gradient(ellipse at 75% 5%, #1c2840 0%, #0d1117 40%, #161b22 75%);
  }
}

/* ════════════════════════════════════════════════════════════════
   DEMO / WHATSAPP CTA
   ════════════════════════════════════════════════════════════════ */

/* ── Divider ──────────────────────────────────────────────────── */
.demo-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  color: var(--ink-subtle);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.demo-divider::before,
.demo-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Card ─────────────────────────────────────────────────────── */
.demo-card {
  border-radius: 14px;
  border: 1.5px solid rgba(34, 197, 94, .22);
  background: rgba(240, 253, 244, .65);
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.demo-card:hover {
  border-color: rgba(34, 197, 94, .45);
  background: rgba(240, 253, 244, .95);
  box-shadow: 0 4px 20px rgba(34, 197, 94, .1);
}

/* ── Header row: pulse dot + label ───────────────────────────── */
.demo-card-header {
  display: flex;
  align-items: center;
  gap: 9px;
}

.demo-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: demo-pulse-ring 2.2s ease-out infinite;
}

@keyframes demo-pulse-ring {
  0%   { box-shadow: 0 0 0 0   rgba(34,197,94,.75); }
  70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0);   }
  100% { box-shadow: 0 0 0 0   rgba(34,197,94,0);   }
}

.demo-label {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.01em;
}

/* ── Hint text ────────────────────────────────────────────────── */
.demo-hint {
  font-size: 0.76rem;
  color: var(--ink-muted);
  line-height: 1.55;
  margin: -4px 0 0;
}

/* ── WhatsApp button ──────────────────────────────────────────── */
.btn-whatsapp {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #fff;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: .01em;
  box-shadow: 0 5px 16px rgba(37,211,102,.28);
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
  cursor: pointer;
}
.btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(37,211,102,.42);
}
.btn-whatsapp:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(37,211,102,.3);
}

.btn-whatsapp svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.wa-number {
  margin-inline-start: auto;
  font-size: 0.72rem;
  font-weight: 600;
  opacity: .82;
  letter-spacing: .02em;
  white-space: nowrap;
}

/* ── Free / no-commitment badges ─────────────────────────────── */
.demo-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.67rem;
  font-weight: 700;
  color: #15803d;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.demo-badges span:not(.demo-dot)::before {
  content: '✓ ';
}
.demo-dot {
  color: rgba(21,128,61,.4);
  font-weight: 400;
}
.demo-dot::before { content: none !important; }

/* ── Dark mode overrides ──────────────────────────────────────── */
[data-theme="dark"] .demo-card {
  background: rgba(20, 83, 45, .13);
  border-color: rgba(34, 197, 94, .2);
}
[data-theme="dark"] .demo-card:hover {
  background: rgba(20, 83, 45, .22);
  border-color: rgba(34, 197, 94, .4);
  box-shadow: 0 4px 20px rgba(34, 197, 94, .08);
}
[data-theme="dark"] .demo-hint {
  color: var(--ink-subtle);
}
[data-theme="dark"] .demo-badges {
  color: #4ade80;
}
[data-theme="dark"] .demo-dot {
  color: rgba(74,222,128,.35);
}
