/* Стили для страниц авторизации */

.auth-main {
    min-height: calc(100vh - 80px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 0;
    display: flex;
    align-items: center;
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    justify-items: center;
}

/* Для страниц с двумя колонками (регистрация) */
@media (min-width: 768px) {
    .auth-container.two-columns {
        grid-template-columns: 1fr 1fr;
        align-items: start;
        justify-items: stretch;
    }
}

/* Для страниц с одной колонкой (вход) */
.auth-container.single.two-columns {
    max-width: 1000px;
}

.auth-container.single-column {
    max-width: 500px;
    justify-items: center;
}

.auth-container.single-column .auth-card {
    width: 100%;
    max-width: 500px;
}

/* Карточка авторизации */
.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    position: relative;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Форма */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.forgot-password-link {
    text-align: right;
    margin-top: 5px;
}

.forgot-password-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.forgot-password-link a:hover {
    text-decoration: underline;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 15px 45px 15px 45px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-icon {
    position: absolute;
    left: 15px;
    color: var(--text-secondary);
    z-index: 1;
}

.password-toggle {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.password-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

.field-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Кнопка */
.auth-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Футер формы */
.auth-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

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

/* Страница ошибки */
.auth-header.error {
    margin-bottom: 40px;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.error-message {
    color: var(--error-color);
    font-size: 1.1rem;
    margin-top: 15px;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.auth-actions .auth-btn {
    width: 100%;
}

.auth-actions .btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.auth-actions .btn-secondary:hover {
    background: var(--bg-tertiary);
}

/* Загрузка */
.auth-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.auth-loading p {
    margin: 0;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1rem;
    text-align: center;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Сообщения */
.auth-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    font-weight: 500;
    text-align: center;
}

.auth-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.auth-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Преимущества */
.auth-benefits {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.auth-benefits h3 {
    color: var(--text-primary);
    margin-bottom: 25px;
    text-align: center;
}

.benefits-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.benefit-item i {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-top: 2px;
}

.benefit-item strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 5px;
}

.benefit-item p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .auth-main {
        padding: 20px 0;
    }
    
    .auth-card {
        padding: 30px 20px;
        margin: 0 20px;
    }
    
    .demo-info,
    .auth-benefits {
        margin: 0 20px;
        padding: 20px;
    }
    
    .auth-header h1 {
        font-size: 1.5rem;
    }
    
    .input-wrapper input {
        padding: 12px 40px 12px 40px;
    }
}

/* ===================================
   DARK THEME SUPPORT
   =================================== */

[data-theme="dark"] .auth-main {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

[data-theme="dark"] .auth-card {
    background: var(--card-bg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .auth-header h1 {
    color: var(--text-primary);
}

[data-theme="dark"] .auth-header p {
    color: var(--text-secondary);
}

[data-theme="dark"] .form-group label {
    color: var(--text-primary);
}

[data-theme="dark"] .input-wrapper input {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .input-icon {
    color: var(--text-secondary);
}

[data-theme="dark"] .password-toggle {
    color: var(--text-secondary);
}

[data-theme="dark"] .password-toggle:hover {
    background: var(--bg-hover);
    color: var(--primary-color);
}

[data-theme="dark"] .field-hint {
    color: var(--text-secondary);
}

[data-theme="dark"] .auth-footer {
    border-top-color: var(--border-color);
}

[data-theme="dark"] .auth-footer p {
    color: var(--text-secondary);
}

[data-theme="dark"] .auth-footer a {
    color: var(--primary-color);
}

[data-theme="dark"] .auth-loading {
    background: rgba(26, 26, 46, 0.95);
}

[data-theme="dark"] .auth-loading p {
    color: var(--text-primary);
}

[data-theme="dark"] .auth-message.success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .auth-message.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .auth-benefits {
    background: var(--card-bg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .auth-benefits h3 {
    color: var(--text-primary);
}

[data-theme="dark"] .benefit-item {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .benefit-item strong {
    color: var(--text-primary);
}

[data-theme="dark"] .benefit-item p {
    color: var(--text-secondary);
}

/* ===================================
   OAUTH BUTTONS
   =================================== */

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.auth-divider span {
    padding: 0 15px;
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: white;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.oauth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.oauth-btn i {
    font-size: 1.3rem;
}

/* Google */
.oauth-btn.google {
    border-color: #4285f4;
    color: #4285f4;
}

.oauth-btn.google:hover {
    background: #4285f4;
    color: white;
    box-shadow: 0 5px 15px rgba(66, 133, 244, 0.3);
}

/* Facebook */
.oauth-btn.facebook {
    border-color: #1877f2;
    color: #1877f2;
}

.oauth-btn.facebook:hover {
    background: #1877f2;
    color: white;
    box-shadow: 0 5px 15px rgba(24, 119, 242, 0.3);
}

/* Apple */
.oauth-btn.apple {
    border-color: #000000;
    color: #000000;
}

.oauth-btn.apple:hover {
    background: #000000;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Dark theme для OAuth кнопок */
[data-theme="dark"] .auth-divider::before,
[data-theme="dark"] .auth-divider::after {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .oauth-btn {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .oauth-btn.google {
    border-color: #4285f4;
    color: #4285f4;
}

[data-theme="dark"] .oauth-btn.facebook {
    border-color: #1877f2;
    color: #1877f2;
}

[data-theme="dark"] .oauth-btn.apple {
    border-color: #ffffff;
    color: #ffffff;
}

[data-theme="dark"] .oauth-btn.apple:hover {
    background: #ffffff;
    color: #000000;
}
