/* Atlubni Auth — light + dark themes, mirrors landing page tokens */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

* { box-sizing: border-box; }
body { margin: 0; background: #0b1220; font-family: "IBM Plex Sans", system-ui, sans-serif; color: #cbd5e1; }
body[dir="rtl"] { font-family: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, sans-serif; }

.auth-screen {
  width: 100%;
  min-height: 100vh;
  font-family: inherit;
  display: flex; flex-direction: column;
  position: relative;
}
.auth-screen[data-theme="light"] {
  --bg: #f8fafc;
  --bg-elev: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --ink-4: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --field-bg: #ffffff;
  --field-bg-focus: #ffffff;
  --field-bg-solid: #ffffff;
  --grid: rgba(15,23,42,0.04);
  --hairline: rgba(15,23,42,0.08);
  background: var(--bg); color: var(--ink);
}
.auth-screen[data-theme="dark"] {
  --bg: #050912;
  --bg-elev: #0f172a;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);
  --ink: #f1f5f9;
  --ink-2: #cbd5e1;
  --ink-3: #94a3b8;
  --ink-4: #64748b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --field-bg: rgba(255,255,255,0.03);
  --field-bg-focus: rgba(255,255,255,0.06);
  --field-bg-solid: #161e30;
  --grid: rgba(255,255,255,0.025);
  --hairline: rgba(255,255,255,0.06);
  background: var(--bg); color: var(--ink);
}

/* ============ LAYOUT VARIANTS ============ */

/* Split: left = brand/illustration, right = form */
.auth-screen[data-layout="split"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
}
.auth-screen[data-layout="split"] .a-aside {
  position: relative;
  background:
    radial-gradient(circle at 75% 25%, rgba(59,130,246,0.18), transparent 55%),
    radial-gradient(circle at 25% 80%, rgba(16,185,129,0.12), transparent 50%),
    var(--bg-elev);
  border-right: 1px solid var(--border);
  padding: 40px;
  display: flex; flex-direction: column;
}
.auth-screen[data-layout="split"][data-theme="light"] .a-aside {
  background:
    radial-gradient(circle at 75% 25%, rgba(37,99,235,0.10), transparent 55%),
    radial-gradient(circle at 25% 80%, rgba(16,185,129,0.06), transparent 50%),
    #ffffff;
}
.auth-screen[data-layout="split"] .a-stage {
  padding: 56px 64px;
  display: flex; flex-direction: column; justify-content: center;
  background: var(--bg);
}

/* Centered: form floats on tiled-grid bg */
.auth-screen[data-layout="centered"] {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    var(--bg);
  background-size: 32px 32px, 32px 32px;
}
.auth-screen[data-layout="centered"] .a-card {
  width: 440px;
  max-width: calc(100% - 48px);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 36px 32px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 24px 60px -20px rgba(0,0,0,0.5);
}
.auth-screen[data-theme="light"][data-layout="centered"] .a-card {
  box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 12px 32px -8px rgba(15,23,42,0.08);
}

/* Minimal: bare form on bg */
.auth-screen[data-layout="minimal"] {
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
}
.auth-screen[data-layout="minimal"] .a-card {
  width: 380px; max-width: calc(100% - 48px);
  background: transparent;
  padding: 0;
}

/* ============ BRAND ASIDE ============ */
.a-aside-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; color: var(--ink); font-size: 16px; letter-spacing: -0.01em;
  text-decoration: none;
}
.a-aside-headline {
  margin-top: auto;
  font-size: 32px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em;
  color: var(--ink); margin-bottom: 16px;
  max-width: 420px;
}
.a-aside-sub { font-size: 15px; color: var(--ink-3); line-height: 1.6; max-width: 420px; }
.a-aside-quote {
  margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--hairline);
  font-size: 14px; color: var(--ink-2); line-height: 1.6;
  max-width: 420px;
}
.a-aside-quote .who {
  display: flex; gap: 10px; align-items: center; margin-top: 12px;
  font-size: 13px; color: var(--ink-3);
}
.a-aside-quote .who .av {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  font-weight: 600; color: white; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}

/* Decorative coverage chips at top of aside */
.a-aside-chips {
  display: flex; gap: 6px; margin-bottom: 24px; flex-wrap: wrap;
}
.a-aside-chips span {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: rgba(59,130,246,0.14); color: var(--accent);
  border: 1px solid rgba(59,130,246,0.24);
}

/* Mini map ornament — real Leaflet with Natural Earth country shapes */
.a-map {
  margin: 24px 0;
  flex: 1 1 auto; min-height: 280px;
  border-radius: 14px;
  border: 1px solid var(--border);
  position: relative; overflow: hidden;
  background: #07101e;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.02),
    0 8px 24px -12px rgba(0,0,0,0.6);
}
.a-map .leaflet-container { background: #07101e; height: 100%; width: 100%; outline: none; }
.a-map .leaflet-control-attribution,
.a-map .leaflet-control-zoom { display: none !important; }
.a-map .leaflet-tile-pane { filter: saturate(0.5) brightness(0.7) contrast(0.95); }
.a-map .leaflet-overlay-pane svg { overflow: visible; }
.a-map .leaflet-overlay-pane path {
  filter: drop-shadow(0 0 8px rgba(59,130,246,0.35));
}

.a-map::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 60%, rgba(7,16,30,0.45));
  z-index: 5;
}

.a-map .pin {
  width: 11px; height: 11px; border-radius: 50%;
  background: #60a5fa; border: 2px solid #ffffff;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.25), 0 0 10px rgba(96,165,250,0.7);
}
.a-map .pin-pulse::after {
  content: ""; position: absolute; inset: -5px;
  border-radius: 50%; border: 1.5px solid rgba(96,165,250,0.6);
  animation: a-pulse 2.4s ease-out infinite;
}
@keyframes a-pulse {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

.a-map-overlay {
  position: absolute; left: 12px; bottom: 12px; z-index: 10;
  background: rgba(7,16,30,0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 5px 12px 5px 10px;
  font-size: 11px; color: var(--ink-2);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.02em;
  display: flex; align-items: center;
}
.a-map-overlay-row { display: flex; align-items: center; gap: 8px; }
.a-map-overlay .dot {
  width: 6px; height: 6px; border-radius: 50%; background: #10b981;
  box-shadow: 0 0 8px rgba(16,185,129,0.8);
  animation: a-blink 2s ease-in-out infinite;
}
@keyframes a-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============ FORM ============ */
.a-stage-inner { width: 100%; max-width: 380px; margin: 0 auto; }
.a-screen-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; color: var(--ink); font-size: 16px; letter-spacing: -0.01em;
  text-decoration: none;
  margin-bottom: 32px;
}
.a-card .a-screen-logo { margin-bottom: 24px; }
.a-eyebrow {
  font-family: "JetBrains Mono", monospace; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); margin-bottom: 10px;
}
.a-h1 {
  font-size: 26px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--ink); margin: 0 0 8px; line-height: 1.2;
}
.a-sub { font-size: 15px; color: var(--ink-3); line-height: 1.55; margin: 0 0 24px; }
.a-sub a { color: var(--accent); text-decoration: none; font-weight: 500; }
.a-sub a:hover { text-decoration: underline; }

.a-field { margin-bottom: 14px; }
.a-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500;
}
.a-label a { color: var(--accent); font-size: 12px; text-decoration: none; }
.a-label a:hover { text-decoration: underline; }
.a-input {
  width: 100%; padding: 11px 14px; font-size: 15px;
  background: var(--field-bg); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: 8px;
  font-family: inherit; outline: none;
  transition: border-color 120ms, background 120ms, box-shadow 120ms;
}
.a-input:focus {
  border-color: var(--accent); background: var(--field-bg-focus);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}
/* Keep browser autofill on-theme — WebKit otherwise forces a light fill */
.a-input:-webkit-autofill,
.a-input:-webkit-autofill:hover,
.a-input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--field-bg-solid) inset;
  box-shadow: 0 0 0 1000px var(--field-bg-solid) inset;
  transition: background-color 9999s ease-out 0s;
}
.a-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--field-bg-solid) inset, 0 0 0 3px rgba(59,130,246,0.18);
  box-shadow: 0 0 0 1000px var(--field-bg-solid) inset, 0 0 0 3px rgba(59,130,246,0.18);
}
.a-input::placeholder { color: var(--ink-4); }
.a-input.has-icon { padding-left: 40px; }
body[dir="rtl"] .a-input.has-icon { padding-left: 14px; padding-right: 40px; }
.a-input-wrap { position: relative; }
.a-input-wrap .icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--ink-4); pointer-events: none;
}
body[dir="rtl"] .a-input-wrap .icon { left: auto; right: 13px; }
.a-input-wrap .toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); cursor: pointer; padding: 4px; border-radius: 4px;
  background: none; border: none;
}
body[dir="rtl"] .a-input-wrap .toggle { right: auto; left: 10px; }
.a-input-wrap .toggle:hover { color: var(--ink-2); background: var(--hairline); }

/* Strength meter */
.a-strength { margin-top: 8px; }
.a-strength-bars { display: flex; gap: 4px; height: 4px; margin-bottom: 6px; }
.a-strength-bars span {
  flex: 1; background: var(--hairline); border-radius: 2px; transition: background 200ms;
}
.a-strength-bars span.on-1 { background: var(--danger); }
.a-strength-bars span.on-2 { background: var(--warn); }
.a-strength-bars span.on-3 { background: #84cc16; }
.a-strength-bars span.on-4 { background: var(--success); }
.a-strength-label { font-size: 12px; color: var(--ink-3); }

/* Inline checks */
.a-checks { display: grid; gap: 4px; margin-top: 10px; font-size: 12px; }
.a-checks div { display: flex; gap: 8px; align-items: center; color: var(--ink-3); }
.a-checks div.ok { color: var(--success); }

.a-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; }
.a-checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.a-checkbox input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

.a-btn {
  width: 100%; padding: 12px 18px; font-size: 15px; font-weight: 600;
  background: var(--accent); color: white;
  border: none; border-radius: 8px; cursor: pointer;
  font-family: inherit; letter-spacing: -0.005em;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 120ms, transform 120ms;
}
.a-btn:hover { background: var(--accent-hover); }
.a-btn.secondary {
  background: var(--field-bg); color: var(--ink);
  border: 1px solid var(--border-strong);
}
.a-btn.secondary:hover { background: var(--field-bg-focus); }
.a-btn.danger { background: var(--danger); }
.a-btn.success { background: var(--success); }

.a-divider {
  display: flex; align-items: center; gap: 14px; margin: 22px 0;
  color: var(--ink-4); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.06em;
  font-family: "JetBrains Mono", monospace;
}
.a-divider::before, .a-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

.a-bottom {
  text-align: center; margin-top: 22px; font-size: 14px; color: var(--ink-3);
}
.a-bottom a { color: var(--accent); text-decoration: none; font-weight: 500; }
.a-bottom a:hover { text-decoration: underline; }

.a-legal {
  margin-top: 18px; font-size: 11px; color: var(--ink-4); text-align: center; line-height: 1.6;
}
.a-legal a { color: var(--ink-3); text-decoration: underline; text-underline-offset: 2px; }

/* Top-right region pill (real product chrome detail) */
.a-corner {
  position: absolute; top: 24px; right: 24px;
  display: flex; gap: 8px; z-index: 2;
}
body[dir="rtl"] .a-corner { right: auto; left: 24px; }
.a-corner button {
  background: var(--field-bg); color: var(--ink-2);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 12px; font-size: 12px; font-family: inherit; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.a-corner button:hover { background: var(--field-bg-focus); }

/* ============ 2FA CODE ============ */
.a-code-row {
  display: flex; gap: 10px; justify-content: center; margin: 8px 0 18px;
}
.a-code-row input {
  width: 48px; height: 56px; text-align: center;
  font-size: 22px; font-weight: 600; font-family: "JetBrains Mono", monospace;
  background: var(--field-bg); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: 10px;
  outline: none;
}
.a-code-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.18); }

/* ============ EMAIL SENT / CHECK INBOX ============ */
.a-illus {
  width: 88px; height: 88px; border-radius: 24px;
  background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(16,185,129,0.18));
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); margin: 0 auto 22px;
}
.a-illus.success {
  background: linear-gradient(135deg, rgba(16,185,129,0.22), rgba(16,185,129,0.08));
  color: var(--success);
}
.a-illus.danger {
  background: linear-gradient(135deg, rgba(239,68,68,0.22), rgba(239,68,68,0.08));
  color: var(--danger);
}
.a-illus.warn {
  background: linear-gradient(135deg, rgba(245,158,11,0.22), rgba(245,158,11,0.08));
  color: var(--warn);
}

.a-inbox-card {
  background: var(--field-bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; margin: 16px 0;
  font-size: 13px; color: var(--ink-2); line-height: 1.6; text-align: left;
}
body[dir="rtl"] .a-inbox-card { text-align: right; }
.a-inbox-card strong { color: var(--ink); display: block; margin-bottom: 4px; }
.a-inbox-card .from { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--ink-3); }

.a-resend-row {
  display: flex; gap: 16px; justify-content: center; align-items: center;
  font-size: 13px; color: var(--ink-3); margin-top: 14px;
}
.a-resend-row a { color: var(--accent); text-decoration: none; font-weight: 500; }

.a-text-center { text-align: center; }

/* ============ GOOGLE BUTTON (real GSI vibe) ============ */
.gsi-btn {
  width: 100%; padding: 11px 16px; font-size: 15px; font-weight: 500;
  background: white; color: #1f1f1f;
  border: 1px solid #dadce0; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-family: "Roboto", "Google Sans", inherit;
  transition: background 120ms, box-shadow 120ms;
  text-decoration: none;
}
.gsi-btn:hover { background: #f8f9fa; box-shadow: 0 1px 2px rgba(60,64,67,0.3); }
.auth-screen[data-theme="dark"] .gsi-btn {
  background: #131314; color: #e3e3e3; border-color: #8e918f;
}
.auth-screen[data-theme="dark"] .gsi-btn:hover { background: #1e1f20; }

/* Section intro card on canvas */
.intro-card {
  padding: 28px 32px; color: #cbd5e1;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  background: #0b1220; height: 100%;
}
.intro-card .eyebrow {
  font-family: "JetBrains Mono", monospace; font-size: 11px;
  color: #60a5fa; text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.intro-card h1 {
  font-size: 30px; color: #f1f5f9; margin: 0 0 12px; letter-spacing: -0.02em; line-height: 1.2;
}
.intro-card p {
  font-size: 15px; color: #94a3b8; line-height: 1.6; max-width: 660px; margin: 0 0 22px;
}
.intro-card .stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.intro-card .stats > div {
  padding: 14px 16px; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; background: rgba(255,255,255,0.02);
}
.intro-card .stats .num {
  font-size: 22px; color: #f1f5f9; font-weight: 700;
  font-family: "JetBrains Mono", monospace;
}
.intro-card .stats .lbl { font-size: 12px; color: #94a3b8; margin-top: 2px; }

/* error/success banners */
.a-banner {
  padding: 10px 14px; border-radius: 8px; font-size: 13px;
  margin-bottom: 14px; line-height: 1.5;
  display: flex; gap: 10px; align-items: flex-start;
}
.a-banner.danger {
  background: rgba(239,68,68,0.10); border: 1px solid rgba(239,68,68,0.3);
  color: var(--ink-2);
}
.a-banner.success {
  background: rgba(16,185,129,0.10); border: 1px solid rgba(16,185,129,0.3);
  color: var(--ink-2);
}
.a-banner.info {
  background: rgba(59,130,246,0.10); border: 1px solid rgba(59,130,246,0.3);
  color: var(--ink-2);
}
.a-banner svg { flex-shrink: 0; margin-top: 1px; }
