/* ===== АВТОРИЗАЦИЯ ===== */

/* Оверлей */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: authFadeIn 0.5s ease;
}

@keyframes authFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Модальное окно */
.auth-modal {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: radial-gradient(ellipse at 50% 0%, #1a0d10, #0a0508);
    border: 1px solid rgba(255, 50, 50, 0.1);
    border-radius: 32px;
    padding: 32px 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 60px rgba(255, 50, 50, 0.05);
    position: relative;
    scrollbar-width: thin;
}

.auth-modal::-webkit-scrollbar {
    width: 3px;
}
.auth-modal::-webkit-scrollbar-thumb {
    background: #ff444466;
    border-radius: 10px;
}

/* Логотип */
.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.auth-logo img {
    height: 36px;
    width: auto;
    filter: drop-shadow(0 0 20px rgba(255, 50, 50, 0.2));
}

.auth-logo span {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b6b, #e63946);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* Приветствие */
.auth-welcome {
    text-align: center;
    margin-bottom: 28px;
}

.auth-welcome h2 {
    font-size: 22px;
    font-weight: 300;
    color: #f0e8e8;
    margin-bottom: 8px;
}

.auth-welcome h2 span {
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b6b, #e63946);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-welcome p {
    color: #9a858a;
    font-size: 14px;
    line-height: 1.5;
}

.auth-desc {
    margin-top: 10px;
    padding: 12px 16px;
    background: rgba(255, 50, 50, 0.03);
    border-radius: 12px;
    border-left: 3px solid #ff6b6b;
    font-size: 13px !important;
    color: #b5a0a0 !important;
}

/* Табы */
.auth-tabs {
    display: flex;
    gap: 0;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #8a757a;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    position: relative;
}

.auth-tab.active {
    color: #ff6b6b;
    background: rgba(255, 50, 50, 0.05);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: #ff6b6b;
    border-radius: 2px;
}

.auth-tab:active {
    transform: scale(0.97);
}

/* Панели */
.auth-panel {
    display: none;
    animation: panelIn 0.3s ease;
}

.auth-panel.active {
    display: block;
}

@keyframes panelIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Поля ввода */
.auth-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 0 16px;
    margin-bottom: 12px;
    transition: border-color 0.3s, box-shadow 0.3s;
    position: relative;
}

.auth-input-group:focus-within {
    border-color: rgba(255, 50, 50, 0.3);
    box-shadow: 0 0 20px rgba(255, 50, 50, 0.05);
}

.auth-input-group i {
    color: #6a555a;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.auth-input-group input {
    flex: 1;
    padding: 14px 0;
    background: transparent;
    border: none;
    color: #f0e8e8;
    font-size: 15px;
    outline: none;
    font-family: inherit;
}

.auth-input-group input::placeholder {
    color: #6a555a;
}

.auth-toggle-password {
    background: none;
    border: none;
    color: #6a555a;
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: color 0.2s;
}

.auth-toggle-password:active {
    color: #ff6b6b;
}

/* Чекбокс согласия */
.auth-agreement {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 12px 0 16px 0;
}

.auth-agreement input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #ff6b6b;
    cursor: pointer;
    flex-shrink: 0;
}

.auth-agreement label {
    font-size: 13px;
    color: #8a757a;
    line-height: 1.4;
    cursor: pointer;
}

.auth-agreement label a {
    color: #ff6b6b;
    text-decoration: none;
}

.auth-agreement label a:active {
    opacity: 0.7;
}

/* Кнопка отправки */
.auth-submit {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #ff6b6b, #e63946);
    border: none;
    border-radius: 16px;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(255, 50, 50, 0.2);
    font-family: inherit;
    margin-top: 4px;
}

.auth-submit:active {
    transform: scale(0.97);
}

.auth-submit.loading {
    opacity: 0.7;
    pointer-events: none;
}

.auth-submit.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Ошибки */
.auth-error {
    color: #ff4444;
    font-size: 13px;
    margin-top: 10px;
    text-align: center;
    min-height: 20px;
}

/* Футер */
.auth-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    color: #4a3a3a;
    font-size: 12px;
}

.auth-version {
    color: #6a555a;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 420px) {
    .auth-modal {
        padding: 24px 16px;
        border-radius: 24px;
    }
    .auth-logo span {
        font-size: 22px;
    }
    .auth-welcome h2 {
        font-size: 19px;
    }
    .auth-welcome p {
        font-size: 13px;
    }
    .auth-input-group input {
        font-size: 14px;
        padding: 12px 0;
    }
    .auth-tab {
        font-size: 14px;
        padding: 10px 12px;
    }
    .auth-submit {
        font-size: 15px;
        padding: 14px;
    }
}