/* =================================================================
   🔐 СТИЛИ АВТОРИЗАЦИИ - Менюшка
   ================================================================= */

/* =================================================================
   🎭 МОДАЛЬНЫЕ ОКНА
   ================================================================= */

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal.show {
    opacity: 1;
    visibility: visible;
}

.auth-modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.auth-modal.show .auth-modal-content {
    transform: scale(1) translateY(0);
}

.auth-modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.auth-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.auth-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.auth-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.auth-modal-body {
    padding: 0 24px 24px;
}

.auth-mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 16px;
}

.auth-mode-btn {
    min-height: 46px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #1e3a8a;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-mode-btn.active {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.auth-mode-btn:not(.active):hover {
    background: rgba(59, 130, 246, 0.12);
}

/* =================================================================
   📝 ФОРМЫ АВТОРИЗАЦИИ
   ================================================================= */

.auth-form {
    display: none;
}

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

.form-group {
    margin-bottom: 20px;
}

.form-group .form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.form-group .form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
}

.form-group .form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group .form-input:invalid {
    border-color: #ef4444;
}

.form-group .form-input:valid {
    border-color: #10b981;
}

.auth-checkbox-row {
    margin-bottom: 16px;
}

.auth-inline-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.4;
    user-select: none;
}

.auth-inline-checkbox input {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
    flex-shrink: 0;
}

/* =================================================================
   🔘 КНОПКИ АВТОРИЗАЦИИ
   ================================================================= */

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 48px;
}

/* Полная ширина только в модалках — иначе в шапке перекрывает «Связаться с нами» */
.auth-modal .auth-btn {
    width: 100%;
    margin-bottom: 16px;
}

.auth-btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.auth-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.auth-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.auth-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.auth-btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.auth-btn-outline {
    background: transparent;
    color: #3b82f6;
    border: 2px solid #3b82f6;
    width: auto;
    min-width: 120px;
}

.auth-btn-outline:hover {
    background: #3b82f6;
    color: white;
}

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

.btn-icon {
    font-size: 1.1rem;
}

.btn-text {
    font-weight: 500;
}

/* =================================================================
   🔗 ССЫЛКИ И ФУТЕР ФОРМ
   ================================================================= */

.auth-form-footer {
    text-align: center;
    margin-top: 20px;
}

.auth-form-footer p {
    margin: 8px 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.auth-form-footer a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-form-footer a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* =================================================================
   👤 ПРОФИЛЬ ПОЛЬЗОВАТЕЛЯ
   ================================================================= */

.user-profile-info {
    padding: 20px 0;
}

.user-profile-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.user-profile-item:last-child {
    border-bottom: none;
}

.user-profile-label {
    font-weight: 500;
    color: #374151;
}

.user-profile-value {
    color: #6b7280;
}

.user-profile-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.user-profile-status.verified {
    background: #d1fae5;
    color: #065f46;
}

.user-profile-status.unverified {
    background: #fef3c7;
    color: #92400e;
}

/* Секции профиля */
.user-profile-section {
    margin-bottom: 24px;
}

.user-profile-section:last-child {
    margin-bottom: 0;
}

.user-profile-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #007bff;
}

/* Меню пользователя */
.user-menus-list {
    display: grid;
    gap: 16px;
}

.user-menu-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s ease;
}

.user-menu-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.user-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.user-menu-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.user-menu-date {
    font-size: 12px;
    color: #666;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
}

.user-menu-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.user-menu-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    color: #666;
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.user-menu-actions {
    display: flex;
    gap: 8px;
}

.user-menus-empty {
    text-align: center;
    padding: 32px;
    color: #666;
}

.user-menus-empty p {
    margin: 8px 0;
}

.user-menus-more {
    text-align: center;
    padding: 16px;
    color: #666;
    font-style: italic;
}

.user-menus-error {
    text-align: center;
    padding: 32px;
    color: #f44336;
}

.loading-spinner {
    text-align: center;
    padding: 32px;
    color: #666;
}

/* Модальное окно меню */
.menu-details {
    max-height: 60vh;
    overflow-y: auto;
}

.menu-info {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.menu-info p {
    margin: 8px 0;
    color: #333;
}

.menu-items {
    margin-top: 20px;
}

.menu-day {
    margin-bottom: 24px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.menu-day h4 {
    background: #007bff;
    color: white;
    margin: 0;
    padding: 12px 16px;
    font-size: 16px;
}

.menu-meal {
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.menu-meal:last-child {
    border-bottom: none;
}

.menu-meal h5 {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.menu-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.menu-item:last-child {
    margin-bottom: 0;
}

.menu-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.menu-item-details {
    display: flex;
    gap: 12px;
    margin-bottom: 4px;
}

.menu-item-details span {
    font-size: 12px;
    color: #666;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
}

.menu-item-ingredients {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* =================================================================
   📱 АДАПТИВНОСТЬ
   ================================================================= */

@media (max-width: 768px) {
    .auth-modal-content {
        width: 95%;
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    .auth-modal-header {
        padding: 20px 20px 0;
    }
    
    .auth-modal-body {
        padding: 0 20px 20px;
    }
    
    .auth-btn {
        padding: 14px 20px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .auth-modal-content {
        width: min(92vw, 430px);
        height: auto;
        border-radius: 14px;
        max-height: min(78vh, 560px);
    }
    
    .auth-modal-header {
        padding: 16px 16px 0;
    }
    
    .auth-modal-body {
        padding: 0 16px 16px;
    }
}

/* =================================================================
   🎨 АНИМАЦИИ
   ================================================================= */

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

.auth-form.active {
    animation: slideInUp 0.3s ease;
}

/* =================================================================
   🚨 СОСТОЯНИЯ ОШИБОК И УСПЕХА
   ================================================================= */

.form-group.error .form-input {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group.success .form-input {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-error {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-success {
    color: #10b981;
    font-size: 0.75rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* =================================================================
   🔄 ЗАГРУЗКА
   ================================================================= */

.auth-btn.loading {
    position: relative;
    color: transparent;
}

.auth-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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