* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2AABEE;
    --primary-dark: #1d8ec9;
    --primary-light: #d4eafc;
    --bg: #0a0a0a;
    --surface: #17212b;
    --surface-light: #1e2c3a;
    --text: #ffffff;
    --text-secondary: #8da3b8;
    --border: #253545;
    --danger: #e74c3c;
    --online: #2AABEE;
    --shadow: 0 2px 20px rgba(0,0,0,0.3);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg);
    height: 100vh;
    overflow: hidden;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a3d4f; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #3d5168; }

/* ============ АВТОРИЗАЦИЯ ============ */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(42, 171, 238, 0.1) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.auth-container::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(29, 142, 201, 0.1) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    border-radius: 50%;
    animation: float 6s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

.auth-card {
    background: var(--surface);
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border);
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-logo {
    text-align: center;
    font-size: 60px;
    margin-bottom: 25px;
    filter: drop-shadow(0 0 20px rgba(42, 171, 238, 0.3));
}

.auth-tabs {
    display: flex;
    background: var(--surface-light);
    border-radius: 14px;
    padding: 5px;
    margin-bottom: 25px;
    gap: 5px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    border-radius: 10px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    font-size: 14px;
}

.auth-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(42, 171, 238, 0.3);
}

.auth-card h2 {
    text-align: center;
    color: var(--text);
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
}

.form-group { margin-bottom: 15px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-card input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: 14px;
    font-size: 15px;
    outline: none;
    transition: var(--transition);
    background: var(--surface-light);
    color: var(--text);
    margin-bottom: 12px;
}

.auth-card input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(42, 171, 238, 0.1);
}

.auth-card input::placeholder { color: #4a5f70; }

.auth-card button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
    letter-spacing: 0.3px;
}

.auth-card button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(42, 171, 238, 0.3);
}

.auth-card button:active { transform: scale(0.98); }
.auth-card button:disabled {
    background: #2a3d4f;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.hidden { display: none !important; }

.message {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-size: 14px;
    display: none;
    animation: fadeIn 0.3s ease;
    font-weight: 500;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.error {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.2);
    display: block;
}

.message.success {
    background: rgba(42, 171, 238, 0.1);
    color: #2AABEE;
    border: 1px solid rgba(42, 171, 238, 0.2);
    display: block;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.7s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============ МОБИЛЬНАЯ АДАПТАЦИЯ ============ */
@media (max-width: 480px) {
    .auth-card {
        padding: 25px 20px;
        border-radius: 20px;
    }
    
    .auth-logo {
        font-size: 50px;
        margin-bottom: 15px;
    }
    
    .auth-card h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .auth-tab {
        padding: 10px;
        font-size: 13px;
    }
    
    .auth-card input {
        padding: 12px 14px;
        font-size: 16px;
    }
    
    .auth-card button {
        padding: 12px;
        font-size: 15px;
    }
    
    .message {
        font-size: 13px;
        padding: 10px 14px;
    }
}

/* Исправление для iOS */
@supports (-webkit-touch-callout: none) {
    .auth-card input {
        font-size: 16px !important;
    }
}