/* ============================================
   AUTH.CSS - Styles d'authentification G2T Corp
   Version unifiée (B2C + B2B)
   ============================================ */

/* ---------- MODALS (Général) ---------- */
.auth-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: authModalFadeIn 0.3s ease;
}
.auth-modal.active {
    display: block;
}

@keyframes authModalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.auth-modal-content {
    background: #ffffff;
    margin: 5% auto;
    padding: 32px 28px;
    width: 92%;
    max-width: 440px;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: authModalSlideUp 0.35s ease;
}

@keyframes authModalSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 28px;
    font-weight: 300;
    color: #94a3b8;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.2s;
}
.auth-modal-close:hover { color: #0f172a; }

.auth-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-modal-header .logo-icon {
    height: 48px;
    width: auto;
    margin-bottom: 8px;
}

.auth-modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #003580;
    margin: 0;
}
.auth-modal-header p {
    color: #64748b;
    font-size: 14px;
    margin-top: 4px;
}

/* ---------- FORMULAIRES ---------- */
.auth-form .form-group {
    margin-bottom: 16px;
}
.auth-form label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #0f172a;
    margin-bottom: 4px;
}
.auth-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #dfe6ef;
    border-radius: 10px;
    font-size: 14px;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.auth-form input:focus {
    border-color: #003580;
    box-shadow: 0 0 0 4px rgba(0,53,128,0.1);
    outline: none;
}
.auth-form input.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 4px rgba(231,76,60,0.15);
}
.auth-form .input-hint {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}
.auth-form .error-message {
    font-size: 13px;
    color: #e74c3c;
    margin-top: 4px;
    display: none;
}
.auth-form .error-message.visible { display: block; }

.auth-btn-primary {
    width: 100%;
    padding: 14px;
    background: #003580;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.auth-btn-primary:hover { background: #0057b8; }
.auth-btn-primary:active { transform: scale(0.98); }
.auth-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- SÉPARATEUR ---------- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 16px 0;
    color: #94a3b8;
    font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* ---------- BOUTONS SOCIAUX ---------- */
.auth-social-btn {
    width: 100%;
    padding: 11px;
    border: 1.5px solid #dfe6ef;
    border-radius: 10px;
    background: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #0f172a;
}
.auth-social-btn:hover {
    border-color: #003580;
    background: #f8fafc;
}
.auth-social-btn.google svg { width: 20px; height: 20px; }

.auth-links {
    text-align: center;
    margin-top: 14px;
    font-size: 14px;
    color: #64748b;
}
.auth-links a {
    color: #003580;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.auth-links a:hover { text-decoration: underline; }

/* ---------- 2FA ---------- */
.auth-2fa-code {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 16px 0;
}
.auth-2fa-code input {
    width: 48px;
    height: 52px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    border: 1.5px solid #dfe6ef;
    border-radius: 10px;
    background: #f8fafc;
}
.auth-2fa-code input:focus {
    border-color: #003580;
    box-shadow: 0 0 0 4px rgba(0,53,128,0.1);
    outline: none;
}

/* ---------- OPTIONS PREMIUM ---------- */
.premium-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 16px 0;
}
.option {
    background: #f8fafc;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
}
.option h3 {
    font-size: 18px;
    font-weight: 700;
    color: #003580;
    margin: 0 0 6px 0;
}
.option p {
    font-size: 14px;
    color: #475569;
    margin: 4px 0;
}

/* ---------- USER INFO ---------- */
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.user-name-btn {
    background: none;
    border: none;
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.user-name-btn:hover {
    background: #f1f5f9;
    color: #003580;
}
.premium-badge {
    background: #ffd700;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: #000;
    cursor: pointer;
    transition: all 0.2s;
}
.premium-badge:hover { transform: scale(1.05); }
.quota-info {
    font-size: 11px;
    color: #475569;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 12px;
}

/* ---------- BOUTONS ---------- */
.btn.primary,
.btn.secondary {
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}
.btn.primary {
    background: #003580;
    color: #fff;
}
.btn.primary:hover {
    background: #0057b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,53,128,0.3);
}
.btn.secondary {
    background: #e8edf4;
    color: #0f172a;
}
.btn.secondary:hover {
    background: #dce3ec;
    transform: translateY(-2px);
}
.btn.small {
    padding: 8px 16px;
    font-size: 13px;
    min-height: 36px;
}
#auth-logout-btn {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s ease;
}
#auth-logout-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(192,57,43,0.3);
}

/* ---------- RÉINITIALISATION (B2C) ---------- */
#reset-password-section-b2c {
    display: none;
    margin-top: 20px;
    border-top: 1px solid #eef2f6;
    padding-top: 20px;
}
#reset-password-section-b2c p {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 16px;
    text-align: center;
}
#reset-password-section-b2c .form-group {
    margin-bottom: 16px;
}
#reset-password-section-b2c .form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #dfe6ef;
    border-radius: 10px;
    font-size: 14px;
}
#reset-password-section-b2c .form-group input:focus {
    border-color: #0057b8;
    outline: none;
    box-shadow: 0 0 0 4px rgba(0,87,184,0.08);
}

#reset-message-b2c {
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    display: none;
    margin-bottom: 12px;
}
#reset-message-b2c.success {
    display: block;
    color: #065f46;
    background: #d1fae5;
}
#reset-message-b2c.error {
    display: block;
    color: #991b1b;
    background: #fee2e2;
}

/* ---------- BOUTON ENVOYER (B2C) ---------- */
#send-reset-link-b2c {
    width: 100%;
    padding: 14px;
    background: #003580;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
#send-reset-link-b2c:hover {
    background: #0057b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,53,128,0.25);
}
#send-reset-link-b2c:active {
    transform: scale(0.97);
}
#send-reset-link-b2c:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Ripple effect */
#send-reset-link-b2c::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}
#send-reset-link-b2c:active::after {
    width: 300px;
    height: 300px;
}

/* Spinner */
#send-reset-link-b2c .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}
#send-reset-link-b2c.loading .spinner { display: block; }
#send-reset-link-b2c.loading .btn-text { display: none; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Lien retour */
#back-to-login-b2c {
    display: inline-block;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}
#back-to-login-b2c:hover {
    color: #003580;
}

/* ---------- RÉINITIALISATION (B2B) ---------- */
#reset-password-section {
    display: none;
    margin-top: 20px;
    border-top: 1px solid #eef2f6;
    padding-top: 20px;
}
#reset-password-section p {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 16px;
    text-align: center;
}
#reset-password-section .form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #dfe6ef;
    border-radius: 10px;
    font-size: 14px;
}
#reset-message {
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    display: none;
    margin-bottom: 12px;
}

/* ---------- AUTRES ---------- */
.btn-premium-action {
    transition: all 0.3s ease;
    cursor: pointer;
}
.btn-premium-action:hover {
    transform: translateY(-2px);
}
#renew-quota-btn {
    background: #f59e0b !important;
    color: #fff !important;
}
#renew-quota-btn:hover {
    background: #d97706 !important;
    box-shadow: 0 6px 20px rgba(245,158,11,0.4);
}
#cancel-subscription-btn {
    background: #e74c3c !important;
    color: #fff !important;
}
#cancel-subscription-btn:hover {
    background: #c0392b !important;
    box-shadow: 0 6px 20px rgba(231,76,60,0.4);
}

/* ---------- PAGINATION ---------- */
.pagination-controls {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.pagination {
    display: flex;
    align-items: center;
    gap: 16px;
}
.pagination-btn {
    background: #003580;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pagination-btn:hover:not(:disabled) {
    background: #0057b8;
    transform: scale(1.05);
}
.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}
.pagination-info {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

/* ---------- MOBILE ---------- */
#mobile-user-info {
    padding: 16px 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 12px;
}
.mobile-user-profile {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mobile-user-name {
    font-weight: 600;
    font-size: 16px;
    color: #0f172a;
}
.mobile-user-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.mobile-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mobile-auth-buttons .btn { width: 100%; justify-content: center; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 625px) {
    #user-info { display: none !important; }
    #mobile-user-info { display: block !important; }
}
@media (min-width: 625px) {
    #mobile-user-info { display: none !important; }
    #user-info { display: flex !important; }
}

@media (max-width: 480px) {
    .auth-modal-content {
        padding: 24px 16px;
        margin: 10% auto;
    }
    .auth-modal-header h2 { font-size: 20px; }
    .auth-2fa-code input {
        width: 40px;
        height: 44px;
        font-size: 18px;
    }
    .btn.primary,
    .btn.secondary {
        padding: 6px 12px;
        font-size: 12px;
        min-height: 30px;
    }
    #auth-logout-btn {
        padding: 6px 12px;
        font-size: 12px;
        min-height: 30px;
    }
}

@media (max-width: 320px) {
    .logo { font-size: 14px; }
    .logo img { width: 28px; height: 28px; }
    .user-name { font-size: 10px; }
    .premium-badge { font-size: 8px; padding: 1px 6px; }
    .quota-info { font-size: 8px; padding: 1px 4px; }
    .btn.primary,
    .btn.secondary,
    #auth-logout-btn {
        font-size: 8px !important;
        padding: 2px 8px !important;
        min-height: 20px !important;
    }
}

/* ============================================
   MODAL DE PROFIL - SCROLLBAR INVISIBLE
   ============================================ */

/* Conteneur du modal de profil */
#auth-modal-profile .auth-modal-content {
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px 28px 20px;
    scrollbar-width: none; /* Firefox : cache la scrollbar */
    -ms-overflow-style: none; /* Internet Explorer / Edge */
}

/* Cache la scrollbar sur Chrome, Safari, Edge (WebKit) */
#auth-modal-profile .auth-modal-content::-webkit-scrollbar {
    display: none; /* Totalement invisible */
    width: 0;
    height: 0;
    background: transparent;
}

/* Alternative: rend la scrollbar extrêmement fine et transparente */
#auth-modal-profile .auth-modal-content::-webkit-scrollbar {
    width: 3px;
    background: transparent;
}

#auth-modal-profile .auth-modal-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.05); /* Pratiquement invisible */
    border-radius: 10px;
}

#auth-modal-profile .auth-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

/* Option supplémentaire : un léger padding à droite pour compenser l'absence de scrollbar */
#auth-modal-profile .auth-modal-content {
    padding-right: 24px;
}