/**
 * Стили для страниц авторизации
 * Новый дизайн с фиолетовым фоном и градиентами
 * Полностью адаптивный
 * 
 * @package Istochnik_Referral
 */

/* =============================================
   ОБЩИЙ ЛЕЙАУТ АВТОРИЗАЦИИ
   ============================================= */
html,
body {
    margin: 0;
    padding: 0;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem clamp(1rem, 5vw, 3rem);
    background: #7F68E6;
    position: relative;
    overflow: hidden;
}

/* Дублируем reset внутри auth-блока, потому что на проде базовый reset может не применяться */
body.page-template-page-login,
body.page-template-page-register,
body.page-template-page-reset-password {
    margin: 0 !important;
    padding: 0 !important;
}

/* Фоновый эффект ауры */
.auth-page::before {
    content: '';
    position: absolute;
    width: min(50vw, 500px);
    height: min(50vw, 500px);
    left: 50%;
    top: 10%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(49, 181, 255, 0.3) 13.54%, rgba(255, 135, 200, 0.3) 100%);
    opacity: 0.5;
    filter: blur(100px);
    pointer-events: none;
}

.auth-container {
    width: 100%;
    max-width: min(95%, 600px);
    position: relative;
    z-index: 1;
}

/* =============================================
   КАРТОЧКА АВТОРИЗАЦИИ
   ============================================= */
.auth-card {
    background: rgba(0, 12, 27, 0.7);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: clamp(20px, 4vw, 40px);
    padding: clamp(2rem, 5vw, 3rem);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.auth-header {
    text-align: center;
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.auth-logo {
    max-width: clamp(120px, 30vw, 180px);
    height: auto;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.auth-title {
    font-family: 'TT Interfaces', 'Montserrat', sans-serif;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 400;
    color: #FFFFFF;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.auth-subtitle {
    font-family: 'TT Interfaces', 'Lato', sans-serif;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    letter-spacing: -0.01em;
}

/* =============================================
   ФОРМА АВТОРИЗАЦИИ
   ============================================= */
.auth-form {
    margin-bottom: 1.5rem;
}

.auth-form .form-group {
    width: 100%;
    margin-bottom: 1.25rem;
}

.auth-form .form-label {
    display: block;
    font-family: 'TT Interfaces', sans-serif;
    font-weight: 400;
    font-size: clamp(0.875rem, 2vw, 1rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.auth-form .form-control {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: clamp(0.75rem, 2vw, 1rem);
    font-size: clamp(0.875rem, 2vw, 1rem);
    font-family: 'TT Interfaces', sans-serif;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: clamp(12px, 2vw, 20px);
    color: #FFFFFF;
    transition: all 0.3s ease;
}

.auth-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.auth-form .form-control:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.auth-form .btn {
    margin-top: 1rem;
}

/* Группа полей в одной строке */
.auth-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(0.75rem, 2vw, 1rem);
}

@media (max-width: 580px) {
    .auth-form .form-row {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   КНОПКИ С ГРАДИЕНТОМ
   ============================================= */
.btn-primary,
.auth-form .btn-primary {
    width: 100%;
    padding: clamp(0.875rem, 2.5vw, 1.25rem) clamp(1.5rem, 4vw, 2rem);
    font-family: 'TT Interfaces', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-weight: 400;
    letter-spacing: -0.01em;
    color: #FFFFFF;
    background: radial-gradient(circle at 100% 33%, rgba(255, 255, 255, 0.2) 0%, transparent 100%),
                radial-gradient(circle at 31% 23%, rgba(82, 0, 255, 0.8) 0%, transparent 100%),
                radial-gradient(ellipse 190% 191% at 60% 40%, #31B5FF 13.54%, #FF87C8 100%);
    border: none;
    border-radius: clamp(25px, 5vw, 41px);
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary:hover,
.auth-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(49, 181, 255, 0.4);
}

.btn-primary:active,
.auth-form .btn-primary:active {
    transform: translateY(0);
}

/* =============================================
   ЧЕКБОКС "ЗАПОМНИТЬ МЕНЯ"
   ============================================= */
.auth-remember {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.auth-remember .form-check {
    margin-bottom: 0;
}

.auth-remember .form-check-label {
    color: rgba(255, 255, 255, 0.9);
    font-family: 'TT Interfaces', sans-serif;
    font-size: clamp(0.875rem, 2vw, 0.95rem);
}

.auth-remember .form-check-input {
    border-color: rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
}

.auth-remember .form-check-input:checked {
    background: radial-gradient(circle at 60% 40%, #31B5FF 13.54%, #FF87C8 100%);
    border-color: transparent;
}

.auth-forgot-link {
    font-family: 'TT Interfaces', sans-serif;
    font-size: clamp(0.875rem, 2vw, 0.95rem);
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
    letter-spacing: -0.01em;
}

.auth-forgot-link:hover {
    color: #FFFFFF;
    opacity: 1;
}

/* =============================================
   ПОДВАЛ КАРТОЧКИ
   ============================================= */
.auth-footer {
    text-align: center;
    padding-top: clamp(1.25rem, 3vw, 1.5rem);
}

.auth-footer-logo {
    max-width: clamp(100px, 25vw, 150px);
    height: auto;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.auth-footer-logo:hover {
    opacity: 0.7;
}

.auth-footer p {
    font-family: 'TT Interfaces', sans-serif;
    font-size: clamp(0.875rem, 2vw, 1rem);
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    letter-spacing: -0.01em;
}

.auth-footer a {
    color: #FFFFFF;
    font-weight: 400;
    text-decoration: underline;
}

.auth-footer a:hover {
    opacity: 0.8;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-family: 'TT Interfaces', sans-serif;
    font-size: clamp(0.875rem, 2vw, 0.95rem);
    transition: color 0.2s ease;
}

.auth-back-link:hover {
    color: #FFFFFF;
}

.auth-back-link svg {
    width: clamp(14px, 3vw, 16px);
    height: clamp(14px, 3vw, 16px);
}

/* Форма 2FA */
.form-control-code {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    text-align: center;
    letter-spacing: clamp(0.3rem, 1vw, 0.5rem);
    font-family: 'TT Interfaces', 'Montserrat', sans-serif;
    font-weight: 600;
    color: #FFFFFF;
}

.auth-resend-code {
    text-align: center;
    margin-top: 1rem;
}

.auth-resend-code .btn-ghost {
    color: rgba(255, 255, 255, 0.7);
    font-family: 'TT Interfaces', sans-serif;
    font-size: clamp(0.875rem, 2vw, 0.95rem);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    padding: clamp(0.5rem, 1.5vw, 0.75rem) clamp(1rem, 3vw, 1.5rem);
    border-radius: clamp(20px, 4vw, 30px);
    transition: all 0.3s ease;
}

.auth-resend-code .btn-ghost:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.auth-resend-code .btn-ghost:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =============================================
   ВАЛИДАЦИЯ ПАРОЛЯ
   ============================================= */
.password-requirements {
    margin-top: 0.75rem;
    padding: clamp(0.75rem, 2vw, 1rem);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: clamp(12px, 2vw, 20px);
}

.password-requirements-title {
    font-family: 'TT Interfaces', 'Lato', sans-serif;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
}

.password-requirement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'TT Interfaces', sans-serif;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.25rem;
}

.password-requirement:last-child {
    margin-bottom: 0;
}

.password-requirement i {
    width: clamp(14px, 3vw, 16px);
    height: clamp(14px, 3vw, 16px);
    flex-shrink: 0;
}

.password-requirement.valid {
    color: #31B5FF;
}

.password-requirement.valid i {
    color: #31B5FF;
}

.password-requirement.invalid {
    color: #FF87C8;
}

.password-requirement.invalid i {
    color: #FF87C8;
}

/* =============================================
   ПОКАЗАТЬ/СКРЫТЬ ПАРОЛЬ
   ============================================= */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper .form-control {
    width: 100%;
    padding-right: clamp(2.5rem, 8vw, 3rem);
}

.password-toggle {
    position: absolute;
    right: clamp(0.5rem, 2vw, 0.75rem);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: #FFFFFF;
}

.password-toggle i {
    width: clamp(18px, 4vw, 20px);
    height: clamp(18px, 4vw, 20px);
}

/* =============================================
   АЛЕРТЫ АВТОРИЗАЦИИ
   ============================================= */
.auth-alert {
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    font-family: 'TT Interfaces', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.auth-alert svg,
.auth-alert i {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-top: 0;
}

.auth-alert-success {
    background: rgba(49, 181, 255, 0.15);
    color: #FFFFFF;
    border: 1px solid rgba(49, 181, 255, 0.3);
}

.auth-alert-success svg {
    color: #31B5FF;
}

.auth-alert-error {
    background: rgba(255, 87, 135, 0.15);
    color: #FFFFFF;
    border: 1px solid rgba(255, 87, 135, 0.3);
}

.auth-alert-error svg {
    color: #FF5787;
}

.auth-alert-info {
    background: rgba(82, 0, 255, 0.15);
    color: #FFFFFF;
    border: 1px solid rgba(82, 0, 255, 0.3);
}

.auth-alert-info svg {
    color: #5200FF;
}

/* =============================================
   ЭТАПЫ ВОССТАНОВЛЕНИЯ ПАРОЛЯ
   ============================================= */
.reset-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.reset-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Lato', sans-serif;
    font-size: 0.875rem;
    color: #999999;
}

.reset-step-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #E0E0E0;
    color: #666666;
    border-radius: 50%;
    font-size: clamp(0.7rem, 2vw, 0.75rem);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
}

.reset-step.active {
    color: #FFFFFF;
}

.reset-step.active .reset-step-number {
    background: radial-gradient(circle at 60% 40%, #31B5FF 13.54%, #FF87C8 100%);
    color: #FFFFFF;
}

.reset-step.completed .reset-step-number {
    background: #31B5FF;
    color: #FFFFFF;
}

.reset-step-divider {
    width: clamp(30px, 8vw, 40px);
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
}

.reset-step-divider.completed {
    background: #31B5FF;
}

/* =============================================
   АЛЕРТЫ
   ============================================= */
.alert {
    padding: clamp(0.75rem, 2vw, 1rem);
    border-radius: clamp(8px, 2vw, 12px);
    margin-bottom: 1rem;
    font-family: 'TT Interfaces', sans-serif;
    font-size: clamp(0.875rem, 2vw, 0.95rem);
}

.alert-success {
    background: rgba(49, 181, 255, 0.15);
    border: 1px solid rgba(49, 181, 255, 0.3);
    color: #31B5FF;
}

.alert-error {
    background: rgba(255, 135, 200, 0.15);
    border: 1px solid rgba(255, 135, 200, 0.3);
    color: #FF87C8;
}

.alert-info {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

/* =============================================
   АДАПТИВНОСТЬ
   ============================================= */
@media (max-width: 768px) {
    .auth-page::before {
        width: 70vw;
        height: 70vw;
    }
}

@media (max-width: 580px) {
    .auth-card {
        padding: clamp(1.5rem, 5vw, 2rem);
        border-radius: clamp(16px, 4vw, 24px);
    }
    
    .auth-remember {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }
    
    .reset-steps {
        flex-wrap: wrap;
        gap: clamp(0.5rem, 2vw, 1rem);
    }
    
    .reset-step-divider {
        width: clamp(20px, 5vw, 30px);
    }
}

@media (max-width: 400px) {
    .auth-page {
        padding: 1rem;
    }
}
