/*
 * MapLeads auth pages (/login, /signup, /forgot-password, /reset-password).
 * Page-specific layer on top of xnext.css: split layout with a dark brand
 * panel on wide screens, single form card on phones. Logical properties only.
 */
[hidden] { display: none !important; }

body.auth { min-height: 100vh; background: var(--bg); }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* ------------------------------------------------------------ brand panel */
.auth-aside {
  display: none;
  position: relative;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 44px clamp(32px, 4vw, 64px);
  color: #fff;
  background:
    radial-gradient(900px 480px at 80% -10%, rgba(124, 58, 237, .32), transparent 60%),
    radial-gradient(760px 460px at 0% 110%, rgba(37, 99, 235, .26), transparent 55%),
    var(--navy);
}
.auth-aside::after {
  /* faint dotted grid, evokes a map */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
  pointer-events: none;
}
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside .brand-name { color: #fff; }
.auth-aside .brand-name b { background: linear-gradient(90deg, #A78BFA, #60A5FA); -webkit-background-clip: text; background-clip: text; }

.aside-body { max-width: 480px; }
.aside-title {
  margin: 22px 0 0;
  font-size: clamp(1.8rem, 2.6vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.01em;
}
[dir="rtl"] .aside-title { letter-spacing: 0; line-height: 1.4; }
.aside-lead { margin: 18px 0 0; font-size: 1.05rem; color: #B6C2D9; }
.aside-list { list-style: none; margin: 34px 0 0; padding: 0; display: grid; gap: 16px; }
.aside-list li { display: flex; align-items: center; gap: 14px; color: #E2E8F0; }
.aside-ico {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #C4B5FD;
}
.aside-foot { margin: 0; font-size: .85rem; color: #94A3B8; }

/* ------------------------------------------------------------ form column */
.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 20px 16px 32px;
}
.auth-top {
  width: 100%;
  max-width: 440px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-block-end: 24px;
}
.auth-center {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.auth-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 440px;
  padding: 34px 30px 28px;
}
.auth-card::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-start: 0;
  height: 4px;
  background: var(--grad);
}

@media (min-width: 960px) {
  .auth-shell { grid-template-columns: minmax(380px, 5fr) 7fr; }
  .auth-aside { display: flex; }
  .auth-main { padding: 28px 32px 40px; }
  .auth-top { max-width: none; justify-content: flex-end; }
  .auth-top .brand { display: none; }
}
@media (max-width: 420px) {
  .auth-card { padding: 28px 18px 22px; }
}

/* ---------------------------------------------------------------- heading */
.auth-head { margin-block-end: 22px; }
.auth-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-cta);
  margin-block-end: 16px;
}
.auth-card h1 { margin: 0; font-size: 1.5rem; line-height: 1.25; font-weight: 800; color: var(--ink); }
.auth-card h1:focus { outline: none; }
.auth-sub { margin: 8px 0 0; color: var(--text-2); font-size: .95rem; }
.auth-loading { color: var(--text-3); margin: 8px 0 16px; }

/* ---------------------------------------------------------------- messages */
.auth-msg:empty { display: none; }
.auth-msg:focus { outline: none; }
.auth-msg .alert-x p { margin: 0; }
.auth-msg .alert-x p + p { margin-block-start: 8px; }
.alert-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.alert-x a { color: inherit; font-weight: 700; }

/* ------------------------------------------------------------------ fields */
.field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.field-link { font-size: .85rem; font-weight: 600; text-decoration: none; }
.field-link:hover { text-decoration: underline; }
.field label .opt { font-weight: 400; color: var(--text-3); }
.field-hint { margin: 0; font-size: .82rem; color: var(--text-3); }
.input-x[aria-invalid="true"] { border-color: var(--danger); }
/* E-mail and passwords stay left-to-right in Arabic, aligned to the reading side */
[dir="rtl"] .input-x[type="email"],
[dir="rtl"] .input-x[type="password"],
[dir="rtl"] .pw-wrap .input-x { direction: ltr; text-align: end; }

.pw-wrap { position: relative; }
.pw-wrap .input-x { padding-inline-end: 50px; }
[dir="rtl"] .pw-wrap .input-x { padding-inline-end: 14px; padding-inline-start: 50px; }
.pw-toggle {
  position: absolute;
  inset-block: 2px;
  inset-inline-end: 2px;
  width: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-3); cursor: pointer;
}
.pw-toggle:hover { color: var(--vio); }
.pw-toggle .ico-eye-off { display: none; }
.pw-toggle[aria-pressed="true"] .ico-eye { display: none; }
.pw-toggle[aria-pressed="true"] .ico-eye-off { display: block; }

.pw-meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.pw-meter span { height: 4px; border-radius: 4px; background: var(--line); transition: background .2s ease; }
.pw-meter[data-level="0"] span:nth-child(1) { background: var(--danger); }
.pw-meter[data-level="1"] span:nth-child(-n+1) { background: var(--warn); }
.pw-meter[data-level="2"] span:nth-child(-n+2) { background: var(--blu); }
.pw-meter[data-level="3"] span { background: var(--ok); }
.pw-meter[data-level="-1"] { display: none; }

/* --------------------------------------------------------------- extras */
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-3); font-size: .85rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.resend-box {
  margin-block-start: 18px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.resend-intro { margin: 0 0 12px; font-size: .92rem; font-weight: 600; color: var(--text-2); }

.plan-note {
  margin-block-end: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--vio-soft);
  border: 1px solid rgba(124, 58, 237, .2);
}
.plan-name { margin: 0; font-weight: 700; color: var(--vio); }
.plan-price { font-weight: 600; color: var(--text-2); white-space: nowrap; }
.plan-text { margin: 6px 0 0; font-size: .85rem; color: var(--text-2); }

.fine-print { margin: 12px 0 0; font-size: .82rem; color: var(--text-3); text-align: center; }

.auth-alt { margin: 22px 0 0; text-align: center; font-size: .92rem; color: var(--text-2); }
.auth-alt a { font-weight: 600; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }

.auth-done { text-align: center; }
.auth-done p { overflow-wrap: anywhere; }
.done-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 68px; height: 68px;
  border-radius: 50%;
  background: var(--vio-soft);
  color: var(--vio);
  margin-block-end: 16px;
}
.auth-done .btn-x { margin-block-start: 18px; }
