/* ============================================================
   Auth Pages — Login & Register
   ============================================================ */

body.auth-body { background: #f8fafc; min-height: 100vh; }

.auth-page {
  display: grid;
  grid-template-columns: 1fr 480px;
  min-height: 100vh;
}
.auth-page--wide { grid-template-columns: 1fr 520px; }

.auth-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #0f2520 0%, #1a3a5c 40%, #0d3b6e 70%, #0f2520 100%);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px; order: -1;
}
.auth-hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(30,136,229,0.25) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(22,163,74,0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(15,37,32,0.4) 0%, transparent 70%);
}
.auth-hero::after {
  content: '🏔️'; position: absolute;
  bottom: 80px; left: 50%; transform: translateX(-50%);
  font-size: 180px; opacity: 0.12; filter: grayscale(0.3); pointer-events: none;
}
.auth-hero-content { position: relative; z-index: 2; }

.auth-logo {
  display: inline-flex; align-items: center; gap: 10px;
  color: #fff; font-size: 22px; font-weight: 800;
  text-decoration: none; margin-bottom: auto;
}
.auth-logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #1e88e5, #0d47a1);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
}
.auth-logo-icon svg { width: 22px; height: 22px; fill: #fff; }

.auth-hero-body { position: relative; z-index: 2; margin-top: auto; }
.auth-hero-title { font-size: 38px; font-weight: 800; color: #fff; line-height: 1.25; margin-bottom: 14px; }
.auth-hero-sub { font-size: 15px; color: rgba(255,255,255,0.75); line-height: 1.8; max-width: 360px; }
.auth-hero-dots { display: flex; gap: 8px; margin-top: 28px; }
.auth-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.3); }
.auth-dot.active { width: 24px; border-radius: 4px; background: #1e88e5; }

.auth-hero-stats { display: flex; gap: 28px; margin-top: 36px; position: relative; z-index: 2; }
.auth-stat { text-align: center; border-top: 1px solid rgba(255,255,255,0.15); padding-top: 14px; }
.auth-stat-num { font-size: 22px; font-weight: 800; color: #fff; }
.auth-stat-label { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 2px; }

.auth-hero-features { display: flex; flex-direction: column; gap: 14px; margin-top: 32px; position: relative; z-index: 2; }
.auth-feature { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,0.85); font-size: 14px; }
.auth-feature-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.auth-feature-icon svg { width: 18px; height: 18px; color: #60a5fa; }

.auth-form-panel {
  background: #fff; display: flex; flex-direction: column;
  justify-content: center; padding: 48px 52px; position: relative;
}
.auth-form-panel::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 4px; height: 100%;
  background: linear-gradient(to bottom, #1e88e5, #0d47a1);
}

.auth-form-header { margin-bottom: 36px; }
.auth-form-title { font-size: 26px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.auth-form-sub { font-size: 14px; color: var(--text-muted); line-height: 1.7; }

.auth-form { display: flex; flex-direction: column; gap: 20px; }

.form-field-group { display: flex; flex-direction: column; gap: 6px; }
.form-field-label { font-size: 13px; font-weight: 700; color: var(--text); }
.form-field-wrap { position: relative; display: flex; align-items: center; }
.form-field-icon {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-muted); pointer-events: none;
}
.form-field-icon svg { width: 18px; height: 18px; }
.form-input {
  width: 100%; padding: 13px 46px 13px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-size: 14px; color: var(--text); background: #f9fafb;
  transition: border-color .2s, box-shadow .2s, background .2s; outline: none;
}
.form-input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(30,136,229,0.1); }
.form-input::placeholder { color: #b0b7c3; }

.form-row-inline {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.form-checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted); cursor: pointer;
}
.form-checkbox-label input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer; }
.form-link { font-size: 13px; color: var(--primary); font-weight: 600; text-decoration: none; }
.form-link:hover { text-decoration: underline; }

.btn-auth {
  width: 100%; padding: 14px;
  background: linear-gradient(170deg, #1e88e5 0%, #0d47a1 100%);
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: opacity .2s, transform .15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-auth:hover { opacity: .92; transform: translateY(-1px); }
.btn-auth:active { transform: translateY(0); }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.social-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-social {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.btn-social:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.btn-social svg { width: 18px; height: 18px; flex-shrink: 0; }

.auth-footer-text { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.auth-footer-text a { color: var(--primary); font-weight: 700; text-decoration: none; }
.auth-footer-text a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 900px) {
  .auth-page, .auth-page--wide { grid-template-columns: 1fr; }
  .auth-hero { min-height: 280px; order: 0; padding: 32px; }
  .auth-hero::after { font-size: 100px; bottom: 20px; }
  .auth-hero-title { font-size: 26px; }
  .auth-hero-stats { gap: 16px; }
  .auth-form-panel { padding: 36px 24px; }
  .auth-form-panel::before { width: 100%; height: 4px; top: 0; right: 0; }
}
@media (max-width: 480px) {
  .auth-form-panel { padding: 28px 20px; }
  .social-btns { grid-template-columns: 1fr; }
}

/* OTP banner */
.otp-info-banner {
  display: flex; align-items: center; gap: 10px;
  background: rgba(124,58,237,.07); border: 1px solid rgba(124,58,237,.2);
  border-radius: 10px; padding: 12px 14px;
  font-size: .88rem; color: var(--primary, #7c3aed); margin-bottom: 20px;
}
.form-optional { font-size: .8rem; color: var(--text-muted, #9ca3af); font-weight: 400; }
.form-required { color: #ef4444; }

/* ── Phone Code Picker ─────────────────────────────────────── */
.phone-field-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  direction: ltr;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f9fafb;
  transition: border-color .2s, box-shadow .2s, background .2s;
  overflow: visible;
}
.phone-field-wrap:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(30,136,229,0.1);
}
.phone-field-wrap.is-invalid { border-color: #ef4444; }

.phone-code-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 0 10px;
  border: none;
  border-right: 1.5px solid var(--border);
  background: transparent; cursor: pointer;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-size: 13px; font-weight: 700; color: var(--text);
  white-space: nowrap; flex-shrink: 0;
  transition: background .15s;
}
.phone-code-btn:hover { background: rgba(0,0,0,0.03); }

.phone-code-flag { font-size: 19px; line-height: 1; }
.phone-code-dial { font-size: 13px; font-weight: 700; color: var(--text); }
.phone-code-chevron {
  width: 14px; height: 14px; color: var(--text-muted);
  transition: transform .2s; flex-shrink: 0;
}
.phone-code-btn[aria-expanded="true"] .phone-code-chevron { transform: rotate(180deg); }

.phone-code-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 300;
  width: 290px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  overflow: hidden;
}
.phone-code-dropdown[hidden] { display: none; }

.phone-code-search-wrap {
  position: relative;
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border);
}
.phone-code-search-icon {
  position: absolute;
  right: 20px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--text-muted);
  pointer-events: none;
}
.phone-code-search {
  width: 100%;
  padding: 8px 36px 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-size: 13px; color: var(--text); background: #f9fafb;
  outline: none; transition: border-color .2s;
  direction: rtl;
}
.phone-code-search:focus { border-color: var(--primary); background: #fff; }
.phone-code-search::placeholder { color: #b0b7c3; }

.phone-code-list {
  list-style: none; margin: 0; padding: 6px;
  max-height: 228px; overflow-y: auto;
}
.phone-code-list::-webkit-scrollbar { width: 5px; }
.phone-code-list::-webkit-scrollbar-track { background: transparent; }
.phone-code-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
.phone-code-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px; cursor: pointer;
  transition: background .13s;
  font-size: 13px; color: var(--text);
}
.phone-code-list li:hover { background: rgba(30,136,229,0.08); }
.phone-code-list li.pci-selected { background: rgba(30,136,229,0.12); }
.phone-code-list .pci-flag { font-size: 20px; flex-shrink: 0; line-height: 1; }
.phone-code-list .pci-name { flex: 1; font-weight: 500; }
.phone-code-list .pci-dial { color: var(--text-muted); font-size: 12px; font-weight: 700; direction: ltr; }
.phone-code-list .pci-empty { padding: 16px 10px; text-align: center; color: var(--text-muted); font-size: 13px; cursor: default; }
.phone-code-list .pci-empty:hover { background: transparent; }

.phone-field-wrap .form-input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  flex: 1; min-width: 0;
  padding: 13px 14px;
  border-radius: 0;
}
.phone-field-wrap .form-input:focus {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}
