:root {
    --ma-bg: #f4f6f8;
    --ma-panel: #ffffff;
    --ma-surface: #ffffff;
    --ma-surface-muted: #f8fafc;
    --ma-border: #e2e8f0;
    --ma-text: #0a1929;
    --ma-muted: #607d8b;
    --ma-subtle: #94a3b8;
    --ma-orange: #f57c00;
    --ma-orange-dark: #e65100;
    --ma-blue: #1565c0;
    --ma-blue-soft: #eff6ff;
    --ma-amber-soft: #fffbeb;
    --ma-red-soft: #fef2f2;
    --ma-green-soft: #f0fdf4;
    color-scheme: light;
}

html.dark {
    --ma-bg: #0b1118;
    --ma-panel: #101923;
    --ma-surface: #15212c;
    --ma-surface-muted: #111b25;
    --ma-border: #263746;
    --ma-text: #f8fafc;
    --ma-muted: #b0bec5;
    --ma-subtle: #78909c;
    --ma-blue-soft: rgba(21, 101, 192, .14);
    --ma-amber-soft: rgba(245, 158, 11, .12);
    --ma-red-soft: rgba(239, 68, 68, .12);
    --ma-green-soft: rgba(34, 197, 94, .12);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; margin: 0; }
body.member-auth-body {
    min-height: 100dvh;
    background: var(--ma-bg);
    color: var(--ma-text);
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    overflow-x: hidden;
}
[x-cloak] { display: none !important; }

.member-auth-shell { min-height: 100dvh; background: var(--ma-panel); }
.brand-panel {
    position: relative;
    overflow: hidden;
    background: linear-gradient(150deg, #bf360c 0%, #e65100 30%, #f57c00 65%, #ff9800 100%);
}
.brand-deco { position: absolute; border-radius: 999px; pointer-events: none; }
.brand-deco-one { top: -80px; right: -80px; width: 280px; height: 280px; background: rgba(255,255,255,.08); }
.brand-deco-two { bottom: -60px; left: -60px; width: 200px; height: 200px; background: rgba(0,0,0,.07); }
.brand-deco-three { top: 40%; right: 10%; width: 120px; height: 120px; background: rgba(255,193,7,.12); }

.member-auth-main {
    position: relative;
    min-width: 0;
    background: var(--ma-panel);
}
.member-auth-theme {
    position: absolute;
    z-index: 20;
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--ma-border);
    background: color-mix(in srgb, var(--ma-surface) 94%, transparent);
    color: var(--ma-muted);
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(15,23,42,.06);
}
.member-auth-theme:hover { color: var(--ma-orange); border-color: rgba(245,124,0,.38); }
.member-auth-theme svg { width: 18px; height: 18px; }
.member-auth-theme .theme-moon { display: none; }
html.dark .member-auth-theme .theme-sun { display: none; }
html.dark .member-auth-theme .theme-moon { display: block; }

.member-auth-wrap {
    width: 100%;
    max-width: 470px;
    margin-inline: auto;
    padding: 32px 24px 40px;
}

.auth-header { margin-bottom: 24px; }
.auth-header-center { text-align: center; }
.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    border: 1px solid rgba(245,124,0,.2);
    border-radius: 999px;
    background: rgba(245,124,0,.08);
    padding: 7px 12px;
    color: var(--ma-orange);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.auth-eyebrow-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.auth-title {
    margin: 0;
    color: var(--ma-text);
    font-family: "Bebas Neue", cursive;
    font-size: clamp(2.35rem, 10vw, 2.85rem);
    line-height: .9;
    letter-spacing: .025em;
}
.auth-copy { margin: 10px 0 0; color: var(--ma-muted); font-size: 13px; font-weight: 650; line-height: 1.65; }
.auth-copy strong { color: var(--ma-text); }
.auth-icon {
    display: flex;
    width: 64px;
    height: 64px;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--ma-orange), var(--ma-orange-dark));
    color: white;
    box-shadow: 0 8px 24px rgba(245,124,0,.26);
}
.auth-icon.is-warning { background: var(--ma-amber-soft); color: #d97706; border: 1px solid rgba(245,158,11,.22); box-shadow: none; }
.auth-icon.is-neutral { background: var(--ma-surface-muted); color: var(--ma-subtle); border: 1px solid var(--ma-border); box-shadow: none; }
.auth-icon svg { width: 31px; height: 31px; }

.lbl { display: block; margin-bottom: 7px; color: var(--ma-text); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.inp, .otp-inp {
    width: 100%;
    border: 1.5px solid var(--ma-border);
    outline: none;
    background: var(--ma-surface-muted);
    color: var(--ma-text);
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.inp { min-height: 48px; padding: 12px 14px; border-radius: 13px; font-size: 13px; font-weight: 750; appearance: none; }
.inp::placeholder, .otp-inp::placeholder { color: var(--ma-subtle); font-weight: 550; }
.inp:focus, .otp-inp:focus { border-color: var(--ma-orange); background: var(--ma-surface); box-shadow: 0 0 0 3px rgba(245,124,0,.11); }
.otp-inp { min-height: 66px; padding: 14px 18px; border-radius: 15px; text-align: center; font-size: 1.75rem; font-weight: 900; letter-spacing: .42em; padding-left: calc(18px + .42em); }

.btn-primary, .btn-ghost {
    display: inline-flex;
    min-height: 48px;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 13px;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    transition: transform .1s, opacity .15s, border-color .15s, color .15s, background .15s;
}
.btn-primary { border: 0; background: linear-gradient(135deg, var(--ma-orange), var(--ma-orange-dark)); color: #fff; box-shadow: 0 4px 14px rgba(245,124,0,.25); }
.btn-primary:hover { opacity: .93; }
.btn-primary:active, .btn-ghost:active { transform: scale(.985); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { border: 1.5px solid var(--ma-border); background: var(--ma-surface); color: var(--ma-text); }
.btn-ghost:hover { border-color: rgba(245,124,0,.55); color: var(--ma-orange); }
.btn-compact { max-width: 220px; }

.auth-note, .auth-status-card {
    border: 1px solid var(--ma-border);
    border-radius: 15px;
    background: var(--ma-surface-muted);
    color: var(--ma-muted);
}
.auth-note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px; font-size: 11px; font-weight: 750; line-height: 1.55; }
.auth-note svg { width: 16px; height: 16px; margin-top: 1px; flex: 0 0 auto; }
.auth-note.is-info { border-color: rgba(21,101,192,.18); background: var(--ma-blue-soft); color: #1565c0; }
html.dark .auth-note.is-info { color: #90caf9; }
.auth-note.is-warning { border-color: rgba(245,158,11,.22); background: var(--ma-amber-soft); color: #b45309; }
html.dark .auth-note.is-warning { color: #fbbf24; }
.auth-note.is-error { border-color: rgba(239,68,68,.2); background: var(--ma-red-soft); color: #b91c1c; }
html.dark .auth-note.is-error { color: #fca5a5; }
.auth-note.is-success { border-color: rgba(34,197,94,.2); background: var(--ma-green-soft); color: #15803d; }
html.dark .auth-note.is-success { color: #86efac; }
.auth-note a { color: inherit; font-weight: 900; text-decoration: underline; }

.auth-status-card { padding: 15px; text-align: left; }
.auth-status-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.auth-kicker { color: var(--ma-subtle); font-size: 9px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.auth-value { margin-top: 4px; color: var(--ma-text); font-size: 13px; font-weight: 850; overflow-wrap: anywhere; }
.auth-badge { display: inline-flex; margin-top: 5px; border: 1px solid rgba(245,158,11,.26); border-radius: 999px; background: var(--ma-amber-soft); padding: 5px 9px; color: #b45309; font-size: 10px; font-weight: 900; }
html.dark .auth-badge { color: #fbbf24; }
.auth-steps { display: grid; gap: 10px; }
.auth-step { display: flex; gap: 10px; align-items: flex-start; }
.auth-step-number { display: inline-flex; width: 23px; height: 23px; flex: 0 0 23px; align-items: center; justify-content: center; border-radius: 999px; background: var(--ma-blue); color: #fff; font-size: 10px; font-weight: 900; }
.auth-step-copy { color: var(--ma-muted); font-size: 12px; font-weight: 650; line-height: 1.5; }
.auth-link-row { margin-top: 20px; text-align: center; color: var(--ma-muted); font-size: 12px; font-weight: 650; }
.auth-link-row a { color: var(--ma-orange); font-weight: 900; text-decoration: none; }
.auth-link-row a:hover { text-decoration: underline; }
.auth-actions-two { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.auth-help { margin-top: 5px; color: var(--ma-muted); font-size: 10px; font-weight: 650; line-height: 1.45; }
.auth-inline-copy { color: var(--ma-muted); font-size: 11px; font-weight: 650; line-height: 1.45; }
.auth-inline-link { color: var(--ma-orange); font-size: 11px; font-weight: 900; line-height: 1.45; text-decoration: none; }
.auth-inline-link:hover { text-decoration: underline; }

.auth-alert { margin-bottom: 14px; }
.auth-form { display: grid; gap: 14px; }
.auth-form.is-busy { pointer-events: none; opacity: .82; }
.auth-loading {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10,25,41,.32);
    backdrop-filter: blur(2px);
}
.auth-loading.is-visible { display: flex; }
.auth-loading-card { display: flex; align-items: center; gap: 10px; border: 1px solid var(--ma-border); border-radius: 14px; background: var(--ma-surface); padding: 12px 15px; color: var(--ma-text); font-size: 12px; font-weight: 850; box-shadow: 0 16px 40px rgba(15,23,42,.2); }
.auth-spinner { width: 18px; height: 18px; border: 2px solid rgba(245,124,0,.22); border-top-color: var(--ma-orange); border-radius: 999px; animation: authSpin .7s linear infinite; }
@keyframes authSpin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.fu { animation: fadeUp .28s ease both; }
.fu1 { animation-delay: .05s; }
.fu2 { animation-delay: .1s; }

@media (max-width: 1023px) {
    .member-auth-shell { min-height: 100dvh; }
    .brand-panel { min-height: 106px; }
    .brand-panel .mobile-brand { padding: max(18px, env(safe-area-inset-top)) 22px 16px; }
    .brand-panel .mobile-brand img { height: 38px; }
    .member-auth-main { min-height: calc(100dvh - 106px); }
    .member-auth-wrap { padding-top: 28px; padding-bottom: max(32px, env(safe-area-inset-bottom)); }
    .member-auth-theme { top: 14px; }
}

@media (min-width: 1024px) {
    .member-auth-shell { display: grid; grid-template-columns: 420px minmax(0,1fr); }
    .brand-panel { min-height: 100dvh; display: flex; flex-direction: column; }
    .member-auth-main { min-height: 100dvh; overflow-y: auto; }
    .member-auth-wrap { padding: 70px 38px 52px; }
}

@media (max-width: 420px) {
    .member-auth-wrap { padding-inline: 18px; }
    .auth-header { margin-bottom: 20px; }
    .auth-title { font-size: 2.35rem; }
    .auth-icon { width: 56px; height: 56px; border-radius: 18px; }
    .auth-icon svg { width: 27px; height: 27px; }
    .auth-actions-two { gap: 8px; }
    .btn-primary, .btn-ghost { min-height: 46px; padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Strict-CSP auth interactions. */
.auth-strength{margin-top:.5rem}.auth-strength-bars{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.25rem}.auth-strength-bars span{height:.375rem;border-radius:999px;background:var(--ma-border)}.auth-strength-bars span.is-weak{background:#f87171}.auth-strength-bars span.is-medium{background:#fbbf24}.auth-strength-bars span.is-strong{background:#22c55e}.auth-strength-meta{display:flex;align-items:center;justify-content:space-between;margin-top:.25rem;color:var(--ma-muted);font-size:.625rem;font-weight:800}.auth-password-match{position:absolute;right:1rem;top:50%;transform:translateY(-50%);font-weight:900;color:#22c55e}.btn-primary:disabled{cursor:not-allowed;opacity:.55;transform:none}

/* Registration region selector inherits the same auth surface in dark mode. */
[data-auth-password-toggle]{color:var(--ma-muted)}
[data-auth-password-toggle]:hover{color:var(--ma-orange)}
html.dark body.member-auth-body .bg-white{background-color:var(--ma-surface)!important}
html.dark body.member-auth-body .text-cbz-dark{color:var(--ma-text)!important}
html.dark body.member-auth-body .text-cbz-gray{color:var(--ma-muted)!important}
html.dark body.member-auth-body .border-slate-100,html.dark body.member-auth-body .border-slate-200{border-color:var(--ma-border)!important}
html.dark body.member-auth-body .hover\\:bg-orange-50:hover,html.dark body.member-auth-body .focus\\:bg-orange-50:focus{background:rgba(245,124,0,.12)!important}

/* M2.3.4 Member account recovery channel selector. */
.auth-method-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.65rem}
.auth-method-option{position:relative;display:block;cursor:pointer}
.auth-method-option>input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.auth-method-card{display:flex;min-height:82px;align-items:center;gap:.7rem;border:1.5px solid var(--ma-border);border-radius:16px;background:var(--ma-surface-muted);padding:.8rem;color:var(--ma-muted);transition:border-color .15s,background .15s,color .15s,box-shadow .15s,transform .15s}
.auth-method-card strong{display:block;color:var(--ma-text);font-size:.76rem;font-weight:900;line-height:1.15}
.auth-method-card small{display:block;margin-top:.2rem;font-size:.58rem;font-weight:650;line-height:1.35}
.auth-method-icon{display:flex;width:2.15rem;height:2.15rem;flex:0 0 2.15rem;align-items:center;justify-content:center;border-radius:.7rem;background:rgba(245,124,0,.1);color:var(--ma-orange)}
.auth-method-icon svg{width:1.15rem;height:1.15rem}
.auth-method-option>input:checked+.auth-method-card{border-color:rgba(245,124,0,.55);background:rgba(245,124,0,.08);color:var(--ma-text);box-shadow:0 8px 22px rgba(245,124,0,.1);transform:translateY(-1px)}
.auth-method-option>input:focus-visible+.auth-method-card{outline:3px solid rgba(245,124,0,.2);outline-offset:2px}
@media(max-width:360px){.auth-method-grid{grid-template-columns:1fr}.auth-method-card{min-height:68px}}


.auth-recovery-note{display:flex;align-items:flex-start;gap:.55rem;border:1px solid rgba(245,124,0,.16);border-radius:14px;background:rgba(245,124,0,.07);padding:.75rem .85rem;color:#8a4b00;font-size:.68rem;font-weight:700;line-height:1.5}
.auth-recovery-note svg{width:1rem;height:1rem;flex:0 0 auto;margin-top:.08rem;color:#F57C00}
html.dark .auth-recovery-note{border-color:rgba(251,146,60,.22);background:rgba(245,124,0,.12);color:#FDBA74}
