/* Стили для форм авторизации и регистрации */

body:has(.auth-wrapper) {
    background: radial-gradient(circle at top right, #033578, #001f48) !important;
    min-height: 100vh;
}

body:has(.auth-wrapper) .main-content,
body:has(.auth-wrapper) .main-content > .container {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
}

.auth-wrapper {
    margin-top: 60px !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #fff;
    border-radius: 12px;
}

/* Общие стили форм */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 15px;
}

button.button-primary.full-width {
    justify-content: center;
}

.auth-form {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-top: 15px;
}

/* Стили для полей пароля */
.password-group {
    position: relative;
    width: 100%;
    margin-bottom: 12px;
}

.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

/* Скрываем стандартную иконку глаза в Edge/IE, так как у нас есть своя */
input::-ms-reveal,
input::-ms-clear {
    display: none;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="tel"] {
    width: 100%;
    background-color: #f8f9fa;
    border: 2px solid #f1f5f9;
    border-radius: 6px;
    padding: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    height: 40px;
}

.auth-form input:focus {
    background-color: #fff;
    border-color: #747bf5;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: #6c757d;
    z-index: 10;
}

.password-toggle:hover {
    color: #747bf5;
}

.password-strength, .password-match-indicator {
    margin-top: 5px;
    height: 4px;
    border-radius: 2px;
    transition: all 0.3s;
}

.password-strength {
    background-color: #e9ecef;
}

.password-strength.weak {
    background-color: #dc3545;
    width: 33%;
}

.password-strength.medium {
    background-color: #ffc107;
    width: 66%;
}

.password-strength.strong {
    background-color: #28a745;
    width: 100%;
}

.password-hint {
    display: block;
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
}

.password-match-indicator.match {
    color: #28a745;
    font-size: 11px;
}

.password-match-indicator.no-match {
    color: #dc3545;
    font-size: 11px;
}

/* Стили для формы в целом */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.form-group {
    flex: 1;
    min-width: 100%;
    margin-bottom: 10px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
}

/* Стили для ссылок под формами */
.auth-links {
    text-align: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    font-size: 13px;
}

.auth-links a {
    color: #747bf5;
    text-decoration: none;
    margin: 0 5px;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Стили для полей ввода с иконками */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i:not(.fa-eye):not(.fa-eye-slash) {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    font-size: 14px;
    pointer-events: none;
}

.input-with-icon input {
    width: 100%;
    padding-left: 38px !important;
}

.input-with-icon .password-toggle {
    right: 12px;
}

.auth-header h1 {
    margin: 0;
    font-size: 20px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}

.form-actions {
    margin-top: 15px;
}

.button-primary.full-width {
    width: 100%;
    padding: 10px;
    font-size: 15px;
}

/* Стили для сообщений об успехе и ошибках */
.success-message, .error-message {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 13px;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Медиа-запросы для адаптивности */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 6px;
    }
    
    .form-group {
        width: 100%;
        min-width: 100%;
    }
    
    .auth-container {
        padding: 10px;
    }
    
    .auth-form {
        padding: 15px;
    }
}

/* Modern Auth Switcher */
.auth-wrapper {
    max-width: 400px;
    margin: 30px auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.06);
    overflow: hidden;
    position: relative;
}

.auth-wrapper .auth-header {
    display: flex;
    flex-direction: row; 
    align-items: center;
    background: #f8f9fa;
    padding: 4px;
    margin: 15px 15px 0;
    border-radius: 6px;
    position: relative;
    border: 1px solid #e9ecef;
}

/* Style for the internal header inside forms (Title + Description) */
.auth-form-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 1px solid #f1f5f9;
}

.auth-form-header h1 {
    font-size: 18px;
}

.auth-wrapper .auth-tab {
    flex: 1;
    text-align: center;
    padding: 8px;
    cursor: pointer;
    z-index: 2;
    font-weight: 600;
    font-size: 14px;
    color: #6c757d;
    transition: color 0.3s ease;
    border-radius: 4px;
    user-select: none;
}

.auth-wrapper .auth-tab.active {
    color: #747bf5;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.auth-wrapper .auth-tab:hover:not(.active) {
    color: #495057;
    background: rgba(255,255,255,0.5);
}

.auth-wrapper .auth-form-container {
    padding: 0 20px 20px;
}

/* Hide original headers since we use tabs */
.auth-wrapper .auth-form-container h1 {
    display: none;
}

/* Button enhancements */
.button-primary.full-width {
	background: radial-gradient(circle at top right, #1b5eb8, #00449e);
    /* background: linear-gradient(135deg, #747bf5, #6366f1); */
    border: none;
    padding: 10px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 6px;
}

.button-primary.full-width:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
			background: radial-gradient(circle at top right, #135dbd, #0355c1);
}

.button-primary.full-width:active {
    transform: translateY(0);
}

/* Hide old auth links inside form */
.auth-links {
    margin-top: 10px;
    font-size: 13px;
    color: #6c757d;
}

.auth-wrapper .auth-container {
    padding: 0;
    margin: 0;
    max-width: none;
}

.auth-wrapper .auth-form {
    box-shadow: none;
    padding: 15px 0 0;
    margin-top: 0;
}

/* Fade animation */
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.auth-fade-in {
    animation: fadeInScale 0.2s ease-out forwards;
}
