/* ========================================
   MODAL CONNEXION/INSCRIPTION - HARMONISÉ
   ======================================== */

/* Overlay principal */
.latepoint-auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 0, 64, 0.85); /* var(--color-navy) avec transparence */
    display: none;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

/* Popup principal */
.latepoint-auth-popup {
    background: var(--color-white);
    border-radius: 20px;
    padding: 0;
    max-width: 450px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: hidden !important;
}

/* Bouton fermer */
.close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-gray);
    z-index: 10;
    transition: all 0.3s;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-popup:hover {
    background: #fff5f5;
    color: var(--color-red); /* Rouge pour fermer */
}

/* Tabs */
.auth-tabs {
    display: flex;
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-radius: 20px 20px 0 0;
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 22px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    color: var(--color-gray);
    position: relative;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: var(--color-white);
}

.tab-btn:hover:not(.active) {
    background: rgba(26, 104, 255, 0.1);
    color: var(--color-primary);
}

/* Contenu des tabs */
.tab-content {
    display: none;
    padding: 35px 30px;
    animation: fadeInContent 0.3s ease;
    max-height: calc(85vh - 150px);
    overflow-y: auto;
    min-height: 350px;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    margin: 0 0 30px 0;
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), var(--color-tertiary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

/* Champs de formulaire */
.tab-content input[type="text"],
.tab-content input[type="email"],
.tab-content input[type="password"],
.tab-content input[type="tel"],
.tab-content select {
    width: 100%;
    padding: 14px 18px;
    margin: 10px 0;
    border: 2px solid var(--color-gray-light);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    background: var(--color-white);
    font-family: inherit;
}

.tab-content input:focus,
.tab-content select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(26, 104, 255, 0.1);
}

.tab-content input.error {
    border-color: var(--color-red);
    background: #fff5f5;
}

/* Select personnalisé */
.tab-content select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%231a68ff' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    padding-right: 45px;
    cursor: pointer;
}

/* Labels */
.membership-label {
    display: block;
    margin: 20px 0 8px 0;
    font-weight: 600;
    color: var(--color-secondary);
    font-size: 14px;
}

/* Checkboxes */
.remember-checkbox,
.terms-checkbox {
    margin: 18px 0;
}

.remember-checkbox label,
.terms-checkbox label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--color-gray);
    cursor: pointer;
}

.remember-checkbox input,
.terms-checkbox input {
    width: auto;
    margin: 0 10px 0 0;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

.terms-checkbox a {
    color: var(--color-red); /* Rouge pour les liens importants */
    text-decoration: none;
    margin-left: 4px;
    font-weight: 500;
}

.terms-checkbox a:hover {
    color: var(--color-tertiary);
    text-decoration: underline;
}

/* Bouton submit - utilise le rouge comme accent */
.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--color-red), var(--color-tertiary));
    color: var(--color-white);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    margin-top: 25px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.submit-btn:before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    transition: left 0.3s ease;
    z-index: -1;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(247, 0, 0, 0.3);
}

.submit-btn:hover:not(:disabled):before {
    left: 0;
}

.submit-btn:disabled {
    background: var(--color-gray-light);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Messages */
.success-msg {
    color: #22543d;
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    padding: 12px 18px;
    border-radius: 12px;
    border-left: 4px solid #48bb78;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-msg {
    color: #742a2a;
    background: linear-gradient(135deg, #fff5f5, #ffe5e5);
    padding: 12px 18px;
    border-radius: 12px;
    border-left: 4px solid var(--color-red);
    display: flex;
    align-items: center;
    gap: 10px;
}

.field-error {
    display: block;
    color: var(--color-red);
    font-size: 12px;
    margin-top: 4px;
    margin-left: 4px;
    font-weight: 500;
}

/* Lien mot de passe oublié */
.forgot-password, .back-to-login {
    display: inline-block;
    margin-top: 20px;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
	background: none;
}

.forgot-password:hover, .back-to-login:hover {
    color: var(--color-red); /* Rouge au hover */
    text-decoration: underline;
}

/* Boutons LatePoint personnalisés */
.custom-auth-trigger {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)) !important;
    color: var(--color-white) !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 25px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.custom-auth-trigger:hover {
    background: linear-gradient(135deg, var(--color-red), var(--color-tertiary)) !important;
    transform: scale(1.02) !important;
    box-shadow: 0 5px 15px rgba(247, 0, 0, 0.3) !important;
}

/* Styles pour la réinitialisation */
.reset-description {
    text-align: center;
    color: var(--color-gray);
    margin-bottom: 25px;
    font-size: 14px;
    line-height: 1.6;
}

.back-to-login {
    display: inline-block;
    margin-top: 20px;
    color: var(--color-gray);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.back-to-login:hover {
    color: var(--color-primary);
    transform: translateX(-3px);
}

#reset-step2 [name="reset_key"] {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    text-align: center;
    font-weight: 600;
    background: #f7fafc;
}

/* Focus visible pour accessibilité */
.tab-content input:focus-visible,
.tab-content select:focus-visible,
.submit-btn:focus-visible {
    outline: 2px solid var(--color-red);
    outline-offset: 2px;
}

/* Loader pour le bouton */
.submit-btn.loading {
    position: relative;
    color: transparent;
}

.submit-btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid var(--color-white);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

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

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

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

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Empêcher le scroll du body quand la modal est ouverte */
body.modal-open {
    overflow: hidden;
    padding-right: 15px;
}

/* Scrollbar styling */
.tab-content::-webkit-scrollbar {
    width: 6px;
}

.tab-content::-webkit-scrollbar-track {
    background: transparent;
}

.tab-content::-webkit-scrollbar-thumb {
    background-color: var(--color-gray-light);
    border-radius: 3px;
}

.tab-content::-webkit-scrollbar-thumb:hover {
    background-color: var(--color-red);
}

/* Responsive Mobile */
@media (max-width: 480px) {
    .latepoint-auth-popup {
        width: 95%;
        margin: 10px;
        max-height: 95vh;
        border-radius: 15px;
    }

    .tab-content {
        padding: 25px 20px;
    }

    .form-row {
        flex-direction: column;
    }

    .tab-btn {
        padding: 18px 10px;
        font-size: 14px;
    }

    .tab-content h3 {
        font-size: 22px;
        margin-bottom: 25px;
    }

    .submit-btn {
        padding: 14px;
        font-size: 15px;
    }
}