/* Signalchi CRM v5 — Unified Admin & Customer Authentication Stylesheet (v5-6)
   Matches Obsidian Dark & Porcelain Light v5 design system.
   Cross-OS optimized: Windows, macOS, Linux, iOS Safari (100dvh, 16px inputs, safe-area), Android Chrome. */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body.al {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  overflow-x: hidden;
  padding:
    max(22px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(22px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.al-switching, html.al-switching * {
  transition: background-color 260ms var(--ease), border-color 260ms var(--ease), color 260ms var(--ease), box-shadow 260ms var(--ease) !important;
}

a { color: var(--primary-text); text-decoration: none; transition: color var(--t-fast), background-color var(--t-fast); }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
:where(.al-card svg, .security-content svg) { width: 18px; height: 18px; flex: none; }

/* ================= AMBIENT BACKGROUND ================= */
.al-sky {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.al-sky .b1, .al-sky .b2, .al-sky .b3 {
  position: absolute; border-radius: 50%; filter: blur(95px); opacity: 0.42;
}
[data-theme="light"] .al-sky .b1,
[data-theme="light"] .al-sky .b2,
[data-theme="light"] .al-sky .b3 { opacity: 0.24; }
.al-sky .b1 { width: 520px; height: 520px; top: -180px; right: -120px; background: radial-gradient(circle, var(--primary) 0%, transparent 72%); }
.al-sky .b2 { width: 460px; height: 460px; bottom: -170px; left: -110px; background: radial-gradient(circle, #0EA5E9 0%, transparent 72%); }
.al-sky .b3 { width: 340px; height: 340px; top: 45%; left: 38%; background: radial-gradient(circle, #10B981 0%, transparent 74%); opacity: 0.22; }
body[data-shell="customer-auth"] .al-sky .b1 { background: radial-gradient(circle, #10B981 0%, transparent 72%); }
body[data-shell="customer-auth"] .al-sky .b2 { background: radial-gradient(circle, var(--primary) 0%, transparent 72%); }

.al-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to left, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 35%, transparent 100%);
  opacity: 0.55;
}

/* ================= FLOATING THEME TOGGLE ================= */
.al-theme {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  z-index: 20;
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-glass);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast), border-color var(--t-fast), color var(--t-fast), background-color var(--t-fast);
}
.al-theme:hover { color: var(--text); border-color: var(--primary); background: var(--surface); transform: translateY(-1px); }
.al-theme:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--ring); }
.al-theme svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme="dark"] .al-theme .moon,
html[data-theme="light"] .al-theme .sun { display: none; }

/* ================= MAIN SPLIT LAYOUT ================= */
.al-wrap {
  position: relative; z-index: 2;
  width: 100%; max-width: 1040px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 444px);
  gap: 36px;
  align-items: center;
  margin: auto 0;
}

/* ================= SHOWCASE SIDE PANEL (DESKTOP) ================= */
.al-show {
  display: flex; flex-direction: column; gap: 20px;
  padding: 10px 6px;
}
.al-brand {
  display: inline-flex; align-items: center; gap: 12px; text-decoration: none !important;
}
.al-mark {
  width: 44px; height: 44px; border-radius: 13px;
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 55%, #0EA5E9 100%);
  color: #fff; display: grid; place-items: center;
  font-size: 20px; font-weight: 900;
  box-shadow: 0 10px 24px rgba(59, 91, 255, 0.30);
  flex: none;
}
.al-mark svg { width: 22px; height: 22px; }
body[data-shell="customer-auth"] .al-mark {
  background: linear-gradient(135deg, #059669 0%, #0EA5E9 58%, var(--primary) 100%);
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.28);
}
.al-brand b { display: block; font-size: 18px; font-weight: 850; color: var(--text); letter-spacing: -0.02em; line-height: 1.2; }
.al-brand small { display: block; font-size: 12px; color: var(--text-3); font-weight: 500; margin-top: 2px; }

.al-pitch {
  margin: 0; font-size: 31px; font-weight: 850; line-height: 1.38; letter-spacing: -0.025em; color: var(--text);
}
.al-pitch em {
  font-style: normal;
  background: linear-gradient(135deg, var(--primary-text) 0%, #38BDF8 55%, var(--emerald-text) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.al-sub {
  margin: -8px 0 0; font-size: 14px; color: var(--text-2); max-width: 46ch; line-height: 1.75;
}

/* Showcase Mini Glass Cards */
.al-stage { display: flex; flex-direction: column; gap: 11px; margin-top: 2px; }
.al-float {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 16px; border-radius: var(--r-lg);
  background: var(--surface-glass);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base), border-color var(--t-base);
}
.al-float:hover { transform: translateX(-4px); border-color: var(--primary); }
.al-float b { display: block; font-size: 13.5px; font-weight: 800; color: var(--text); }
.al-float small { display: block; font-size: 12px; color: var(--text-3); margin-top: 1px; }

.al-ico {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; flex: none;
  background: var(--primary-soft); color: var(--primary-text);
}
.al-ico.em { background: var(--emerald-soft); color: var(--emerald-text); }
.al-ico.gold { background: var(--gold-soft); color: var(--gold); }
.al-ico.sky { background: var(--sky-soft); color: var(--sky-text); }
.al-ico svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.al-chip {
  margin-right: auto; padding: 3px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 750;
  background: var(--emerald-soft); color: var(--emerald-text);
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.al-chip::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  animation: alPulse 2s infinite;
}
.al-chip.primary { background: var(--primary-soft); color: var(--primary-text); }
@keyframes alPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(1.25); } }

/* 4-Stage Pipeline Strip on Showcase */
.al-status-strip { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 5px; }
.al-st-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700;
}
.al-st-pill i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.al-st-pill.lead { background: var(--st-lead-soft); color: var(--st-lead-text); border: 1px solid var(--st-lead-border); }
.al-st-pill.lead i { background: var(--st-lead); }
.al-st-pill.possible { background: var(--st-possible-soft); color: var(--st-possible-text); border: 1px solid var(--st-possible-border); }
.al-st-pill.possible i { background: var(--st-possible); }
.al-st-pill.potential { background: var(--st-potential-soft); color: var(--st-potential-text); border: 1px solid var(--st-potential-border); }
.al-st-pill.potential i { background: var(--st-potential); }
.al-st-pill.customer { background: var(--st-customer-bg); color: var(--st-customer-text); border: 1px solid var(--st-customer-border); }
.al-st-pill.customer i { background: var(--st-customer-dot); }

/* ================= AUTH CARD ================= */
.al-card {
  position: relative;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  padding: 24px 24px 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.al-card::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), rgba(59, 91, 255, 0.08), transparent 65%);
  opacity: 0; transition: opacity 280ms var(--ease);
}
.al-card:hover::before { opacity: 1; }
body[data-shell="customer-auth"] .al-card::before {
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), rgba(16, 185, 129, 0.09), transparent 65%);
}
.al-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), #38BDF8, var(--emerald));
}

.al-brand-sm {
  display: none; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 16px; text-decoration: none !important;
}
.al-brand-sm .al-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 17px; }
.al-brand-sm b { font-size: 17px; font-weight: 850; color: var(--text); }

.al-head { margin-bottom: 16px; text-align: right; position: relative; z-index: 1; }
.al-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 99px; font-size: 11px; font-weight: 750;
  background: var(--primary-soft); color: var(--primary-text); margin-bottom: 9px;
}
body[data-shell="customer-auth"] .al-badge { background: var(--emerald-soft); color: var(--emerald-text); }
.al-head h1 {
  margin: 0; font-size: 20px; font-weight: 850; letter-spacing: -0.02em; color: var(--text); line-height: 1.35;
}
.al-head p { margin: 4px 0 0; font-size: 13px; color: var(--text-3); line-height: 1.6; }

.al-body { position: relative; z-index: 1; }
.al-body h2#auth-heading {
  margin: 0 0 6px; font-size: 16.5px; font-weight: 800; color: var(--text); line-height: 1.4;
}
.al-body p.text-sm {
  margin: 0 0 14px; font-size: 13px; color: var(--text-3); line-height: 1.65;
}

/* ================= AUTH METHOD TABS & SECURITY NAV ================= */
.al-body nav[aria-label] {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  margin: 0 0 16px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
}
.al-body nav.auth-security-nav {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.al-body nav[aria-label] a {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 7px 11px; border-radius: 9px;
  font-size: 12.5px; font-weight: 700; color: var(--text-3);
  text-decoration: none !important;
  transition: all var(--t-fast);
}
.al-body nav[aria-label] a:hover { color: var(--text); background: var(--surface-hover); }
.al-body nav[aria-label] a[aria-current="page"] {
  background: var(--surface); color: var(--primary-text);
  box-shadow: var(--shadow-xs); border: 1px solid var(--border);
}
body[data-shell="customer-auth"] .al-body nav[aria-label] a[aria-current="page"] {
  color: var(--emerald-text);
}

/* ================= ALERTS & MESSAGES ================= */
.al-body [role="alert"],
.al-body [role="status"]:not([data-auth-captcha-status]):not([data-auth-result]),
.al-body .bg-rose-500\/10 {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 13px; border-radius: 12px;
  margin: 0 0 14px; font-size: 12.5px; font-weight: 600; line-height: 1.65;
  text-align: right;
  background: var(--rose-soft); color: var(--rose-text);
  border: 1px solid rgba(225, 29, 72, 0.24);
}
.al-body [role="alert"] .al-i,
.al-body [role="status"] .al-i { margin-top: 2px; }
.al-body .auth-alert-success {
  background: var(--emerald-soft) !important; color: var(--emerald-text) !important;
  border-color: rgba(16, 185, 129, 0.30) !important;
}
.al-body .auth-alert-info {
  background: var(--primary-soft) !important; color: var(--primary-text) !important;
  border-color: rgba(59, 91, 255, 0.28) !important;
}
.al-body .auth-alert-warning {
  background: var(--amber-soft) !important; color: var(--amber-text) !important;
  border-color: rgba(245, 158, 11, 0.30) !important;
}
.al-body .text-amber-500 {
  font-size: 11.5px; font-weight: 650; color: var(--amber-text); margin-top: 2px;
}

/* ================= FORM CONTROLS (ALL INPUTS WITH OR WITHOUT type="text") ================= */
.al-body form { display: flex; flex-direction: column; gap: 13px; width: 100%; }
.al-body form + form { margin-top: 10px; }
.al-body .form-group,
.al-body form > div.space-y-2,
.al-body form > .space-y-2,
.al-body .auth-enrollment .space-y-2 {
  display: flex; flex-direction: column; gap: 6px; margin: 0; text-align: right; width: 100%;
}
.al-body label {
  display: block; font-size: 12.5px; font-weight: 750; color: var(--text-2); margin: 0;
}
.al-body .customer-auth-help,
.al-body p.text-xs {
  margin: 3px 0 0; font-size: 11.5px; color: var(--text-3); line-height: 1.55;
}

.al-body .relative.flex,
.al-body .field-control {
  position: relative; display: flex; align-items: center; width: 100%;
}
.al-body .relative.flex > .al-i:first-child {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-3); pointer-events: none; z-index: 2;
  transition: color var(--t-fast);
}
.al-body .relative.flex:focus-within > .al-i:first-child { color: var(--primary-text); }
body[data-shell="customer-auth"] .al-body .relative.flex:focus-within > .al-i:first-child { color: var(--emerald-text); }

.al-body input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.al-body select {
  display: block;
  width: 100% !important;
  max-width: 100%;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 46px;
  height: 46px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-strong);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
  outline: none;
  appearance: none; -webkit-appearance: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background-color var(--t-fast);
}
.al-body select {
  padding-left: 38px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 16px 16px;
}

.al-body .relative.flex > input:not([type="hidden"]) {
  padding-right: 44px;
  padding-left: 16px;
}
.al-body .relative.flex:has(.auth-eye) > input,
.al-body .field-control:has(.auth-eye) > input {
  padding-left: 50px;
}

.al-body input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):hover,
.al-body select:hover { border-color: var(--text-3); }

.al-body input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):focus,
.al-body select:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3.5px var(--ring);
}
body[data-shell="customer-auth"] .al-body input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):focus,
body[data-shell="customer-auth"] .al-body select:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3.5px rgba(16, 185, 129, 0.22);
}

/* Prevent Chrome/Edge pale-blue autofill box clash in Dark & Light themes */
.al-body input:-webkit-autofill,
.al-body input:-webkit-autofill:hover {
  -webkit-box-shadow: 0 0 0 100px var(--surface-2) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
  transition: background-color 5000s ease-in-out 0s;
}
.al-body input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 100px var(--surface) inset, 0 0 0 3.5px var(--ring) !important;
  -webkit-text-fill-color: var(--text) !important;
}

.al-body input::placeholder { color: var(--text-muted); font-size: 13px; text-align: right; letter-spacing: normal; font-family: var(--font-sans); font-weight: 400; }
.al-body input#auth-code,
.al-body input#reauth-code {
  font-family: var(--font-mono);
  font-size: 20px; font-weight: 800; letter-spacing: 0.34em; text-align: center !important;
}
.al-body input#setup-secret {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 700; text-align: center !important;
}

/* Password Eye Toggle Button */
.al-body .auth-eye {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 9px; padding: 0;
  background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--text-2); display: grid; place-items: center;
  cursor: pointer; transition: all var(--t-fast); z-index: 3;
  box-shadow: var(--shadow-xs);
}
.al-body .auth-eye:hover { background: var(--surface-hover); color: var(--text); border-color: var(--primary); }
.al-body .auth-eye[aria-pressed="true"] {
  background: var(--primary-soft); color: var(--primary-text); border-color: var(--primary);
}
.al-body .auth-eye:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--ring); }

/* Inline SVG icons inside forms */
.al-i {
  width: 17px; height: 17px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ================= CAPTCHA BOX ================= */
.al-body [data-auth-captcha] {
  display: flex; flex-direction: column; gap: 9px;
  padding: 12px 13px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  width: 100%;
}
.al-body [data-auth-captcha] > .auth-captcha-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 8px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--border);
}
.al-body [data-auth-captcha] img {
  height: 46px; width: auto; max-width: calc(100% - 50px);
  border-radius: 8px; background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  object-fit: contain; display: block;
}
.al-body [data-auth-captcha-refresh] {
  width: 38px; height: 38px; border-radius: 10px; flex: none; padding: 0;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  color: var(--text-2); display: grid; place-items: center;
  cursor: pointer; transition: all var(--t-fast);
}
.al-body [data-auth-captcha-refresh] .al-i { transition: transform 260ms var(--ease); }
.al-body [data-auth-captcha-refresh]:hover {
  border-color: var(--primary); color: var(--primary-text); background: var(--primary-soft);
}
.al-body [data-auth-captcha-refresh]:hover .al-i { transform: rotate(-45deg); }
.al-body [data-auth-captcha-refresh]:active .al-i { transform: rotate(-160deg); }
.al-body [data-auth-captcha-refresh]:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--ring); }
.al-body [data-auth-captcha-refresh]:disabled { opacity: 0.5; cursor: wait; }
.al-body [data-auth-captcha] input[name="captcha_answer"] {
  background: var(--surface); font-family: var(--font-mono);
  font-size: 16px; font-weight: 750; letter-spacing: 0.24em; text-align: center !important;
}
.al-body [data-auth-captcha-status]:empty { display: none; }

/* ================= PRIMARY, SECONDARY & DANGER BUTTONS ================= */
.al-body .auth-primary {
  width: 100%; min-height: 46px; height: 46px; padding: 0 20px;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, var(--primary) 0%, #4F46E5 100%);
  color: #fff !important; font-size: 14.5px; font-weight: 800; letter-spacing: -0.01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(59, 91, 255, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.20);
  transition: transform var(--t-fast), box-shadow var(--t-fast), filter var(--t-fast);
}
body[data-shell="customer-auth"] .al-body .auth-primary {
  background: linear-gradient(135deg, #059669 0%, #0EA5E9 100%);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.20);
}
.al-body .auth-primary .al-i { width: 18px; height: 18px; stroke-width: 2.1; }
.al-body .auth-primary:hover {
  transform: translateY(-1px); filter: brightness(1.05);
  box-shadow: 0 12px 26px rgba(59, 91, 255, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
body[data-shell="customer-auth"] .al-body .auth-primary:hover {
  box-shadow: 0 12px 26px rgba(16, 185, 129, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
.al-body .auth-primary:active { transform: translateY(0); filter: brightness(0.98); }
.al-body .auth-primary:focus-visible { outline: 0; box-shadow: 0 0 0 3.5px var(--ring); }
.al-body .auth-primary.busy,
.al-body .auth-primary[aria-disabled="true"] { opacity: 0.72; cursor: wait; pointer-events: none; }
.al-body .auth-primary.busy::after {
  content: ''; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: alSpin 650ms linear infinite;
}
@keyframes alSpin { to { transform: rotate(360deg); } }

.al-body .auth-secondary,
.al-body button.bg-slate-100:not(.auth-eye):not([data-auth-captcha-refresh]),
.al-body [data-auth-resend] button[type="submit"],
.al-body [data-auth-countdown] {
  width: 100%; min-height: 40px; padding: 8px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  color: var(--text-2); font-size: 12.5px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all var(--t-fast);
}
.al-body .auth-secondary:hover,
.al-body button.bg-slate-100:not(.auth-eye):not([data-auth-captcha-refresh]):hover,
.al-body [data-auth-resend] button[type="submit"]:hover,
.al-body [data-auth-countdown]:hover {
  background: var(--surface-hover); color: var(--text); border-color: var(--primary);
}
.al-body .auth-secondary:disabled,
.al-body button.bg-slate-100:disabled,
.al-body [data-auth-resend] button[type="submit"]:disabled,
.al-body [data-auth-countdown]:disabled { opacity: 0.55; cursor: not-allowed; }

.al-body .auth-danger {
  min-height: 40px; padding: 8px 14px; border-radius: 10px;
  background: var(--rose-soft); border: 1px solid rgba(225, 29, 72, 0.30);
  color: var(--rose-text); font-size: 12.5px; font-weight: 750; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all var(--t-fast);
}
.al-body .auth-danger:hover { filter: brightness(1.06); border-color: rgba(225, 29, 72, 0.55); }

/* ================= MFA / CHALLENGE / RECOVERY / SECURITY SUB-PAGES ================= */
.al-body .auth-steps {
  list-style: none; margin: 0 0 16px; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.al-body .auth-steps li {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3);
}
.al-body .auth-steps li[aria-current="step"] {
  background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text);
}
.al-body .auth-steps li.is-done {
  background: var(--emerald-soft); border-color: rgba(16, 185, 129, 0.35); color: var(--emerald-text);
}
.al-body .auth-steps li .al-i { width: 13px; height: 13px; }

.al-body .auth-enrollment {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 14px; margin: 0 0 14px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
}
.al-body .auth-enrollment img {
  display: block; width: 196px; height: 196px; padding: 8px;
  border-radius: 12px; background: #fff; border: 1px solid var(--border);
}

.al-body .auth-recovery-codes {
  list-style: none; margin: 0 0 16px; padding: 12px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border-strong);
}
.al-body .auth-recovery-codes li {
  padding: 7px 10px; border-radius: 8px; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 13px; font-weight: 750; letter-spacing: 0.08em;
}

.al-body .auth-details {
  margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
}
.al-body .auth-details summary {
  cursor: pointer; font-size: 13px; font-weight: 750; color: var(--text-2); list-style: none;
}
.al-body .auth-details[open] summary { margin-bottom: 12px; color: var(--text); }
.al-body .auth-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.al-body .auth-actions > * { flex: 1 1 auto; width: auto; }

.al-body fieldset.auth-policy {
  border: 1px solid var(--border-strong); border-radius: 14px;
  padding: 14px 15px; margin: 0 0 12px;
  background: var(--surface-2); display: flex; flex-direction: column; gap: 8px;
}
.al-body fieldset.auth-policy legend {
  font-size: 13.5px; font-weight: 800; padding: 0 8px; color: var(--text);
}
.al-body label.auth-check {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 8px 10px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color var(--t-fast);
}
.al-body label.auth-check:hover { border-color: var(--primary); }
.al-body label.auth-check input[type="checkbox"] {
  width: 17px !important; height: 17px !important; min-height: 0 !important;
  flex: none; accent-color: var(--primary);
  appearance: auto !important; -webkit-appearance: checkbox !important; padding: 0 !important;
}

.al-body .card {
  padding: 18px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  display: flex; flex-direction: column; gap: 10px;
}
.al-body .card h2 { margin: 0; font-size: 16px; font-weight: 800; color: var(--text); }
.al-body .card p { margin: 0; font-size: 13px; color: var(--text-2); }
.al-body .card p.hint { font-size: 12px; color: var(--text-3); }
.al-body .card a.go {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 8px 16px; border-radius: 10px;
  background: var(--primary); color: #fff !important; font-size: 13px; font-weight: 750;
  text-decoration: none !important; align-self: flex-start;
}
.al-body .card a.go.g {
  background: var(--surface); color: var(--text) !important; border: 1px solid var(--border-strong);
}

/* Customer Login Helpful Security Note */
.customer-entry-note {
  margin: 14px 0 0; padding: 10px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 11.5px; line-height: 1.65; color: var(--text-3);
}
.customer-entry-note svg {
  width: 15px; height: 15px; flex: none; margin-top: 3px;
  fill: none; stroke: var(--emerald-text); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

/* Card Bottom Links & Footer */
.al-body > div.mt-7,
.al-body .auth-links {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3);
}
.al-body > div.mt-7 a,
.al-body .auth-links a {
  display: inline-flex; align-items: center;
  padding: 5px 9px; margin: -5px -9px; border-radius: 8px;
  font-weight: 700; color: var(--primary-text); text-decoration: none;
}
.al-body > div.mt-7 a:hover,
.al-body .auth-links a:hover { background: var(--primary-soft); text-decoration: none; }

.al-foot:empty { display: none; }
.al-foot {
  margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--border);
  text-align: center; font-size: 12.5px; color: var(--text-3); position: relative; z-index: 1;
}
.customer-bot-links { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.customer-bot-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  color: var(--text-2); font-size: 12.5px; font-weight: 700; text-decoration: none !important;
  transition: all var(--t-fast);
}
.customer-bot-links a:hover { border-color: var(--emerald); color: var(--emerald-text); background: var(--emerald-soft); }

/* Bottom Security Caption */
.al-caption {
  position: relative; z-index: 2;
  margin-top: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-3); font-weight: 500; text-align: center;
}
.al-caption svg {
  width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; color: var(--emerald-text);
}

/* ================= RESPONSIVE (TABLET & MOBILE & CROSS-OS) ================= */
@media (max-width: 960px) {
  .al-wrap { grid-template-columns: minmax(0, 460px); justify-content: center; gap: 0; }
  .al-show { display: none; }
  .al-brand-sm { display: flex; }
  .al-head { text-align: center; }
  .al-badge { margin-left: auto; margin-right: auto; }
}

@media (max-width: 560px) {
  body.al {
    padding-top: max(68px, calc(env(safe-area-inset-top) + 56px));
  }
  .al-sky .b1, .al-sky .b2, .al-sky .b3 { filter: blur(60px); }
  .al-card { padding: 20px 18px 18px; border-radius: 20px; }
  .al-head h1 { font-size: 18.5px; }
  /* 16px prevents iOS Safari automatic viewport zoom on input focus */
  .al-body input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
  .al-body select { font-size: 16px; min-height: 48px; height: 48px; }
  .al-body nav[aria-label] a { font-size: 12px; min-height: 42px; padding: 6px; }
  .al-body .auth-recovery-codes { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
