/* Стили для страниц аутентификации */

:root {
            --primary: #1a56db;
            --secondary: #0e2a52;
            --accent: #0d9488;
            --light: #f3f4f6;
            --dark: #111827;
            --success: #0e9f6e;
            --warning: #f05252;
        }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.auth-header p {
    font-size: 16px;
    color: #666;
    font-weight: 400;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: #6c757d;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--primary);
}

.back-link svg {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: #fafafa;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: #999;
}

.password-input {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input input {
    flex: 1;
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.password-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.eye-icon {
    width: 20px;
    height: 20px;
    fill: #666;
    transition: fill 0.2s ease;
}

.password-toggle:hover .eye-icon {
    fill: #333;
}

.form-hint {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.form-actions {
    margin-top: 2px;
}

.btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-text {
    transition: opacity 0.2s ease;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.form-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.link:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

.link-btn {
    background: none;
    border: none;
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
    font-family: inherit;
}

.link-btn:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

.error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-message::before {
    content: "⚠";
    font-size: 16px;
}

.success-message {
    background: #efe;
    border: 1px solid #cfc;
    color: #3c3;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.success-message::before {
    content: "✓";
    font-size: 16px;
}

/* Адаптивность */
@media (max-width: 480px) {
    .auth-card {
        padding: 24px;
        margin: 10px;
    }
    
    .auth-header h1 {
        font-size: 24px;
    }
    
    .auth-header p {
        font-size: 14px;
    }
    
    .form-links {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: fadeIn 0.5s ease-out;
}

/* Стили для инпутов с ошибками */
.form-group.error input {
    border-color: #e74c3c;
    background: #fdf2f2;
}

.form-group.error input:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Стили для успешных инпутов */
.form-group.success input {
    border-color: #27ae60;
    background: #f8fdf8;
}

.form-group.success input:focus {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

/* Стили для отключенных состояний */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Стили для фокуса на кнопках */
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Стили для ссылок в фокусе */
.link:focus,
.link-btn:focus {
    outline: none;
    text-decoration: underline;
}

/* Темная тема (опционально) */
@media (prefers-color-scheme: dark) {
    .auth-card {
        background: #1a1a1a;
        color: white;
    }
    
    .auth-header h1 {
        color: white;
    }
    
    .auth-header p {
        color: #ccc;
    }
    
    .form-group label {
        color: #ccc;
    }
    
    .form-group input {
        background: #2a2a2a;
        border-color: #444;
        color: white;
    }
    
    .form-group input:focus {
        background: #333;
        border-color: #667eea;
    }
    
    .form-group input::placeholder {
        color: #888;
    }
    
    .eye-icon {
        fill: #ccc;
    }
    
    .password-toggle:hover .eye-icon {
        fill: white;
    }
    
    .form-hint {
        color: #888;
    }
}

/* Стили для captcha */
.captcha-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 14px;
    color: #6c757d;
}

.captcha-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.captcha-loading span {
    font-weight: 500;
}

/* Секция captcha */
.captcha-section {
    margin: 0px 0;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.captcha-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

#captchaImage {
    max-width: 200px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#refreshCaptcha {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#refreshCaptcha:hover {
    background: #5a6268;
}

#refreshCaptcha:active {
    background: #495057;
}

/* Стили для поля ввода captcha */
#captchaInput {
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 2px;
    text-align: center;
}

#captchaInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Индикатор провайдера SMS */
#smsProviderInfo {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

#providerDisplay {
    font-weight: 600;
    color: #667eea;
    text-transform: uppercase;
}

/* Анимация для captcha загрузки */
@keyframes captchaPulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

.captcha-loading {
    animation: captchaPulse 2s ease-in-out infinite;
}

/* Стили для темной темы */
@media (prefers-color-scheme: dark) {
    .captcha-loading {
        background: #2d3748;
        border-color: #4a5568;
        color: #a0aec0;
    }
    
    .captcha-loading .spinner {
        border-color: #4a5568;
        border-top-color: #667eea;
    }
    
    .captcha-section {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    #captchaImage {
        border-color: #4a5568;
    }
    
    #refreshCaptcha {
        background: #4a5568;
    }
    
    #refreshCaptcha:hover {
        background: #2d3748;
    }
    
    #smsProviderInfo {
        color: #a0aec0;
    }
    
    #providerDisplay {
        color: #667eea;
    }
}

/* Стили для соглашения пользователя */
.agreement-group {
    margin-top: 0px;
    margin-bottom: 0px;
}

.agreement-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.agreement-container input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.agreement-label {
    font-size: 14px;
    color: #495057;
    line-height: 1.5;
    cursor: pointer;
    margin: 0;
    user-select: none;
}

.agreement-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.agreement-link:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

.agreement-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Стили для темной темы */
@media (prefers-color-scheme: dark) {
    .agreement-container {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .agreement-label {
        color: #e2e8f0;
    }
    
    .agreement-link {
        color: #667eea;
    }
    
    .agreement-link:hover {
        color: #5a6fd8;
    }
} 