/* =============== AUTH STYLES =============== */

:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3d3d3d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --accent-primary: #6e44ff;
    --accent-secondary: #8b6fff;
    --accent-glow: rgba(110, 68, 255, 0.3);
    --shadow-dark: rgba(0, 0, 0, 0.3);
    --shadow-light: rgba(255, 255, 255, 0.05);
    --success: #00c853;
    --error: #ff4444;
    --warning: #ffbb33;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

#app {
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* ===== АВТОРИЗАЦИЯ ===== */
.auth-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: var(--accent-primary);
    filter: blur(150px);
    opacity: 0.15;
    animation: pulse-glow 8s infinite ease-in-out;
}

.auth-box {
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: 48px;
    width: 420px;
    z-index: 1;
    box-shadow: 20px 20px 60px var(--shadow-dark), -20px -20px 60px var(--shadow-light);
    animation: fadeIn 0.6s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    box-shadow: 0 8px 32px var(--accent-glow);
    animation: pulse-logo 2s infinite ease-in-out;
}

.logo-text {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
}

.auth-tabs {
    display: flex;
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 4px;
    margin-bottom: 32px;
    box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
}

.auth-tab {
    flex: 1;
    padding: 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.auth-tab.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: slideIn 0.4s ease;
}

.input-group {
    position: relative;
    margin-bottom: 24px;
}

.input-group i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 16px;
    z-index: 1;
}

.input-group input {
    width: 100%;
    padding: 16px 16px 16px 52px;
    background: var(--bg-primary);
    border: 2px solid transparent;
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 400;
    transition: all 0.3s ease;
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light),
                0 0 0 3px var(--accent-glow);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--accent-primary);
    border: none;
    border-radius: 14px;
    color: white;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 8px 24px var(--accent-glow);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(110, 68, 255, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger {
    width: 100%;
    padding: 16px;
    background: transparent;
    border: 2px solid var(--error);
    border-radius: 14px;
    color: var(--error);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 24px;
}

.btn-danger:hover {
    background: rgba(255, 68, 68, 0.1);
}

.verification-section {
    display: none;
}

.verification-section.active {
    display: block;
    animation: slideIn 0.4s ease;
}

.code-input-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

.code-input {
    width: 60px;
    height: 70px;
    background: var(--bg-primary);
    border: 2px solid transparent;
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}

.code-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light),
                0 0 0 3px var(--accent-glow);
}

.code-info {
    text-align: center;
    margin-bottom: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.code-info strong {
    color: var(--accent-primary);
}

.resend-link {
    color: var(--accent-primary);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.resend-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-footer span {
    color: var(--accent-primary);
    cursor: pointer;
}

#authMessage {
    color: var(--error);
    font-size: 14px;
    min-height: 20px;
}

/* ===== АНИМАЦИИ ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 0.15;
        transform: scale(1);
    }
    50% {
        opacity: 0.25;
        transform: scale(1.2);
    }
}

@keyframes pulse-logo {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .auth-box {
        width: 90%;
        padding: 32px;
    }
    
    .code-input {
        width: 45px;
        height: 55px;
        font-size: 24px;
    }
}