/* ============================================================
   AluSmart — Authentication pages (Login / Sign Up / Forgot)
   Split on desktop · stacked on mobile · adaptive on tablet
   ============================================================ */

:root {
    --as-primary:        #1d4ed8;
    --as-primary-dark:   #1e3a8a;
    --as-primary-light:  #3b82f6;
    --as-accent:         #22d3ee;
    --as-success:        #10b981;
    --as-warn:           #f59e0b;
    --as-danger:         #dc2626;

    --as-hero-from:      #061a3d;
    --as-hero-via:       #0a2a5e;
    --as-hero-to:        #0d3680;

    --as-bg:             #f5f7fa;
    --as-surface:        #ffffff;
    --as-text:           #0f172a;
    --as-text-muted:     #64748b;
    --as-border:         #e2e8f0;
}

* { box-sizing: border-box; }

/* Global SVG safety net — inline icons with no explicit size default to 1em */
svg { width: 1em; height: 1em; flex-shrink: 0; }

html, body {
    margin: 0; padding: 0;
    width: 100%;
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body.as-auth {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--as-text);
    background: var(--as-bg);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* ── Logo mark — single source of truth: /public/images/logo.svg.
   Renders the full SVG (blue tile + glossy sheen + bold outline "A" + inner
   triangle) as a background image, and adds a soft outer blue glow via
   box-shadow so it pops on dark hero backgrounds. The legacy inner span
   `.as-logo-a` is now a no-op and stays in markup for backwards compat. */
.as-logo-mark {
    position: relative;
    width: 48px; height: 48px;
    background: url('/images/logo.svg?v=5') center/contain no-repeat;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(59, 130, 246, .45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.as-logo-mark.sm { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 8px 24px rgba(59, 130, 246, .35); }
/* Hide the legacy inner span — the SVG now contains everything */
.as-logo-a { display: none; }

/* ── Brand text ──────────────────────────────────── */
.as-brand-text { line-height: 1.15; }
.as-brand-name { font-size: 22px; font-weight: 800; letter-spacing: .2px; }
.as-brand-name .alu   { color: #ffffff; }
.as-brand-name .smart { color: #38bdf8; }
.as-brand-tag  { font-size: 12px; color: rgba(255,255,255,.78); margin-top: 3px; font-weight: 500; }

/* ── Split container ─────────────────────────────── */
.as-auth-split { display: flex; width: 100%; min-height: 100vh; }

/* ── Hero (left on desktop) ───────────────────────── */
.as-auth-hero {
    flex: 1 1 56%;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(59,130,246,.22) 0%, transparent 50%),
        radial-gradient(80% 60% at 0% 100%, rgba(34,211,238,.15) 0%, transparent 50%),
        linear-gradient(160deg, var(--as-hero-from) 0%, var(--as-hero-via) 45%, var(--as-hero-to) 100%);
}
.as-auth-hero::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 56px 56px;
    pointer-events: none;
    z-index: 0;
}
.as-auth-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url('/images/industrial-bg.svg?v=2') no-repeat center bottom / cover;
    opacity: 0.92;
    pointer-events: none;
    z-index: 0;
    filter: drop-shadow(0 -12px 30px rgba(0, 0, 0, .35));
}
.as-auth-hero-inner {
    position: relative;
    z-index: 2;
    padding: 36px 48px 28px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.as-auth-hero-brand { display: flex; align-items: center; gap: 14px; }

.as-hero-title {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.16;
    margin: 4px 0 0 0;
    letter-spacing: -.4px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
.as-hero-title .hi { color: #4ade80; }
.as-hero-sub {
    font-size: 15px;
    color: rgba(255,255,255,.86);
    margin: 0;
    line-height: 1.5;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .25);
}

/* ── Feature list ────────────────────────────────── */
.as-feature-list {
    list-style: none;
    margin: 4px 0 0; padding: 0;
    display: grid; gap: 12px;
}
.as-feature-list li { display: flex; gap: 12px; align-items: flex-start; }
.as-feature-list .ico {
    width: 40px; height: 40px;
    border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.18);
}
.as-feature-list .ico svg { width: 20px; height: 20px; color: #fff; }
.as-feature-list .ico-blue   { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.as-feature-list .ico-green  { background: linear-gradient(135deg, #22c55e, #15803d); }
.as-feature-list .ico-purple { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.as-feature-list .ico-orange { background: linear-gradient(135deg, #fb923c, #ea580c); }
.as-feature-list .ico-indigo { background: linear-gradient(135deg, #818cf8, #4338ca); }
.as-feature-list .t { font-weight: 700; font-size: 14.5px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.as-feature-list .s { font-size: 12.5px; color: rgba(255,255,255,.82); margin-top: 1px; line-height: 1.45; text-shadow: 0 1px 3px rgba(0,0,0,.35); }

/* ── Supported sources strip ────────────────────── */
.as-auth-hero-inner .as-sources {
    margin-top: auto;
    padding: 14px 16px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 12px 32px -10px rgba(0, 0, 0, .35);
}
.as-sources-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: #1e293b;
    text-align: center;
    margin-bottom: 12px;
    position: relative;
    padding: 0 24px;
}
.as-sources-title::before, .as-sources-title::after {
    content: ''; position: absolute; top: 50%;
    width: 36px; height: 1px;
    background: rgba(15, 42, 110, .18);
}
.as-sources-title::before { left: 0; }
.as-sources-title::after  { right: 0; }
.as-sources-row {
    display: flex; flex-wrap: nowrap;
    align-items: center; justify-content: space-between;
    gap: 6px;
}
.as-sources-row .src {
    flex: 1 1 0;
    min-width: 0;
    display: flex; align-items: center; gap: 6px;
    padding: 4px 6px;
    border-right: 1px solid rgba(15, 42, 110, .08);
}
.as-sources-row .src:last-child { border-right: none; }
.src-logo {
    flex-shrink: 0;
    width: 28px; height: 28px;
    display: inline-flex;
    align-items: center; justify-content: center;
    font-weight: 800; font-size: 11px;
    letter-spacing: -.4px;
    border-radius: 6px;
}
.src-logo.lme       { color: #dc2626; background: #fff; border: 2px solid #dc2626; }
.src-logo.lme .o    { width: 14px; height: 14px; border: 2px solid #dc2626; border-radius: 50%; display: inline-block; }
.src-logo.mcx       { background: #dc2626; color: #fff; font-size: 9.5px; font-weight: 900; }
.src-logo.nalco     { background: #fff; }
.src-logo.nalco .tri{
    width: 0; height: 0;
    border-left: 8px solid transparent; border-right: 8px solid transparent;
    border-bottom: 14px solid #dc2626;
}
.src-logo.hindalco  { background: linear-gradient(135deg, #f97316, #b91c1c); }
.src-logo.hindalco .diamond {
    width: 14px; height: 14px;
    background: #fbbf24;
    transform: rotate(45deg);
    box-shadow: inset 0 0 0 2px #fff;
}
.src-logo.vedanta   { background: #fff; }
.src-logo.vedanta .leaf {
    width: 16px; height: 16px;
    background: linear-gradient(135deg, #22c55e, #15803d);
    border-radius: 50% 0 50% 50%;
    transform: rotate(-30deg);
}
.src-logo.imported  { background: linear-gradient(135deg, #3b82f6, #1e40af); color: #fff; }
.src-logo.imported svg { width: 18px; height: 18px; }
.src-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.src-name { font-size: 11.5px; font-weight: 800; color: #0f172a; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-sub  { font-size: 9.5px; color: #64748b; font-weight: 600; letter-spacing: .1px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Form panel (right on desktop) ──────────────── */
.as-auth-panel {
    flex: 1 1 44%;
    min-height: 100vh;
    background: var(--as-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 32px;
    position: relative;
    gap: 18px;
}
.as-auth-form-wrap {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 60px -20px rgba(15, 42, 110, .22), 0 6px 20px -8px rgba(15, 42, 110, .08);
    padding: 28px 28px 24px;
    border: 1px solid rgba(15, 42, 110, .06);
    position: relative;
}

/* Language pill (top-right of form card) */
.as-lang {
    position: absolute;
    top: 18px; right: 18px;
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff;
    border: 1px solid var(--as-border);
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--as-text);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(15, 42, 110, .04);
}
.as-lang svg { width: 13px; height: 13px; color: var(--as-text-muted); }
.as-lang-globe { width: 14px; height: 14px; color: var(--as-text-muted); }

.as-auth-form-header {
    text-align: center;
    margin-bottom: 18px;
}
.as-auth-form-header .as-logo-mark { margin: 0 auto 10px; }
.as-auth-form-header h2 {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 6px 0;
    color: var(--as-text);
    letter-spacing: -.3px;
}
.as-auth-form-header p {
    font-size: 14px;
    color: var(--as-text-muted);
    margin: 0;
    line-height: 1.5;
}
.as-auth-form-header .hl { color: var(--as-primary); font-weight: 700; }

/* ── Form elements ───────────────────────────────── */
.as-form-group { margin-bottom: 14px; }
.as-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--as-text);
}

.as-input-wrap { position: relative; }
.as-input-icon {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--as-text-muted);
    display: inline-flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.as-input-icon svg { width: 18px; height: 18px; }

.as-form-control {
    width: 100%;
    min-height: 46px;
    padding: 11px 16px 11px 42px;
    font-size: 14.5px;
    font-family: inherit;
    border: 1.5px solid var(--as-border);
    border-radius: 11px;
    background: #f8fafc;
    color: var(--as-text);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.as-form-control:focus {
    outline: none;
    border-color: var(--as-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(29, 78, 216, .12);
}
.as-form-control::placeholder { color: #94a3b8; }

.as-password-toggle {
    position: absolute;
    right: 8px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    cursor: pointer;
    color: var(--as-text-muted);
    padding: 8px 10px;
    min-height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
}
.as-password-toggle svg { width: 18px; height: 18px; }
.as-password-toggle:hover { color: var(--as-primary); }

/* Forgot password link (right-aligned under password) — kept for back-compat */
.as-forgot-row {
    display: flex; justify-content: flex-end;
    margin: -4px 0 10px;
    font-size: 13px;
}

/* Row: remember + forgot — sits right under the password input */
.as-row-between {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 8px 16px;
    margin: 4px 0 16px;
    font-size: 13px;
}
@media (max-width: 480px) {
    .as-row-between { font-size: 12.5px; margin: 2px 0 14px; }
}
.as-link {
    color: var(--as-primary);
    font-weight: 600;
    text-decoration: none;
}
.as-link:hover { text-decoration: underline; }
.as-check {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--as-text-muted);
    user-select: none;
    cursor: pointer;
}
.as-check input { width: 16px; height: 16px; accent-color: var(--as-primary); }

/* Buttons */
.as-btn-primary {
    width: 100%;
    min-height: 48px;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 11px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 60%, #1e40af 100%);
    color: #fff;
    cursor: pointer;
    transition: transform .08s, box-shadow .15s, filter .15s;
    box-shadow: 0 8px 20px rgba(29, 78, 216, .28);
    letter-spacing: .3px;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 10px;
    text-decoration: none;
}
.as-btn-primary svg { width: 18px; height: 18px; }
.as-btn-primary:hover { box-shadow: 0 12px 28px rgba(29, 78, 216, .38); filter: brightness(1.03); }
.as-btn-primary:active { transform: translateY(1px); }
.as-btn-primary:disabled { opacity: .7; cursor: not-allowed; }
.as-btn-block { display: flex; }

/* OR divider */
.as-divider {
    display: flex; align-items: center;
    margin: 18px 0 14px;
    color: var(--as-text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
}
.as-divider::before, .as-divider::after {
    content: ""; flex: 1; height: 1px; background: var(--as-border);
}
.as-divider span { padding: 0 14px; }

/* OAuth buttons */
.as-btn-oauth {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    background: #fff;
    color: var(--as-text);
    font-weight: 600;
    font-size: 14.5px;
    border: 1.5px solid var(--as-border);
    border-radius: 11px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
    transition: border-color .15s, background .15s, transform .08s;
}
.as-btn-oauth:hover { border-color: #cbd5e1; background: #f8fafc; }
.as-btn-oauth:active { transform: translateY(1px); }
.as-btn-oauth svg { width: 20px; height: 20px; flex-shrink: 0; }

.as-auth-footer {
    text-align: center;
    margin-top: 14px;
    font-size: 14px;
    color: var(--as-text-muted);
}

/* Alert */
.as-alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    margin-bottom: 16px;
    display: none;
    line-height: 1.4;
}
.as-alert.show { display: block; }
.as-alert-danger  { background: #fee2e2; color: var(--as-danger);  border: 1px solid #fca5a5; }
.as-alert-success { background: #d1fae5; color: #065f46;            border: 1px solid #6ee7b7; }
.text-danger { color: var(--as-danger); }

/* ── Trust row (below form) ─────────────────────── */
.as-trust-row {
    width: 100%;
    max-width: 720px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 2px;
}
.as-trust-row .trust {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--as-border);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 42, 110, .04);
}
.as-trust-row .ti {
    width: 32px; height: 32px;
    border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.as-trust-row .ti svg { width: 16px; height: 16px; color: #fff; }
.as-trust-row .ti-blue   { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.as-trust-row .ti-yellow { background: linear-gradient(135deg, #facc15, #ca8a04); }
.as-trust-row .ti-green  { background: linear-gradient(135deg, #22c55e, #15803d); }
.as-trust-row .ti-indigo { background: linear-gradient(135deg, #818cf8, #4338ca); }
.as-trust-row .t { font-size: 12.5px; font-weight: 700; color: var(--as-text); }
.as-trust-row .s { font-size: 11px; color: var(--as-text-muted); margin-top: 1px; line-height: 1.35; }

/* ── Mobile bottom nav (mobile-only) ─────────────── */
.as-bottom-nav {
    display: none;
    position: sticky;
    bottom: 0;
    left: 0; right: 0;
    background: #fff;
    border-top: 1px solid var(--as-border);
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    box-shadow: 0 -4px 16px rgba(15, 42, 110, .06);
    z-index: 5;
}
.as-bottom-nav .item {
    display: flex; flex-direction: column;
    align-items: center; gap: 4px;
    padding: 6px 4px;
    text-decoration: none;
    color: var(--as-text);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}
.as-bottom-nav .item .ico {
    width: 36px; height: 36px;
    border-radius: 12px;
    background: #eff6ff;
    display: inline-flex; align-items: center; justify-content: center;
}
.as-bottom-nav .item .ico svg { width: 18px; height: 18px; color: var(--as-primary); }
.as-bottom-nav .item .ico.green { background: #ecfdf5; }
.as-bottom-nav .item .ico.green svg { color: #16a34a; }
.as-bottom-nav .item .ico.purple { background: #faf5ff; }
.as-bottom-nav .item .ico.purple svg { color: #7e22ce; }
.as-bottom-nav .item .ico.orange { background: #fff7ed; }
.as-bottom-nav .item .ico.orange svg { color: #ea580c; }

/* ── Tablet (≤ 1100px) — narrower hero ─────────── */
@media (max-width: 1100px) {
    .as-auth-hero-inner { padding: 28px 32px 22px; gap: 18px; }
    .as-hero-title      { font-size: 28px; }
    .as-feature-list    { gap: 10px; }
    .as-feature-list .ico { width: 36px; height: 36px; }
    .as-feature-list .ico svg { width: 18px; height: 18px; }
    .as-feature-list .t { font-size: 13.5px; }
    .as-feature-list .s { font-size: 12px; }
    .as-trust-row       { grid-template-columns: repeat(2, 1fr); }
    .as-auth-panel      { padding: 22px 22px; }
}

/* ── Smaller laptops (≤ 980px) — drop a feature or two to fit ── */
@media (max-width: 980px) {
    .as-feature-list li:nth-child(n+5) { display: none; }
}

/* ── Mobile (≤ 860px) — stack, dark hero header + white form + bottom nav ── */
@media (max-width: 860px) {
    body.as-auth { flex-direction: column; overflow-y: auto; min-height: 100vh; background: #fff; }
    .as-auth-split { flex-direction: column; min-height: auto; }

    .as-auth-hero {
        flex: 0 0 auto;
        min-height: 220px;
        max-height: 280px;
        border-radius: 0 0 28px 28px;
    }
    .as-auth-hero::after {
        width: 70%;
        height: 100%;
        opacity: 0.55;
        right: -8%;
    }
    .as-auth-hero-inner {
        min-height: auto;
        padding: 22px 22px 24px;
        gap: 10px;
    }
    .as-auth-hero-brand .as-brand-tag { font-size: 11.5px; }
    .as-hero-title { font-size: 21px; line-height: 1.25; max-width: 70%; }
    .as-hero-sub   { font-size: 13px; max-width: 70%; }

    .as-feature-list,
    .as-auth-hero-inner .as-sources { display: none; }

    .as-auth-panel {
        flex: 1 1 auto;
        min-height: auto;
        padding: 20px 16px 28px;
        background: #fff;
        gap: 14px;
        margin-top: -22px;
        z-index: 2;
    }
    .as-auth-form-wrap {
        max-width: 100%;
        box-shadow: 0 12px 32px -16px rgba(15, 42, 110, .15);
        border: 1px solid rgba(15, 42, 110, .06);
        padding: 24px 22px 22px;
        background: #fff;
    }
    .as-auth-form-header h2 { font-size: 22px; }
    /* On mobile the dark hero already shows the AluSmart logo, so the small
       logo icon above "Welcome Back!" is redundant — hide it. */
    .as-auth-form-header .as-logo-mark { display: none; }
    .as-trust-row { display: none; }
    .as-lang { display: none; }

    /* Show bottom nav on mobile */
    .as-bottom-nav { display: grid; }
}

/* ── Very small (≤ 380px) ──────────────────────── */
@media (max-width: 380px) {
    .as-auth-hero        { min-height: 200px; }
    .as-auth-hero-inner  { padding: 18px 18px 20px; }
    .as-hero-title       { font-size: 18px; }
    .as-auth-form-header h2 { font-size: 20px; }
    .as-form-control     { font-size: 14.5px; }
    .as-bottom-nav .item { font-size: 10px; }
}

/* ── Invalid field + inline error (same look as app.css) ── */
.as-form-control.is-invalid {
    border-color: var(--as-danger) !important;
    background: rgba(220, 38, 38, .025);
}
.as-form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .14); outline: none; }
.as-field-error {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--as-danger);
    font-weight: 500;
    animation: as-field-error-in .15s ease-out;
}
.as-form-group:has(.is-invalid) .as-field-error,
.as-field-error:not(:empty) { display: flex; }
.as-field-error::before {
    content: "";
    flex-shrink: 0;
    width: 14px; height: 14px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 8v4'/><path d='M12 16h.01'/></svg>") center/contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 8v4'/><path d='M12 16h.01'/></svg>") center/contain no-repeat;
}
@keyframes as-field-error-in {
    from { opacity: 0; transform: translateY(-2px); }
    to   { opacity: 1; transform: none; }
}
button.is-busy, .as-btn-primary.is-busy {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
button.is-busy svg, .as-btn-primary.is-busy svg { visibility: hidden; }
button.is-busy::after, .as-btn-primary.is-busy::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 18px; height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    border: 2px solid #fff;
    border-top-color: transparent;
    animation: as-spin .7s linear infinite;
}
@keyframes as-spin { to { transform: rotate(360deg); } }

/* ── Form banner — inline status/error message above auth forms ──
   Hidden by default. Shown when the form helper sets className to
   .is-error or .is-success. Replaces the old #asAlert div. */
.as-form-banner {
    margin: 0 0 14px;
    padding: 0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    border: 1px solid transparent;
    background: transparent;
    color: transparent;
    transition: padding .12s, margin .12s;
}
.as-form-banner.is-error,
.as-form-banner.is-success {
    padding: 11px 14px;
    margin: 0 0 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    animation: as-banner-in .15s ease-out;
}
.as-form-banner.is-error {
    background: rgba(220, 38, 38, .07);
    border-color: rgba(220, 38, 38, .25);
    color: var(--as-danger);
}
.as-form-banner.is-success {
    background: rgba(16, 185, 129, .08);
    border-color: rgba(16, 185, 129, .28);
    color: #047857;
}
.as-form-banner.is-error::before,
.as-form-banner.is-success::before {
    content: "";
    flex-shrink: 0;
    margin-top: 1px;
    width: 16px; height: 16px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 8v4'/><path d='M12 16h.01'/></svg>") center/contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 8v4'/><path d='M12 16h.01'/></svg>") center/contain no-repeat;
}
.as-form-banner.is-success::before {
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='m9 12 2 2 4-4'/></svg>") center/contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='m9 12 2 2 4-4'/></svg>") center/contain no-repeat;
}
@keyframes as-banner-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}
