.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    will-change: opacity;
    contain: layout style paint;
}

.auth-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.auth-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.4);
    opacity: 0;
    transition: opacity .3s;
}

.auth-modal.active .auth-backdrop { 
    opacity: 1; 
}

.auth-container {
    position: relative;
    width: 100%;
    max-height: 90vh;
    background: var(--c-surface);
    border-radius: 1.5rem 1.5rem 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,.15);
    transform: translateY(100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    will-change: transform;
    backface-visibility: hidden;
    contain: layout style paint;
}

.auth-modal.active .auth-container {
    transform: translateY(0);
    transition: transform .4s cubic-bezier(.25,.46,.45,.94);
}

.auth-modal.closing .auth-container {
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.25,.46,.45,.94);
}

.auth-drag-handle {
    width: 100%;
    padding: 1rem 0 .5rem;
    display: flex;
    justify-content: center;
}

.auth-drag-handle::before {
    content: '';
    width: 36px;
    height: 4px;
    background: var(--c-border);
    border-radius: 2px;
}

.auth-panel {
    padding: 1rem 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.auth-panel::-webkit-scrollbar { 
    display: none; 
}

.auth-alert-container {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--c-surface);
    margin-bottom: 1rem;
}

.auth-alert-container:empty { 
    display: none; 
}

.auth-alert {
    padding: .75rem 1rem;
    border-radius: .75rem;
    font-size: .875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: .625rem;
    animation: slideDown .3s;
    border: 1px solid;
}

.auth-alert::before {
    content: '';
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background-size: contain;
}

.auth-alert.error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.auth-alert.error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
}

.auth-alert.success {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.auth-alert.success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E");
}

@keyframes slideDown {
    from { transform: translate3d(0,-10px,0); opacity: 0; }
    to { transform: translate3d(0,0,0); opacity: 1; }
}

.auth-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: .375rem;
}

.auth-subtitle {
    font-size: .875rem;
    color: var(--c-text-muted);
    line-height: 1.5;
}

.auth-timer {
    font-size: .9375rem;
    color: var(--c-primary);
    font-weight: 600;
    margin-top: .625rem;
    transition: color .3s;
}

.auth-timer span {
    font-weight: 700;
    font-size: 1.125rem;
    display: inline-block;
    min-width: 65px;
    transition: transform .2s;
    font-variant-numeric: tabular-nums;
}

.auth-timer.warning { 
    color: #f59e0b; 
}

.auth-timer.danger { 
    color: #ef4444; 
    animation: pulse 1s infinite; 
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .7; }
}

.auth-social {
    display: flex;
    gap: .875rem;
    margin-bottom: 1rem;
}

.auth-social:empty {
    display: none;
    margin-bottom: 0;
}

.social-btn {
    flex: 1;
    height: 46px;
    border: 1px solid var(--c-border);
    border-radius: .5rem;
    background: var(--c-surface);
    color: var(--c-text);
    font-weight: 600;
    font-size: .9375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .625rem;
    transition: transform .2s, background .2s;
}

.social-btn:hover {
    background: var(--c-surface-alt);
    transform: translate3d(0,-2px,0);
}

.auth-divider {
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
    display: none;
    align-items: center;
    justify-content: center;
}

.auth-divider.show { 
    display: flex; 
}

.auth-divider span {
    background: var(--c-surface);
    padding: 0 1rem;
    color: var(--c-text-muted);
    font-size: .8125rem;
    position: relative;
    z-index: 1;
}

.auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--c-border);
    transform: translateY(-50%);
}

.floating-group {
    position: relative;
    margin-bottom: .875rem;
}

.auth-input {
    width: 100%;
    height: 54px;
    padding: 16px 18px;
    font-size: 1rem;
    border: 1.5px solid var(--c-border);
    border-radius: .5rem;
    background: var(--c-surface);
    transition: border-color .2s, box-shadow .2s;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.has-toggle .auth-input { 
    padding-right: 50px; 
}

.auth-input:focus {
    border-color: var(--c-text);
    outline: none;
}

.floating-label {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--c-text-muted);
    pointer-events: none;
    transition: all .2s;
    background: transparent;
    padding: 0 4px;
}

.floating-label small {
    font-size: .8125rem;
    opacity: .7;
}

.auth-input:focus + .floating-label,
.auth-input:not(:placeholder-shown) + .floating-label {
    top: 0;
    font-size: .8125rem;
    color: var(--c-text);
    background: var(--c-surface);
    font-weight: 600;
}

.password-toggle {
    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);
    cursor: pointer;
    border-radius: .25rem;
    transition: background .2s, color .2s;
}

.password-toggle:hover {
    background: var(--c-surface-alt);
    color: var(--c-text);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

.auth-input-wrapper.error .auth-input,
.auth-input-wrapper.error .auth-input:focus {
    border-color: #ef4444;
}

.auth-input-wrapper.error .floating-label {
    color: #ef4444;
}

.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: .8125rem;
}

.auth-link-btn {
    color: var(--c-text);
    font-weight: 600;
    font-size: .8125rem;
    padding: 0;
}

.auth-link-btn:hover { 
    text-decoration: underline; 
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    user-select: none;
}

.auth-checkbox input {
    position: absolute;
    opacity: 0;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--c-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    flex-shrink: 0;
}

.auth-checkbox input:checked + .checkbox-custom {
    background: var(--c-text);
    border-color: var(--c-text);
}

.auth-checkbox input:checked + .checkbox-custom::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid var(--c-bg);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.auth-checkbox.error .checkbox-custom {
    border-color: #ef4444;
    animation: shake .5s;
}

.checkbox-label {
    font-size: .875rem;
    color: var(--c-text-muted);
}

.auth-submit-btn {
    width: 100%;
    height: 48px;
    background: var(--c-text);
    color: var(--c-bg);
    border-radius: .5rem;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .75rem;
    transition: transform .2s, box-shadow .2s, opacity .2s;
}

.auth-submit-btn:hover {
    transform: translate3d(0,-2px,0);
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    opacity: .9;
}

.auth-submit-btn.shake { 
    animation: shake .5s; 
}

.auth-footer {
    text-align: center;
    font-size: .875rem;
    color: var(--c-text-muted);
    margin-top: .5rem;
}

.auth-footer button {
    color: var(--c-text);
    font-weight: 700;
    padding: 0 .375rem;
}

.auth-name-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .875rem;
    margin-bottom: .875rem;
}

.auth-name-row .floating-group { 
    margin-bottom: 0; 
}

.verify-code-wrapper {
    display: flex;
    gap: .625rem;
    justify-content: center;
    align-items: center;
    padding: 1rem 0;
}

.verify-digit {
    width: 52px;
    height: 60px;
    text-align: center;
    font-size: 1.625rem;
    font-weight: 700;
    border: 2px solid var(--c-border);
    border-radius: .5rem;
    background: var(--c-surface-alt);
    color: var(--c-text);
    transition: border-color .2s, box-shadow .2s, transform .2s;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.verify-digit:focus {
    border-color: var(--c-text);
    outline: none;
    transform: scale(1.05);
}

.verify-digit:not(:placeholder-shown) {
    border-color: var(--c-primary);
}

.verify-input-large {
    width: 60px;
    height: 68px;
    font-size: 1.875rem;
}

.verify-digit-wrapper,
.verify-separator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 60px;
    font-size: 1.625rem;
    font-weight: 600;
    color: var(--c-text-muted);
}

.text-center-mb {
    text-align: center;
    margin-bottom: .75rem;
}

@keyframes shake {
    0%, 100% { transform: translate3d(0,0,0); }
    10%, 90% { transform: translate3d(-2px,0,0); }
    20%, 80% { transform: translate3d(4px,0,0); }
    30%, 50%, 70% { transform: translate3d(-6px,0,0); }
    40%, 60% { transform: translate3d(6px,0,0); }
}

@media (max-width: 991px) {
    .auth-slider-col,
    .auth-close-btn { 
        display: none; 
    }
    
    .auth-input {
        height: 48px;
        padding: 14px 16px;
        font-size: .9375rem;
    }
    
    .has-toggle .auth-input { 
        padding-right: 46px; 
    }
    
    .floating-label {
        left: 16px;
        font-size: .9375rem;
    }
    
    .auth-input:focus + .floating-label,
    .auth-input:not(:placeholder-shown) + .floating-label {
        font-size: .75rem;
    }
    
    .auth-submit-btn {
        height: 44px;
        font-size: .9375rem;
    }
    
    .social-btn {
        height: 42px;
        font-size: .875rem;
    }
    
    .verify-digit {
        width: 46px;
        height: 54px;
        font-size: 1.5rem;
    }
    
    .verify-input-large {
        width: 52px;
        height: 60px;
        font-size: 1.75rem;
    }
    
    .verify-digit-wrapper,
    .verify-separator {
        width: 24px;
        height: 54px;
        font-size: 1.5rem;
    }
}

@media (min-width: 992px) {
    .auth-modal { 
        align-items: center;
        padding: 0;
    }

    .auth-container {
        width: 1000px;
        height: 600px;
        border-radius: 1rem;
        transform: translate3d(0,0,0);
        transition: none;
        opacity: 0;
        pointer-events: none;
    }

    .auth-modal.active .auth-container {
        opacity: 1;
        pointer-events: auto;
        transition: opacity .3s;
    }

    .auth-close-btn {
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
        z-index: 20;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--c-surface);
        border: 1px solid var(--c-border);
        border-radius: 50%;
        cursor: pointer;
        color: var(--c-text);
        box-shadow: 0 2px 8px rgba(0,0,0,.1);
        transition: transform .2s;
    }

    .auth-close-btn:hover {
        transform: scale(1.1) rotate(90deg);
    }

    .auth-drag-handle { 
        display: none; 
    }

    .auth-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        height: 100%;
    }

    .auth-main-col {
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        height: 100%;
        padding: 2rem 0;
    }

    .auth-panel {
        padding: 0 2.5rem;
        width: 100%;
        max-width: 100%;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .auth-slider-col {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        padding: 0;
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    }

    .auth-slider-wrapper {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 2rem;
        overflow: hidden;
        position: relative;
    }

    .auth-slider-track {
        position: relative;
        width: 100%;
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .auth-slide {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1.5rem;
        opacity: 0;
        transform: translate3d(-60px,0,0);
        transition: all .7s cubic-bezier(.4,0,.2,1);
        pointer-events: none;
    }

    .auth-slide.active {
        opacity: 1;
        transform: translate3d(0,0,0);
        pointer-events: auto;
    }

    .slider-badge {
        background: rgba(255,255,255,.12);
        padding: 8px 18px;
        border-radius: 50px;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 1.2px;
        border: 1px solid rgba(255,255,255,.25);
        color: #fff;
        text-transform: uppercase;
        backdrop-filter: blur(10px);
        transition: all .5s cubic-bezier(.4,0,.2,1) .15s;
        transform: translate3d(-30px,0,0);
        opacity: 0;
    }

    .auth-slide.active .slider-badge {
        background: rgba(255,255,255,.2);
        border-color: rgba(255,255,255,.4);
        transform: translate3d(0,0,0);
        opacity: 1;
    }

    .slider-title {
        font-size: 2rem;
        font-weight: 800;
        line-height: 1.2;
        margin: 0;
        color: #fff;
        text-align: center;
        letter-spacing: -.5px;
        transition: all .6s cubic-bezier(.4,0,.2,1) .25s;
        transform: translate3d(-40px,0,0);
        opacity: 0;
    }

    .auth-slide.active .slider-title {
        transform: translate3d(0,0,0);
        opacity: 1;
    }

    .slider-desc {
        font-size: 1rem;
        color: rgba(255,255,255,.8);
        line-height: 1.6;
        max-width: 380px;
        text-align: center;
        transition: all .7s cubic-bezier(.4,0,.2,1) .35s;
        transform: translate3d(-50px,0,0);
        opacity: 0;
    }

    .auth-slide.active .slider-desc {
        transform: translate3d(0,0,0);
        opacity: 1;
    }

    .slider-dots {
        display: flex;
        gap: 12px;
        margin-top: 2rem;
        justify-content: center;
        align-items: center;
    }

    .slider-dots .dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: rgba(255,255,255,.25);
        cursor: pointer;
        transition: all .4s cubic-bezier(.34,.1,.68,.55);
        border: 2px solid transparent;
        flex-shrink: 0;
    }

    .slider-dots .dot:hover {
        background: rgba(255,255,255,.4);
        transform: scale(1.2);
    }

    .slider-dots .dot.active {
        background: #fff;
        width: 28px;
        border-radius: 6px;
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255,255,255,.3);
    }
}