/* Misbar Auth - Arabic / RTL stylesheet */
:root {
  --bg: #0a0a0a;
  --bg-2: #0f0f0f;
  --surface: #1c1c1c;
  --surface-2: #232323;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f5f5f5;
  --text-dim: #9a9a9a;
  --text-faint: #6a6a6a;
  --primary: #10b981;
  --primary-hover: #34d399;
  --danger: #ef4444;
  --warn: #f59e0b;
  --ok: #22c55e;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Naskh Arabic', -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body { display: flex; flex-direction: column; }
a { color: inherit; }
button { font-family: inherit; }
input { font-family: inherit; }

.page { display: flex; flex-direction: column; min-height: 100vh; padding: 32px 24px 24px; }
.topbar {
  position: relative;
  display: flex; justify-content: center; align-items: center;
  padding: 8px 0 24px;
}
.wordmark { display: flex; align-items: center; user-select: none; }
.wordmark img { height: 44px; width: auto; display: block; }
.back-link {
  position: absolute;
  right: 0; top: 8px;
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 13px; color: var(--text-dim);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border);
  transition: color .15s, border-color .15s, background .15s;
}
.back-link:hover { color: var(--text); border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.03); }
.back-link svg { width: 14px; height: 14px; }

.stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 32px; }
.col { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 0; }

.hero { text-align: center; margin-bottom: 56px; padding: 0 8px; }
.hero h1 {
  font-family: 'Noto Naskh Arabic', serif;
  font-weight: 700;
  font-size: 40px;
  line-height: 1.25;
  margin: 0 0 18px;
  color: #fff;
  text-wrap: balance;
}
.hero h1 .accent { color: var(--primary); }
.hero p { color: var(--text-dim); font-size: 15px; line-height: 1.55; margin: 0 auto; max-width: 360px; text-wrap: pretty; }

.section-title { text-align: center; margin: 0 0 6px; font-family: 'Noto Naskh Arabic', serif; font-weight: 700; font-size: 26px; color: #fff; }
.section-sub { text-align: center; color: var(--text-faint); font-size: 13px; margin: 0 0 20px; }

.field { margin-bottom: 12px; }
.input {
  width: 100%; height: 56px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--text);
  font-size: 15px;
  padding: 0 18px;
  outline: none;
  transition: border-color .15s, background .15s;
}
.input::placeholder { color: var(--text-faint); }
.input:focus { border-color: rgba(16, 185, 129, 0.5); background: #1f1f1f; }
.input.error { border-color: rgba(239, 68, 68, 0.6); }

.input-with-suffix { position: relative; }
.input-with-suffix .input { padding-left: 52px; }
.suffix-btn {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; color: var(--text-faint); cursor: pointer;
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.suffix-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }

.label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; padding: 0 4px; }
.label { font-size: 13px; color: var(--text-dim); }
.help { font-size: 12px; color: var(--text-faint); margin: 6px 4px 0; }
.err-msg { font-size: 12px; color: var(--danger); margin: 6px 4px 0; min-height: 16px; }
.ok-msg { color: var(--ok); }

/* ── Toast notifications (top-center, sleek) ─────────────────── */
.toast-stack {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  align-items: center;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  border-radius: 12px;
  background: rgba(15, 15, 15, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  min-width: 280px;
  max-width: min(440px, 90vw);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-success { border-color: rgba(34, 197, 94, 0.35); }
.toast.toast-error   { border-color: rgba(239, 68, 68, 0.4); }
.toast.toast-info    { border-color: rgba(59, 130, 246, 0.35); }
.toast-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
}
.toast-success .toast-icon { color: var(--ok); }
.toast-error   .toast-icon { color: var(--danger); }
.toast-info    .toast-icon { color: #60a5fa; }
.toast-text { flex: 1; line-height: 1.45; }

.btn {
  width: 100%; height: 56px;
  border-radius: 14px;
  border: 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .08s, background .15s, opacity .15s;
}
.btn:active { transform: scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #052e13; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-surface { background: var(--surface); color: var(--text); }
.btn-surface:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); }

.spacer-lg { height: 36px; }
.spacer-md { height: 20px; }
.spacer-sm { height: 12px; }

.privacy { text-align: center; color: var(--text-faint); font-size: 12px; margin-top: 22px; }
.privacy a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--text-faint); }

.mono { font-family: 'Space Mono', monospace; }

.footer { margin-top: 64px; padding: 32px 0 16px; display: flex; justify-content: center; }
.footer a { color: var(--text-dim); font-size: 13px; text-decoration: none; }
.footer a:hover { color: var(--text); }

.mfa-row { display: flex; gap: 10px; justify-content: center; direction: ltr; margin: 20px 0 8px; }
.mfa-box {
  width: 52px; height: 60px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 12px;
  color: #fff;
  font-size: 22px; font-weight: 600;
  text-align: center;
  outline: none;
  transition: border-color .15s, background .15s;
  font-family: 'Space Mono', monospace;
}
.mfa-box:focus { border-color: rgba(16, 185, 129, 0.6); background: #1f1f1f; }
.mfa-box.filled { border-color: rgba(16, 185, 129, 0.3); }

.strength { margin-top: 10px; }
.strength-bar { height: 4px; background: rgba(255, 255, 255, 0.06); border-radius: 999px; overflow: hidden; }
.strength-fill { height: 100%; transition: width .25s, background .25s; border-radius: 999px; width: 0; background: #444; }
.strength-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 11px; color: var(--text-faint); }

.reqs { margin-top: 12px; padding: 14px 16px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border); border-radius: 12px; }
.reqs ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.reqs li { font-size: 12px; color: var(--text-faint); display: flex; align-items: center; gap: 8px; transition: color .15s; }
.reqs li.ok { color: var(--ok); }
.reqs li .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0; padding: 0 4px; font-size: 13px; color: var(--text-dim); }
.check-row input[type="checkbox"] { margin-top: 2px; accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; }
.check-row a { color: var(--text); }

.row-between { display: flex; align-items: center; justify-content: flex-end; margin: 6px 4px 18px; }
.link { color: var(--text-dim); font-size: 13px; text-decoration: none; }
.link:hover { color: var(--text); }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 18px; height: 18px; border: 3px solid rgba(255,255,255,0.2); border-top-color: #052e13; border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.fade-enter { animation: fade .25s ease both; }

@media (max-width: 520px) {
  .hero h1 { font-size: 36px; }
  .page { padding: 20px 18px; }
}

/* ──────────────────────────────────────────────────────────────── */
/* ════════ RESPONSIVE — Mobile / Tablet / Large screens ═══════════ */
/* ──────────────────────────────────────────────────────────────── */

/* Large screens (≥1440px): generous spacing, slightly bigger hero */
@media (min-width: 1440px) {
  .page { padding: 48px 32px 32px; }
  .stage { padding-top: 56px; }
  .col { max-width: 480px; }
  .hero { margin-bottom: 64px; }
  .hero h1 { font-size: 44px; }
  .footer { margin-top: 80px; }
}

/* Tablet (≤1024px) — keep form column but tighten chrome */
@media (max-width: 1024px) {
  .page { padding: 28px 24px 24px; }
  .stage { padding-top: 24px; }
  .hero { margin-bottom: 44px; }
  .footer { margin-top: 48px; padding: 24px 0 12px; }
}

/* Mobile large (≤640px) */
@media (max-width: 640px) {
  .page { padding: 18px 16px 16px; }
  .topbar { padding: 4px 0 18px; }
  .wordmark img { height: 36px; }
  .back-link { font-size: 12px; padding: 5px 10px; gap: 5px; }
  .back-link svg { width: 12px; height: 12px; }

  .stage { padding-top: 16px; }
  .col { max-width: 100%; }
  .hero { margin-bottom: 36px; padding: 0 4px; }
  .hero h1 { font-size: 30px; margin: 0 0 14px; line-height: 1.3; }
  .hero p { font-size: 14px; max-width: 100%; }

  .section-title { font-size: 22px; }
  .section-sub { font-size: 12px; }

  .input { height: 52px; font-size: 14px; padding: 0 16px; border-radius: 12px; }
  .input-with-suffix .input { padding-left: 48px; }
  .suffix-btn { width: 36px; height: 36px; }

  .btn { height: 52px; font-size: 14px; border-radius: 12px; }
  .spacer-lg { height: 28px; }
  .spacer-md { height: 16px; }

  .mfa-row { gap: 8px; margin: 16px 0 6px; }
  .mfa-box { width: 44px; height: 52px; font-size: 20px; border-radius: 10px; }

  .reqs { padding: 12px 14px; }
  .reqs li { font-size: 11px; }

  .check-row { font-size: 12px; gap: 8px; margin: 12px 0; }
  .row-between { margin: 4px 4px 14px; }
  .link { font-size: 12px; }

  .privacy { font-size: 11px; margin-top: 18px; line-height: 1.6; }
  .footer { margin-top: 36px; padding: 20px 0 10px; }
  .footer a { font-size: 12px; }

  /* Toasts: use most of screen width */
  .toast { min-width: auto; max-width: calc(100vw - 24px); font-size: 13px; padding: 11px 16px; }
  .toast-stack { top: 14px; gap: 8px; }

  /* Modals: full screen on phones */
  .modal-overlay { padding: 12px; }
  .modal { max-height: 92vh; border-radius: 14px; }
  .modal-header { padding: 16px 18px; }
  .modal-title { font-size: 17px; }
  .modal-close { width: 32px; height: 32px; }
  .modal-body { padding: 16px 18px; font-size: 13px; line-height: 1.75; }
  .modal-body h3 { font-size: 14px; margin: 14px 0 6px; }
  .modal-footer { padding: 12px 18px; }
  .modal-footer .btn { height: 40px; padding: 0 18px; font-size: 14px; }

  .faq-item summary { padding: 12px 14px; font-size: 13px; }
  .faq-item summary::after { font-size: 18px; }
  .faq-item .faq-answer { font-size: 12.5px; padding: 0 14px 12px; }
}

/* Small mobile (≤380px) */
@media (max-width: 380px) {
  .page { padding: 14px 12px 12px; }
  .wordmark img { height: 32px; }
  .back-link span { display: none; }
  .back-link { padding: 6px; }

  .hero h1 { font-size: 26px; }
  .hero p { font-size: 13px; }

  .mfa-row { gap: 6px; }
  .mfa-box { width: 38px; height: 46px; font-size: 18px; }

  .input { height: 48px; font-size: 14px; }
  .btn { height: 48px; }
}

/* Very short viewports (landscape phones) */
@media (max-height: 640px) and (max-width: 900px) {
  .hero { margin-bottom: 24px; }
  .stage { padding-top: 12px; }
  .footer { margin-top: 24px; }
}

/* ── Modal (Privacy Policy etc.) ───────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
  padding: 24px;
  animation: fade .2s ease both;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  width: 100%; max-width: 640px;
  max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  animation: fade .25s ease both;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 20px; font-weight: 700; color: #fff; margin: 0;
}
.modal-close {
  background: transparent; border: 0; cursor: pointer;
  width: 36px; height: 36px; border-radius: 10px;
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s;
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.modal-body {
  padding: 22px 28px;
  overflow-y: auto;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.85;
}
.modal-body h3 {
  color: #fff;
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 15px; font-weight: 700;
  margin: 18px 0 8px;
}
.modal-body h3:first-child { margin-top: 0; }
.modal-body p { margin: 0 0 10px; }
.modal-body ul { padding-right: 20px; margin: 0 0 12px; }
.modal-body li { margin-bottom: 6px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end;
}
.modal-footer .btn { width: auto; padding: 0 24px; height: 44px; }
body.modal-open { overflow: hidden; }

/* ── FAQ accordion (inside modals) ─────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .15s, background .15s;
}
.faq-item[open] {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.04);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-family: 'Noto Naskh Arabic', serif;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 20px;
  font-weight: 400;
  color: var(--primary);
  transition: transform .2s;
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item summary:hover { color: var(--primary-hover); }
.faq-item .faq-answer {
  padding: 0 16px 14px;
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.85;
}
