/* auth.css - Premium Dark & Gold Edition (Full Adaptive Version) */

:root {
    
    --accent-gold: linear-gradient(135deg, #ffd700 0%, #b8860b 100%);
    --gold-text: #f3cf7a;
}

.auth-container {
    /* Тот самый фон, который тебе понравился */
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at center, rgba(184, 134, 11, 0.15) 0%, transparent 70%),
        url('https://www.transparenttextures.com/patterns/carbon-fibre.png'); 
    
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    overflow-y: auto;
}

.auth-box {
    /* Темная панель с золотистым свечением */
    background: #151515;
    border: 1px solid #333;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(184, 134, 11, 0.1);
    width: 100%;
    max-width: 400px;
    min-height: 500px;
    max-height: 70vh;
    margin: 15px;
    overflow: hidden;
    animation: fadeIn 0.5s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}



.auth-header {
    background: transparent;
    color: #ffffff;
    padding: 25px 20px;
    text-align: center;
    flex-shrink: 0;
}

.auth-header h1 {
    font-size: 24px;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gold-text); /* Золотой заголовок */
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.auth-header p {
    color: #888;
    opacity: 0.9;
    font-size: 13px;
    line-height: 1.4;
}

.auth-logo {
    margin-bottom: 15px;
}

.auth-logo img {
    height: 80px;
    width: auto;
}

.auth-tabs {
    display: flex;
    background: #0f0f0f;
    gap: 15px; 
    border-bottom: 1px solid #2a2a2a;
    flex-shrink: 0;
    padding: 10px 15px;
}

.tab-btn {
    padding: 16px 12px;
    border: none;
    background: none;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

.tab-btn.active {
    color: #000000;
    background: var(--accent-gold);
    border-bottom: 3px solid #856404;
    border-radius: 4px;
}

.auth-content {
    padding: 25px 20px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Кастомный скроллбар */
.auth-content::-webkit-scrollbar {
    width: 6px;
}

.auth-content::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 10px;
}

.auth-content::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 10px;
}

.auth-content::-webkit-scrollbar-thumb:hover {
    background: var(--gold-text);
}

.auth-form {
    display: none;
    animation: slideIn 0.3s ease;
    flex: 1;
    overflow: hidden;
}



.auth-form.active {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.form-group {
    margin-bottom: 18px;
    flex-shrink: 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--gold-text);
    font-weight: 500;
    font-size: 13px;
}

.form-input {
    width: 100%;
    padding: 14px 12px;
    border: 1.5px solid #333;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #252525;
    color: #fff;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--gold-text);
    background: #2a2a2a;
    box-shadow: 0 0 0 3px rgba(243, 207, 122, 0.1);
}

.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    z-index: 2;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.checkbox-group input {
    margin-top: 3px;
    min-width: 16px;
    min-height: 16px;
}

.checkbox-group label {
    font-size: 13px;
    color: #999;
    line-height: 1.4;
    flex: 1;
}

.auth-btn {
    width: 100%;
    padding: 16px;
    background: var(--accent-gold);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.auth-btn:hover:not(:disabled),
.auth-btn:active:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(184, 134, 11, 0.3);
}

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-footer {
    text-align: center;
    color: #888;
    font-size: 13px;
    margin-top: auto;
    padding-top: 20px;
    line-height: 1.5;
    flex-shrink: 0;
}

.auth-footer a {
    color: var(--gold-text);
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    padding: 2px 4px;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.error-message {
    color: #ff4d4d;
    font-size: 12px;
    margin-top: 4px;
    display: none;
    padding: 8px;
    background: rgba(220, 38, 38, 0.1);
    border-radius: 6px;
    border-left: 3px solid #dc2626;
    flex-shrink: 0;
}

.success-message {
    color: #2ecc71;
    font-size: 12px;
    margin-top: 4px;
    display: none;
    padding: 8px;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 6px;
    border-left: 3px solid #2ecc71;
    flex-shrink: 0;
}

/* Специфичные стили для формы регистрации */
#registerForm .form-group {
    margin-bottom: 15px;
}

#registerForm .checkbox-group {
    margin: 18px 0;
}

/* Адаптивные стили */
@media (max-height: 700px) {
    .auth-box { max-height: 98vh; }
    .auth-header { padding: 20px 15px; }
    .auth-content { padding: 20px 15px; }
    .form-group { margin-bottom: 15px; }
    .form-input { padding: 12px 10px; font-size: 15px; }
    .auth-btn { padding: 14px; margin-bottom: 15px; }
    h1 { font-size: 22px; }
    .auth-header p { font-size: 12px; }

    @media (max-height: 600px) {
        .auth-content { padding: 15px 12px; }
        .form-group { margin-bottom: 12px; }
        #registerForm .form-group { margin-bottom: 10px; }
        .checkbox-group { margin: 15px 0; }
        .auth-btn { padding: 12px; margin-bottom: 12px; }
        .auth-footer { padding-top: 15px; font-size: 12px; }
    }
}

@media (max-width: 320px) {
    .auth-box { margin: 10px; border-radius: 12px; max-height: 98vh; }
    .auth-header { padding: 15px 12px; }
    .auth-content { padding: 15px 12px; }
    .tab-btn { padding: 14px 8px; font-size: 14px; }
    .form-input { padding: 11px 10px; font-size: 15px; }
    .auth-btn { padding: 13px; font-size: 15px; }
}

@supports (-webkit-touch-callout: none) {
    .auth-container { min-height: -webkit-fill-available; }
}

@media screen and (max-width: 768px) {
    input, textarea, select { font-size: 16px !important; }
}

#registerForm .auth-footer {
    margin-top: 5px;
    padding-top: 5px;
}

#registerForm {
    overflow-y: auto;
    padding-right: 5px;
}

#registerForm::-webkit-scrollbar { width: 4px; }
#registerForm::-webkit-scrollbar-track { background: transparent; }
#registerForm::-webkit-scrollbar-thumb { background: rgba(243, 207, 122, 0.3); border-radius: 2px; }

.auth-form { padding-bottom: 10px; }
.auth-box { max-height: 96vh; }
.auth-form.active { display: flex; flex-direction: column; min-height: 100%; padding-bottom: 20px; }
.auth-form .auth-footer:last-child { margin-bottom: 5px; }
#registerForm { padding-bottom: 15px; }
#registerForm .auth-footer { margin-bottom: 5px; }

/* Золотая Пыль (Заменяет снежинки) */
.snowflakes {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    pointer-events: none; 
    /* ВАЖНО: z-index должен быть выше, чем у .auth-container (1000) */
    z-index: 9999; 
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10px;
    width: 3px; /* Сделал чуть заметнее */
    height: 3px;
    background: #ffd700;
    border-radius: 50%;
    opacity: 0.8;
    
    user-select: none;
    pointer-events: none;
    /* Усиленное свечение */
    box-shadow: 0 0 5px #ffd700, 0 0 10px #b8860b;
}



@keyframes glimmer {
    0%, 100% { opacity: 0.4; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.5); }
}

.form-input.error {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}