/* ========================================
   POPUP MON COMPTE - GLOBAL
   ======================================== */

.account-popup {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    pointer-events: none;
}

.account-popup.active {
    display: flex !important;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.account-popup-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 25px;
    padding: 40px 50px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 3px solid #FFD600;
    position: relative;
    z-index: 1;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.account-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.account-popup-close:hover {
    background: rgba(255, 0, 0, 0.2);
    color: #D50000;
    transform: rotate(90deg);
}

.account-popup-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 32px;
    font-weight: 900;
    color: #ffffff;
    text-align: center;
    margin-bottom: 35px;
    text-transform: none;
}

.account-popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* User Info Section (when logged in) */
.account-user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 10px 0 20px 0;
    width: 100%;
    margin-top: -10px;
}

.user-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-yellow) 0%, var(--secondary-yellow) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-black);
    box-shadow: 0 4px 15px rgba(255, 214, 0, 0.4);
    margin: 0 auto;
    flex-shrink: 0;
}

.user-details {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.user-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-white);
    margin: 0 0 8px 0;
}

.user-email {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 4px 0;
}

.user-role {
    font-size: 14px;
    color: var(--primary-yellow);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-user-actions {
    width: 100%;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-edit-profile,
.btn-change-password {
    width: 100%;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid;
}

.btn-edit-profile {
    background: rgba(255, 214, 0, 0.15);
    border-color: rgba(255, 214, 0, 0.5);
    color: var(--primary-yellow);
}

.btn-edit-profile:hover {
    background: rgba(255, 214, 0, 0.25);
    border-color: var(--primary-yellow);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 214, 0, 0.3);
}

.btn-change-password {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.5);
    color: #60a5fa;
}

.btn-change-password:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: #60a5fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-edit-profile:active,
.btn-change-password:active {
    transform: translateY(0);
}

.btn-edit-profile i,
.btn-change-password i {
    font-size: 18px;
}

.btn-logout {
    width: 100%;
    padding: 12px 24px;
    background: rgba(220, 38, 38, 0.2);
    border: 2px solid rgba(220, 38, 38, 0.5);
    color: #ff6b6b;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-logout:hover {
    background: rgba(220, 38, 38, 0.3);
    border-color: #ff6b6b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-logout:active {
    transform: translateY(0);
}

.btn-logout i {
    font-size: 18px;
}

/* Profile button logged-in state */
.profile-btn.logged-in {
    background: rgba(255, 214, 0, 0.2);
    border: 2px solid rgba(255, 214, 0, 0.5);
}

.profile-btn.logged-in:hover {
    background: rgba(255, 214, 0, 0.3);
    border-color: var(--primary-yellow);
}

/* Edit Profile Popup */
.edit-profile-popup,
.change-password-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10001;
    animation: fadeIn 0.3s ease;
}

.edit-profile-popup.active,
.change-password-popup.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.edit-profile-popup-content,
.change-password-popup-content {
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    border-radius: 20px;
    padding: 40px 45px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.edit-profile-popup-close,
.change-password-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.edit-profile-popup-close:hover,
.change-password-popup-close:hover {
    background: rgba(213, 0, 0, 0.1);
    color: #D50000;
    transform: rotate(90deg);
}

.edit-profile-popup-title,
.change-password-popup-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 900;
    color: #121212;
    text-align: center;
    margin-bottom: 30px;
}

.edit-profile-form,
.change-password-form {
    display: flex;
    flex-direction: column;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* Forgot Password Popup */
.forgot-password-popup,
.reset-password-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10001;
    animation: fadeIn 0.3s ease;
}

.forgot-password-popup.active,
.reset-password-popup.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.forgot-password-popup-content,
.reset-password-popup-content {
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    border-radius: 20px;
    padding: 40px 45px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.forgot-password-popup-close,
.reset-password-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.forgot-password-popup-close:hover,
.reset-password-popup-close:hover {
    background: rgba(213, 0, 0, 0.1);
    color: #D50000;
    transform: rotate(90deg);
}

.forgot-password-popup-title,
.reset-password-popup-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 900;
    color: #121212;
    text-align: center;
    margin-bottom: 15px;
}

.forgot-password-description,
.reset-password-description {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.forgot-password-form,
.reset-password-form {
    display: flex;
    flex-direction: column;
}

.forgot-password-footer,
.reset-password-footer {
    margin-top: 20px;
    text-align: center;
}

.link-back-to-login,
.link-resend-code {
    background: none;
    border: none;
    color: var(--primary-yellow);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 6px;
}

.link-back-to-login:hover,
.link-resend-code:hover {
    background: rgba(255, 214, 0, 0.1);
    color: var(--primary-yellow);
    transform: translateX(-3px);
}

.link-back-to-login i,
.link-resend-code i {
    font-size: 16px;
}

.forgot-password {
    display: block;
    text-align: center;
    color: var(--primary-yellow);
    font-size: 14px;
    text-decoration: none;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.forgot-password:hover {
    color: #ffd700;
    text-decoration: underline;
}

.btn-login,
.btn-register {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 30px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 18px;
    border-radius: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.btn-login {
    background: linear-gradient(135deg, #FFD600 0%, #FFC107 100%);
    color: #121212;
    border: 2px solid #FFD600;
    box-shadow: 0 5px 20px rgba(255, 214, 0, 0.4);
}

.btn-login::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transition: left 0.4s ease;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 214, 0, 0.6);
}

.btn-register {
    background: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.btn-register:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #FFD600;
    color: #FFD600;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.btn-login i,
.btn-register i {
    font-size: 20px;
}

/* ========================================
   POPUP CONNEXION ET INSCRIPTION
   ======================================== */

.login-popup,
.register-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10002;
    animation: fadeIn 0.3s ease;
    pointer-events: auto;
}

.login-popup.active,
.register-popup.active {
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

/* Ensure popup background doesn't block content clicks */
.login-popup.active > *,
.register-popup.active > * {
    pointer-events: auto !important;
}

.login-popup-content,
.register-popup-content {
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    border-radius: 20px;
    padding: 40px 45px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 10003 !important;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto !important;
}

/* Ensure form content is always interactive */
.login-popup-content *,
.register-popup-content * {
    pointer-events: auto !important;
}

.login-popup-content input,
.register-popup-content input,
.login-popup-content textarea,
.register-popup-content textarea,
.login-popup-content select,
.register-popup-content select {
    pointer-events: auto !important;
    cursor: text !important;
}

.login-popup-close,
.register-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.login-popup-close:hover,
.register-popup-close:hover {
    background: rgba(213, 0, 0, 0.1);
    color: #D50000;
    transform: rotate(90deg);
}

.login-popup-title,
.register-popup-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 900;
    color: #121212;
    text-align: center;
    margin-bottom: 30px;
}

.login-form,
.register-form {
    display: flex;
    flex-direction: column;
}

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

.form-group-login label {
    display: block;
    font-weight: 600;
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.form-group-login input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fafafa;
    pointer-events: auto !important;
    cursor: text !important;
}

/* Ensure inputs are always editable - FORCE ENABLE */
.login-popup input:not([type="submit"]):not([type="button"]),
.register-popup input:not([type="submit"]):not([type="button"]),
.edit-profile-popup input:not([type="submit"]):not([type="button"]),
.change-password-popup input:not([type="submit"]):not([type="button"]),
.forgot-password-popup input:not([type="submit"]):not([type="button"]),
.reset-password-popup input:not([type="submit"]):not([type="button"]) {
    pointer-events: auto !important;
    cursor: text !important;
    opacity: 1 !important;
    user-select: auto !important;
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
}

/* Force enable even if disabled attribute is present */
.login-popup input[disabled]:not([type="submit"]):not([type="button"]),
.register-popup input[disabled]:not([type="submit"]):not([type="button"]),
.edit-profile-popup input[disabled]:not([type="submit"]):not([type="button"]),
.change-password-popup input[disabled]:not([type="submit"]):not([type="button"]),
.forgot-password-popup input[disabled]:not([type="submit"]):not([type="button"]),
.reset-password-popup input[disabled]:not([type="submit"]):not([type="button"]) {
    pointer-events: auto !important;
    cursor: text !important;
    opacity: 1 !important;
    background: #fafafa !important;
    user-select: auto !important;
    -webkit-user-select: auto !important;
}

.login-popup input[readonly]:not([type="submit"]):not([type="button"]),
.register-popup input[readonly]:not([type="submit"]):not([type="button"]),
.edit-profile-popup input[readonly]:not([type="submit"]):not([type="button"]),
.change-password-popup input[readonly]:not([type="submit"]):not([type="button"]),
.forgot-password-popup input[readonly]:not([type="submit"]):not([type="button"]),
.reset-password-popup input[readonly]:not([type="submit"]):not([type="button"]) {
    pointer-events: auto !important;
    cursor: text !important;
    user-select: auto !important;
    -webkit-user-select: auto !important;
}

.form-group-login input:focus {
    outline: none;
    border-color: #FFD600;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 214, 0, 0.1);
}

.form-group-login input::placeholder {
    color: #bbb;
}

.btn-connexion {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #FFD600 0%, #FFC107 100%);
    color: #121212;
    border: none;
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 18px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 214, 0, 0.3);
}

.btn-connexion:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 214, 0, 0.5);
}

.forgot-password {
    display: block;
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 15px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #121212;
    text-decoration: underline;
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.login-footer p {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.link-register {
    background: none;
    border: none;
    color: #121212;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.link-register:hover {
    color: #FFD600;
}

/* Responsive */
@media (max-width: 576px) {
    .account-popup-content {
        padding: 30px 25px;
    }
    
    .account-popup-title {
        font-size: 26px;
        margin-bottom: 25px;
    }
    
    .btn-login,
    .btn-register {
        padding: 15px 25px;
        font-size: 16px;
    }
    
    .login-popup-content,
    .register-popup-content {
        padding: 30px 25px;
    }
    
    .login-popup-title,
    .register-popup-title {
        font-size: 24px;
        margin-bottom: 25px;
    }
    
    .form-group-login input {
        padding: 12px 15px;
        font-size: 15px;
    }
    
    .btn-connexion {
        padding: 14px;
        font-size: 16px;
    }
}
