* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #40c9ff;
    --primary-rgb: 64, 201, 255;
    --accent: #6366f1;
    --accent-rgb: 99, 102, 241;
    --bg-dark: #03030b;
    --glass: rgba(25, 25, 45, 0.75);
    --glass-border: rgba(255, 255, 255, 0.12);
    --vk-blue: #4c75a3;
    --vk-blue-rgb: 76, 117, 163;
    --text-main: #ffffff;
    --text-dim: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
    --motion-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --motion-fast: 180ms;
    --motion-base: 260ms;
    --motion-slow: 360ms;
}

@font-face {
    font-family: "Google Sans";
    src: local("Google Sans"), local("Product Sans");
    font-style: normal;
    font-weight: 300 900;
}

* {
    box-sizing: border-box;
}

body.auth-page {
    margin: 0;
    padding: 0;
    background: var(--bg-dark);
    font-family: 'Google Sans', 'Inter', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

body.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 15% 15%, rgba(var(--primary-rgb), 0.15) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(var(--accent-rgb), 0.15) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(10, 10, 30, 1) 0%, var(--bg-dark) 100%);
    z-index: -1;
}

.stars-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    opacity: 0.5;
    animation: starTwinkle 3s infinite;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.auth-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 24px;
}

.auth-card {
    background: var(--glass);
    backdrop-filter: blur(40px) saturate(160%);
    -webkit-backdrop-filter: blur(40px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 32px 36px 24px;
    box-shadow: 
        0 30px 100px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 40px rgba(var(--primary-rgb), 0.1);
    text-align: center;
    animation: cardAppear 1s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardAppear {
    from { opacity: 0; transform: translateY(40px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-header {
    margin-bottom: 24px;
}

.auth-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 15px rgba(var(--primary-rgb), 0.4));
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
    background: linear-gradient(to bottom, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header p {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.warning-text {
    margin-top: 12px !important;
    color: rgba(255, 183, 77, 0.8) !important;
    font-size: 0.75rem !important;
    font-weight: 500;
    padding: 8px 12px;
    background: rgba(255, 183, 77, 0.05);
    border: 1px solid rgba(255, 183, 77, 0.1);
    border-radius: 10px;
    display: block;
    width: 100%;
}

.otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.otp-inputs input {
    width: 44px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    transition: background-color var(--motion-base) var(--motion-ease), border-color var(--motion-base) var(--motion-ease), box-shadow var(--motion-base) var(--motion-ease), transform var(--motion-base) var(--motion-ease);
    outline: none;
    font-family: inherit;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.otp-inputs input:focus {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--primary);
    box-shadow: 
        0 0 20px rgba(var(--primary-rgb), 0.25),
        0 0 0 3px rgba(var(--primary-rgb), 0.15);
    transform: translateY(-2px) scale(1.03);
}

.otp-inputs input.filled {
    background: rgba(var(--primary-rgb), 0.15);
    border-color: var(--primary);
    border-width: 2px;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.2);
    animation: otpSettle var(--motion-base) var(--motion-ease);
    text-shadow: 
        0 0 8px rgba(var(--primary-rgb), 0.8),
        2px 0 0 rgba(255, 0, 80, 0.5),
        -2px 0 0 rgba(0, 255, 255, 0.5);
}

@keyframes otpSettle {
    0% {
        transform: translateY(2px) scale(0.98);
        opacity: 0.9;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.auth-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#verify-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #fff 0%, #e2e8f0 100%);
    color: #030712;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform var(--motion-base) var(--motion-ease), box-shadow var(--motion-base) var(--motion-ease), background-color var(--motion-base) var(--motion-ease), color var(--motion-base) var(--motion-ease), opacity var(--motion-fast) var(--motion-ease);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

#verify-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.2);
    background: #fff;
}

#verify-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
}

#verify-btn.state-success {
    background: var(--success);
    color: #fff;
}

#verify-btn.state-success:not(:disabled):hover {
    background: #059669; 
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.3);
}

#verify-btn.state-error {
    background: var(--error);
    color: #fff;
}

#verify-btn.state-error:not(:disabled):hover {
    background: #dc2626; 
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.3);
}

.help-text {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.help-text span {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.vk-group-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: rgba(var(--vk-blue-rgb), 0.1);
    border: 1px solid rgba(var(--vk-blue-rgb), 0.2);
    border-radius: 12px;
    color: #8daed5;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color var(--motion-slow) var(--motion-ease), border-color var(--motion-slow) var(--motion-ease), color var(--motion-slow) var(--motion-ease), transform var(--motion-slow) var(--motion-ease), box-shadow var(--motion-slow) var(--motion-ease);
    position: relative;
    overflow: hidden;
}

.vk-group-btn:hover {
    background: rgba(var(--vk-blue-rgb), 0.25);
    border-color: var(--vk-blue);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(var(--vk-blue-rgb), 0.2);
}

.vk-group-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left var(--motion-slow) var(--motion-ease);
}

.vk-group-btn:hover::after {
    left: 100%;
}

.btn-icon-svg {
    width: 20px;
    height: 20px;
    opacity: 0.8;
    filter: brightness(0) invert(1); 
    transition: transform var(--motion-base) var(--motion-ease), opacity var(--motion-base) var(--motion-ease);
}

.vk-group-btn:hover .btn-icon-svg {
    opacity: 1;
    transform: scale(1.1);
}

.auth-status {
    min-height: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 4px;
}

.auth-status.error { color: var(--error); }
.auth-status.success { color: var(--success); }

.otp-inputs input {
    animation: fadeInUp 0.4s ease-out;
    animation-fill-mode: both;
}

.otp-inputs input:nth-child(1) { animation-delay: 0.1s; }
.otp-inputs input:nth-child(2) { animation-delay: 0.15s; }
.otp-inputs input:nth-child(3) { animation-delay: 0.2s; }
.otp-inputs input:nth-child(4) { animation-delay: 0.25s; }
.otp-inputs input:nth-child(5) { animation-delay: 0.3s; }
.otp-inputs input:nth-child(6) { animation-delay: 0.35s; }

#verify-btn {
    position: relative;
    overflow: hidden;
}

#verify-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#verify-btn:hover::before {
    width: 400px;
    height: 400px;
}

.auth-header {
    animation: fadeInDown 0.6s ease-out 0.2s both;
}

.auth-logo {
    animation: scaleIn 0.5s ease-out 0.3s both;
    transition: transform 0.3s ease;
}

.auth-logo:hover {
    transform: scale(1.1) rotate(5deg);
}

* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 0ms !important;
        transition-delay: 0ms !important;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 40px 24px;
    }
    .otp-inputs {
        gap: 6px;
    }
    .otp-inputs input {
        width: 40px;
        height: 44px;
        font-size: 1.25rem;
    }
}
