.auth-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s, visibility .25s; overflow: hidden; }
.auth-modal.active { opacity: 1; visibility: visible; pointer-events: auto; }
.auth-modal::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); }
.auth-modal .wl-modal-content { max-width: none; max-height: min(92svh, 920px); border-radius: 1rem; position: relative; z-index: 1; }
.auth-modal .wl-modal-handle { display: none; }
.auth-container { contain: layout style paint; position: relative; }
.auth-main { display: flex; flex-direction: column; min-height: 0; }
.auth-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); background: rgba(15, 23, 42, .55); color: #fff; display: inline-flex; align-items: center; justify-content: center; z-index: 10; backdrop-filter: blur(6px); transition: background .2s, color .2s, border-color .2s, transform .2s; }
.auth-close svg { width: 18px; height: 18px; }
.auth-close:hover { background: rgba(15, 23, 42, .75); border-color: rgba(255,255,255,.6); transform: scale(1.05); }
.auth-panel { padding: 4rem 1.5rem 2rem; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.auth-panel::-webkit-scrollbar { display: none; }
.auth-alert { display: none !important; }
.auth-alert.error { display: flex; background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.auth-alert.success { display: flex; background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.auth-header { text-align: center; margin-bottom: 1.25rem; }
.auth-header h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: .375rem; }
.auth-header p { font-size: .875rem; color: var(--c-text-muted, #6b7280); line-height: 1.5; }
.auth-timer { font: 600 .9375rem/1 var(--ff, inherit); color: var(--c-text, #111827); margin-top: .625rem; }
.auth-timer span { font-weight: 700; font-size: 1.125rem; display: inline-block; min-width: 65px; font-variant-numeric: tabular-nums; }
.auth-timer.warning { color: #f59e0b; }
.auth-timer.danger { color: #ef4444; animation: wl-pulse 1s infinite; }
.auth-social { display: flex; gap: .875rem; margin-bottom: 1rem; }
.auth-social-btn { flex: 1; height: 46px; border: 1px solid var(--c-border, #e5e7eb); border-radius: .5rem; background: var(--c-surface, #fff); color: var(--c-text, #111827); font: 600 .9375rem/1 var(--ff, inherit); display: flex; align-items: center; justify-content: center; gap: .625rem; text-decoration: none; transition: transform .2s, background .2s; }
.auth-social-btn:hover { background: var(--c-surface-alt, #f9fafb); transform: translateY(-2px); }
.auth-social-btn svg { width: 18px; height: 18px; }
.auth-divider { display: flex; align-items: center; margin-bottom: 1rem; gap: 1rem; }
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--c-border, #e5e7eb); }
.auth-divider span { font-size: .8125rem; color: var(--c-text-muted, #6b7280); }
.auth-view { display: none; animation: wl-fade-in .25s ease; }
.auth-view.active { display: block; }
.auth-field { position: relative; margin-bottom: .875rem; }
.auth-field input { width: 100%; height: 54px; padding: 16px 18px; font-size: 1rem; border: 1.5px solid var(--c-border, #e5e7eb); border-radius: .5rem; background: var(--c-surface, #fff); color: var(--c-text, #111827); transition: border-color .2s, box-shadow .2s; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.auth-field input:focus { border-color: var(--c-text, #111827); outline: none; }
.auth-field label { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 1rem; color: var(--c-text-muted, #6b7280); pointer-events: none; transition: all .2s; background: transparent; padding: 0 4px; }
.auth-field label small { font-size: .8125rem; opacity: .7; }
.auth-field input:focus + label,
.auth-field input:not(:placeholder-shown) + label { top: 0; font-size: .8125rem; color: var(--c-text, #111827); background: var(--c-surface, #fff); font-weight: 600; }
.auth-field.error input { border-color: #ef4444; }
.auth-field.error label { color: #ef4444; }
.auth-field-pass input { padding-right: 50px; }
.auth-name-row { display: grid; grid-template-columns: 1fr 1fr; gap: .875rem; margin-bottom: .875rem; }
.auth-name-row .auth-field { margin-bottom: 0; }
.auth-eye { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; color: var(--c-text-muted, #6b7280); cursor: pointer; border-radius: .25rem; padding: 0; transition: background .2s, color .2s; }
.auth-eye:hover { background: var(--c-surface-alt, #f9fafb); color: var(--c-text, #111827); }
.auth-eye svg { width: 20px; height: 20px; }
.auth-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; font-size: .8125rem; }
.auth-check { display: flex; align-items: center; gap: .5rem; cursor: pointer; user-select: none; }
.auth-check input { position: absolute; opacity: 0; }
.auth-check-box { width: 20px; height: 20px; border: 2px solid var(--c-border, #e5e7eb); border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: all .2s; flex-shrink: 0; }
.auth-check input:checked + .auth-check-box { background: var(--c-text, #111827); border-color: var(--c-text, #111827); }
.auth-check input:checked + .auth-check-box::after { content: ''; width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-top: -2px; }
.auth-check.error .auth-check-box { border-color: #ef4444; animation: wl-shake .5s; }
.auth-link { color: var(--c-text, #111827); font: 600 .8125rem/1 var(--ff, inherit); padding: 0; background: none; border: none; cursor: pointer; }
.auth-link:hover { text-decoration: underline; }
.auth-submit { width: 100%; height: 48px; background: var(--c-text, #111827); color: var(--c-surface, #fff); border: none; border-radius: .5rem; font: 700 1rem/1 var(--ff, inherit); cursor: pointer; margin-bottom: .75rem; transition: transform .2s, box-shadow .2s, opacity .2s; }
.auth-submit:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.15); opacity: .9; }
.auth-submit:disabled { opacity: .6; pointer-events: none; }
.auth-submit.shake { animation: wl-shake .5s; }
.auth-submit[data-wl-state],
.auth-link[data-wl-state] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    text-decoration: none;
}
.auth-submit[data-wl-state="loading"],
.auth-link[data-wl-state="loading"] {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .22);
    opacity: 1;
}
.auth-submit[data-wl-state="success"],
.auth-link[data-wl-state="success"] {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    box-shadow: 0 12px 24px rgba(5, 150, 105, .24);
    opacity: 1;
}
.auth-submit[data-wl-state="error"],
.auth-link[data-wl-state="error"] {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
    box-shadow: 0 12px 24px rgba(220, 38, 38, .22);
    opacity: 1;
}
.auth-submit[data-wl-state="info"],
.auth-link[data-wl-state="info"] {
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    color: #fff;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .20);
    opacity: 1;
}
.auth-link[data-wl-state] {
    padding: .7rem 1rem;
    border-radius: .65rem;
    font-size: .875rem;
}
.auth-submit[data-wl-state] svg,
.auth-link[data-wl-state] svg { width: 18px; height: 18px; flex-shrink: 0; }
.auth-submit[data-wl-state="loading"] .wl-spinner,
.auth-link[data-wl-state="loading"] .wl-spinner {
    border-color: rgba(255,255,255,.35);
    border-top-color: #fff;
}
.auth-footer { text-align: center; font-size: .875rem; color: var(--c-text-muted, #6b7280); margin-top: .5rem; }
.auth-footer button { color: var(--c-text, #111827); font-weight: 700; padding: 0 .375rem; background: none; border: none; cursor: pointer; }
.auth-footer button:hover { text-decoration: underline; }
.auth-center { text-align: center; margin-bottom: .75rem; }
.auth-otp { display: flex; gap: .625rem; justify-content: center; align-items: center; padding: 1rem 0; }
.auth-digit { width: 52px; height: 60px; text-align: center; font: 700 1.625rem/1 var(--ff, inherit); border: 2px solid var(--c-border, #e5e7eb); border-radius: .5rem; background: var(--c-surface-alt, #f9fafb); color: var(--c-text, #111827); transition: border-color .2s, box-shadow .2s, transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.auth-digit:focus { border-color: var(--c-text, #111827); outline: none; transform: scale(1.05); }
.auth-digit:not(:placeholder-shown) { border-color: var(--c-primary, #111827); }
.auth-otp-sep { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 60px; font: 600 1.625rem/1 var(--ff, inherit); color: var(--c-text-muted, #6b7280); }
.auth-spinner { display: inline-block; width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: wl-spin .6s linear infinite; }
@media (max-width: 991px) {
    .auth-slider { display: none; }
    .auth-modal { align-items: flex-end; padding: 0; }
    .auth-modal .wl-modal-content { width: 100%; max-width: 100%; max-height: min(94svh, 100%); border-radius: 1rem 1rem 0 0; transform: translateY(100%); transition: transform .35s cubic-bezier(.32,.72,0,1); overflow-y: auto; }
    .auth-modal.active .wl-modal-content { transform: translateY(0); }
    .auth-modal.active.closing { opacity: 0; transition: opacity .25s; }
    .auth-modal.active.closing .wl-modal-content { transform: translateY(100%); transition: transform .25s cubic-bezier(.25,.46,.45,.94); }
    .auth-modal .wl-modal-handle { display: flex; justify-content: center; align-items: center; height: 28px; flex-shrink: 0; cursor: grab; position: sticky; top: 0; z-index: 2; margin-bottom: -28px; touch-action: none; }
    .auth-modal .wl-modal-handle::before { content: ''; width: 36px; height: 4px; background: #d1d5db; border-radius: 2px; }
    .auth-panel { padding: 3.5rem 1.125rem 1.5rem; }
    .auth-close { width: 36px; height: 36px; top: 10px; right: 10px; }
    .auth-name-row { grid-template-columns: 1fr; gap: .75rem; }
    .auth-options { align-items: flex-start; gap: .625rem; flex-direction: column; }
    .auth-social { gap: .625rem; }
    .auth-field input { height: 48px; padding: 14px 16px; font-size: .9375rem; }
    .auth-field-pass input { padding-right: 46px; }
    .auth-field label { left: 16px; font-size: .9375rem; }
    .auth-field input:focus + label,
    .auth-field input:not(:placeholder-shown) + label { font-size: .75rem; }
    .auth-submit { height: 44px; font-size: .9375rem; }
    .auth-social-btn { height: 42px; font-size: .875rem; }
    .auth-digit { width: 46px; height: 54px; font-size: 1.5rem; }
    .auth-otp-sep { width: 24px; height: 54px; font-size: 1.5rem; }
}
@media (min-width: 992px) {
    .auth-modal .wl-modal-content { width: min(1080px, 94vw); height: min(680px, 90svh); background: var(--c-surface, #fff); box-shadow: 0 25px 50px rgba(0,0,0,.25); overflow: hidden; }
    .auth-container { width: min(1080px, 94vw); height: min(680px, 90svh); }
    .auth-grid { display: grid; grid-template-columns: 1fr 1fr; width: 100%; height: 100%; }
    .auth-main { display: flex; flex-direction: column; overflow-y: auto; height: 100%; padding: 2rem 0; }
    .auth-panel { padding: 0 2.5rem; flex: 1; display: flex; flex-direction: column; justify-content: center; }
}
.auth-slider {
    position: relative;
    overflow: hidden;
    background: radial-gradient(120% 120% at 20% 0%, #1e1b4b 0%, #0b1020 45%, #050814 100%);
    color: #f8fafc;
    isolation: isolate;
}
.auth-slider::before {
    content: "";
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(40% 40% at 20% 30%, rgba(99, 102, 241, .35), transparent 70%),
        radial-gradient(35% 35% at 80% 70%, rgba(236, 72, 153, .28), transparent 70%),
        radial-gradient(45% 45% at 60% 20%, rgba(59, 130, 246, .22), transparent 70%);
    filter: blur(30px);
    opacity: .9;
    z-index: 0;
    animation: auth-slider-orb 18s ease-in-out infinite alternate;
    pointer-events: none;
}
.auth-slider::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at center, #000 40%, transparent 75%);
    opacity: .55;
    z-index: 1;
    pointer-events: none;
}
@keyframes auth-slider-orb {
    0%   { transform: translate3d(-2%, -1%, 0) scale(1); }
    50%  { transform: translate3d(3%, 2%, 0) scale(1.06); }
    100% { transform: translate3d(-3%, 1%, 0) scale(1.02); }
}
.auth-particle-canvas {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: block;
    background: transparent;
    cursor: crosshair;
    touch-action: none;
}
@media (min-width: 992px) {
    .auth-slider {
        display: block;
        height: 100%;
        padding: 0;
    }
}
