/* ===================================================
   Auth Module Styles - Salott-IT Engineering
   Covers: auth modal, profile page
   =================================================== */

/* ===== AUTH MODAL OVERLAY ===== */
.auth-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(11, 37, 89, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    justify-content: center;
    align-items: flex-start;
    padding-top: 5vh;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}
.auth-modal-overlay.active {
    display: flex;
    opacity: 1;
}
.auth-modal-overlay.fade-out {
    opacity: 0;
}

/* ===== AUTH MODAL ===== */
.auth-modal {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(11, 37, 89, 0.35);
    width: 100%;
    max-width: 440px;
    padding: 0;
    position: relative;
    transform: translateY(-30px) scale(0.95);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    margin-bottom: 5vh;
    overflow: hidden;
}
.auth-modal-overlay.active .auth-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.auth-modal-overlay.fade-out .auth-modal {
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
}

/* Close button */
.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(255,255,255,0.2);
    border: none;
    font-size: 1.5rem;
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    line-height: 1;
    z-index: 10;
}
.auth-modal-close:hover {
    background: rgba(255,255,255,0.35);
    transform: rotate(90deg);
}

/* Header */
.auth-modal-header {
    background: linear-gradient(135deg, #0b2559 0%, #163a6e 60%, #1a4a8a 100%);
    padding: 28px 32px 22px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.auth-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(245,158,11,0.08) 0%, transparent 50%);
    animation: authHeaderGlow 6s ease-in-out infinite;
}
@keyframes authHeaderGlow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10%, 5%); }
}
.auth-modal-icon-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
}
.auth-modal-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    position: relative;
    z-index: 2;
    animation: authIconBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    animation-delay: 0.2s;
    box-shadow: 0 6px 24px rgba(245,158,11,0.4);
}
@keyframes authIconBounce {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}
.auth-modal-icon-sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #f59e0b;
    border-radius: 50%;
    z-index: 1;
    animation: authSparkle 1.5s ease-in-out infinite;
}
.auth-modal-icon-sparkle.s1 { top: 0; right: -4px; animation-delay: 0s; }
.auth-modal-icon-sparkle.s2 { bottom: 4px; left: -6px; animation-delay: 0.3s; }
.auth-modal-icon-sparkle.s3 { top: -6px; left: 10px; animation-delay: 0.6s; }
@keyframes authSparkle {
    0%, 100% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1); }
}
.auth-modal-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
    position: relative;
}
.auth-modal-header p {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
    margin: 0;
    position: relative;
}

/* ===== TABS ===== */
.auth-tabs {
    display: flex;
    position: relative;
    background: #f1f5f9;
    margin: 0;
    border-bottom: 2px solid #e2e8f0;
}
.auth-tab {
    flex: 1;
    padding: 13px 16px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: color 0.3s;
    position: relative;
    z-index: 2;
}
.auth-tab:hover { color: #0b2559; }
.auth-tab.active { color: #0b2559; }
.auth-tab i { font-size: 0.8rem; }
.auth-tab-indicator {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50%;
    height: 3px;
    background: linear-gradient(90deg, #0b2559, #f59e0b);
    border-radius: 3px 3px 0 0;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
}

/* ===== TAB CONTENT ===== */
.auth-tab-content {
    position: relative;
    overflow: hidden;
}
.auth-form-panel {
    display: none;
    padding: 24px 28px 20px;
    animation: authPanelIn 0.35s ease both;
}
.auth-form-panel.active {
    display: block;
}
@keyframes authPanelIn {
    0% { opacity: 0; transform: translateX(20px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* ===== MESSAGE BOXES ===== */
.auth-msg {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.83rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeInDown 0.3s ease;
}
.auth-msg.error {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}
.auth-msg.success {
    background: #ecfdf5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

/* ===== FORM FIELDS ===== */
.auth-field {
    margin-bottom: 16px;
}
.auth-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.auth-field label i {
    color: #f59e0b;
    margin-right: 4px;
    font-size: 0.75rem;
}
.auth-field input {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.86rem;
    color: #1e293b;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
    background: #fff;
}
.auth-field input:focus {
    border-color: #0b2559;
    box-shadow: 0 0 0 3px rgba(11, 37, 89, 0.08);
}
.auth-field input.input-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}
.auth-field input.input-success {
    border-color: #10b981;
}
.auth-password-wrap {
    position: relative;
}
.auth-password-wrap input {
    padding-right: 44px;
}
.auth-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #64748b;
    font-size: 0.88rem;
    transition: color 0.25s;
    z-index: 2;
}
.auth-eye:hover { color: #0b2559; }

/* ===== PASSWORD STRENGTH ===== */
.auth-pwd-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}
.auth-pwd-strength.visible { opacity: 1; }
.auth-pwd-bar {
    flex: 1;
    height: 5px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}
.auth-pwd-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 5px;
    transition: width 0.4s ease, background 0.4s ease;
}
.auth-pwd-label {
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

/* ===== SUBMIT BUTTONS ===== */
.auth-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #0b2559, #1a3f7a);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s;
    margin-top: 4px;
}
.auth-submit:hover {
    background: linear-gradient(135deg, #4db748, #3a9a35);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(77,183,72,0.35);
}
.auth-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.auth-submit-register {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}
.auth-submit-register:hover {
    background: linear-gradient(135deg, #4db748, #3a9a35);
}
.auth-submit .spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin 0.6s linear infinite;
}
@keyframes authSpin { to { transform: rotate(360deg); } }

/* ===== FORM LINKS ===== */
.auth-form-links {
    text-align: center;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.auth-form-links a {
    color: #0b2559;
    font-size: 0.82rem;
    font-weight: 500;
    transition: color 0.25s;
    text-decoration: none;
}
.auth-form-links a:hover { color: #f59e0b; }
.auth-switch-text {
    font-size: 0.8rem;
    color: #64748b;
}
.auth-switch-link {
    font-weight: 600 !important;
    color: #f59e0b !important;
}
.auth-switch-link:hover {
    color: #0b2559 !important;
    text-decoration: underline !important;
}
.auth-forgot-link {
    font-size: 0.78rem !important;
    color: #64748b !important;
}
.auth-forgot-link:hover {
    color: #f59e0b !important;
}

/* ===== MODAL RESPONSIVE ===== */
@media (max-width: 480px) {
    .auth-modal-overlay {
        padding: 0;
        align-items: stretch;
    }
    .auth-modal {
        max-width: 100%;
        border-radius: 0;
        min-height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
        margin-bottom: 0;
    }
    .auth-modal-header {
        padding: 24px 20px 18px;
    }
    .auth-form-panel {
        padding: 20px 18px 16px;
    }
    .auth-modal-close {
        background: rgba(255,255,255,0.15);
    }
}


/* =============================================
   PROFILE PAGE STYLES
   ============================================= */

.profil-page { max-width: 900px; margin: 40px auto; padding: 0 20px; }
.profil-header {
    display: flex; align-items: center; gap: 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    padding: 30px; border-radius: 16px; color: #fff; margin-bottom: 30px;
}
.profil-avatar {
    width: 80px; height: 80px; border-radius: 50%;
    background: rgba(255,255,255,0.2); display: flex; align-items: center;
    justify-content: center; font-size: 2rem; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.3);
}
.profil-info h1 { font-size: 1.5rem; margin-bottom: 4px; }
.profil-info p { opacity: 0.85; font-size: 0.9rem; }
.profil-role {
    display: inline-block; padding: 3px 14px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 600; margin-top: 6px;
    background: var(--accent); color: #fff;
}
.profil-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.profil-card {
    background: #fff; border-radius: 12px; padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06); border: 1px solid #eee;
}
.profil-card h3 {
    font-size: 1rem; margin-bottom: 20px; padding-bottom: 10px;
    border-bottom: 2px solid var(--accent); display: flex; align-items: center; gap: 8px;
}
.profil-card h3 i { color: var(--accent); }
.profil-form .form-group { margin-bottom: 16px; }
.profil-form label { display: block; font-size: 0.82rem; font-weight: 600; color: #555; margin-bottom: 5px; }
.profil-form input {
    width: 100%; padding: 10px 14px; border: 2px solid #e8e8e8;
    border-radius: 8px; font-size: 0.9rem; transition: border-color 0.2s;
}
.profil-form input:focus { outline: none; border-color: var(--accent); }
.profil-form .btn-save {
    background: var(--accent); color: #fff; border: none; padding: 10px 24px;
    border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 0.88rem;
    transition: background 0.2s;
}
.profil-form .btn-save:hover { background: var(--accent-dark); }

/* Admin Quick Links */
.admin-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-link {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px;
    background: var(--primary); color: #fff; border-radius: 10px;
    text-decoration: none; font-size: 0.82rem; font-weight: 500;
    transition: all 0.2s;
}
.admin-link:hover { background: var(--accent); transform: translateY(-2px); color: #fff; }
.admin-link i { font-size: 1rem; }

/* Commandes */
.order-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.order-table th { background: var(--primary); color: #fff; padding: 10px 12px; text-align: left; }
.order-table td { padding: 10px 12px; border-bottom: 1px solid #eee; }
.order-table tr:hover { background: #f9f9f9; }
.status-badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 0.72rem; font-weight: 600;
}
.status-en_attente { background: #fff3cd; color: #856404; }
.status-confirme { background: #d4edda; color: #155724; }
.status-en_cours { background: #cce5ff; color: #004085; }
.status-livre { background: #d1e7dd; color: #0f5132; }
.status-annule { background: #f8d7da; color: #842029; }

.btn-logout {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px;
    background: #dc3545; color: #fff; border-radius: 8px; text-decoration: none;
    font-weight: 600; font-size: 0.85rem; transition: background 0.2s; margin-top: 20px;
}
.btn-logout:hover { background: #b02a37; color: #fff; }

/* Profile subtitle (member since) */
.profil-subtitle {
    opacity: 0.7;
    font-size: 0.8rem;
    margin-left: 10px;
}

/* Profile card spacing for standalone cards outside the grid */
.profil-card--spaced-bottom { margin-bottom: 24px; }
.profil-card--spaced-top { margin-top: 24px; }

/* Empty state for orders */
.profil-empty {
    color: #999;
    text-align: center;
    padding: 20px;
}

/* Table responsive wrapper */
.table-responsive {
    overflow-x: auto;
}

/* Auth hidden utility */
.auth-hidden {
    display: none;
}

/* Profile alerts (shared with modal) */
.profil-page .alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.88rem; }
.profil-page .alert-danger { background: #fee; color: #c33; border: 1px solid #fcc; }
.profil-page .alert-success { background: #efe; color: #2a7; border: 1px solid #beb; }

/* Profile responsive */
@media (max-width: 768px) {
    .profil-grid { grid-template-columns: 1fr; }
    .profil-header { flex-direction: column; text-align: center; }
    .admin-links { grid-template-columns: 1fr; }
}
