/* ============================================================================
   LOGIN PREMIUM — Modern SaaS Login Panel
   ============================================================================
   Design premium avec animations fluides, glassmorphism et transitions.
   Ne modifie PAS les images de background existantes.
   ============================================================================ */

/* === Google Font Inter === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* === Keyframe Animations === */
@keyframes loginFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes loginSlideDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loginPulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(18, 119, 153, 0.25);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(18, 119, 153, 0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes loginSpinnerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes floatBadge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* === Modal Window Override (glassmorphism card) === */
.auth-modal-window .modal-dialog {
    animation: loginFadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    max-width: 580px;
    margin: 8vh auto;
}

.auth-modal-window .modal-content {
    border: none !important;
    border-radius: 20px !important;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow:
        0 25px 60px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset,
        0 1px 3px rgba(0, 0, 0, 0.06) !important;
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.auth-modal-window .modal-content:hover {
    box-shadow:
        0 30px 70px -12px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset,
        0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

/* === Modal Header === */
#loginModal .modal-header,
.login-premium-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border-bottom: 1px solid rgba(18, 119, 153, 0.08) !important;
    padding: 28px 32px 20px !important;
    position: relative;
}

#loginModal .modal-header::after,
.login-premium-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 32px;
    right: 32px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(18, 119, 153, 0.3), transparent);
}

#loginModal .modal-title,
.login-premium-header .modal-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    animation: loginSlideDown 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

#loginModal .modal-title img,
.login-premium-header .modal-title img {
    width: 140px !important;
    margin-left: 0 !important;
    filter: drop-shadow(0 2px 8px rgba(18, 119, 153, 0.15));
    transition: transform 0.3s ease, filter 0.3s ease;
}

#loginModal .modal-title img:hover,
.login-premium-header .modal-title img:hover {
    transform: scale(1.03);
    filter: drop-shadow(0 4px 12px rgba(18, 119, 153, 0.25));
}

#loginModal .modal-title span,
.login-premium-header .modal-title .login-title-text {
    font-family: 'Inter', 'Roboto', sans-serif !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #0f4c63 !important;
    letter-spacing: -0.3px;
    position: relative;
}

/* === Modal Body === */
#loginModal .modal-body,
.login-premium-body {
    padding: 28px 32px 20px !important;
}

/* === Form Labels === */
#loginModal label,
.login-premium-body label {
    font-family: 'Inter', 'Roboto', sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    letter-spacing: 0.2px;
    margin-bottom: 6px !important;
    display: flex;
    align-items: center;
    gap: 2px;
    transition: color 0.2s ease;
}

#loginModal label span[style*="color: red"],
.login-premium-body label .required-star {
    color: #ef4444 !important;
    font-weight: 700;
}

/* === Input Fields — Premium Style === */
#loginModal .form-control,
.login-premium-body .form-control {
    font-family: 'Inter', 'Roboto', sans-serif !important;
    font-size: 14px !important;
    height: 46px !important;
    padding: 10px 16px !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 12px !important;
    background-color: #f9fafb !important;
    color: #1f2937 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    outline: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    -webkit-appearance: none;
}

#loginModal .form-control::placeholder,
.login-premium-body .form-control::placeholder {
    color: #9ca3af !important;
    font-weight: 400;
}

#loginModal .form-control:hover,
.login-premium-body .form-control:hover {
    border-color: #93c5d8 !important;
    background-color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(18, 119, 153, 0.08) !important;
}

#loginModal .form-control:focus,
.login-premium-body .form-control:focus {
    border-color: #127799 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(18, 119, 153, 0.12), 0 2px 8px rgba(18, 119, 153, 0.1) !important;
    transform: translateY(-1px);
}

/* Input icon-style left padding when icon added */
#loginModal .input-with-icon,
.login-premium-body .input-with-icon {
    position: relative;
}

#loginModal .input-with-icon .form-control,
.login-premium-body .input-with-icon .form-control {
    padding-left: 44px !important;
}

#loginModal .input-with-icon .input-icon,
.login-premium-body .input-with-icon .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
    transition: color 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

#loginModal .input-with-icon .form-control:focus ~ .input-icon,
.login-premium-body .input-with-icon .form-control:focus ~ .input-icon,
#loginModal .input-with-icon:focus-within .input-icon,
.login-premium-body .input-with-icon:focus-within .input-icon {
    color: #127799;
}

/* === Error / Success Messages === */
#loginModal .redE,
.login-premium-body .redE {
    color: #dc2626 !important;
    font-family: 'Inter', 'Roboto', sans-serif !important;
    font-size: 13px;
    font-weight: 500;
    background: #fef2f2;
    padding: 8px 14px;
    border-radius: 10px;
    border-left: 3px solid #dc2626;
    display: block;
    animation: loginSlideDown 0.3s ease both;
}

#loginModal .greenE,
.login-premium-body .greenE {
    color: #059669 !important;
    font-family: 'Inter', 'Roboto', sans-serif !important;
    font-size: 13px;
    font-weight: 500;
    background: #ecfdf5;
    padding: 8px 14px;
    border-radius: 10px;
    border-left: 3px solid #059669;
    display: block;
    animation: loginSlideDown 0.3s ease both;
}

/* Hide empty messages */
#loginModal .redE:empty,
#loginModal .greenE:empty,
.login-premium-body .redE:empty,
.login-premium-body .greenE:empty {
    display: none;
}

/* === Modal Footer === */
#loginModal .modal-footer,
.login-premium-footer {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    border-top: 1px solid rgba(18, 119, 153, 0.06) !important;
    padding: 18px 32px 24px !important;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* === Forgot password / Login links === */
#loginModal .modal-footer a,
.login-premium-footer a {
    font-family: 'Inter', 'Roboto', sans-serif !important;
    font-size: 13px !important;
    color: #127799 !important;
    text-decoration: none !important;
    font-weight: 500;
    position: relative;
    transition: color 0.25s ease;
    padding: 2px 0;
}

#loginModal .modal-footer a::after,
.login-premium-footer a.login-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #127799, #1a9bc7);
    border-radius: 1px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#loginModal .modal-footer a:hover::after,
.login-premium-footer a.login-link:hover::after {
    width: 100%;
}

#loginModal .modal-footer a:hover,
.login-premium-footer a:hover {
    color: #0f5d78 !important;
}

/* === Primary Action Button (Authentification) === */
#loginModal .md-raised.md-warn.btn-nax-material,
.login-premium-footer .login-btn-primary {
    font-family: 'Inter', 'Roboto', sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px;
    padding: 0 28px !important;
    height: 46px !important;
    min-width: 160px !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #127799 0%, #0f5d78 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 14px -3px rgba(18, 119, 153, 0.45), 0 2px 4px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-transform: none !important;
    position: relative;
    overflow: hidden;
}

#loginModal .md-raised.md-warn.btn-nax-material::before,
.login-premium-footer .login-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

#loginModal .md-raised.md-warn.btn-nax-material:hover,
.login-premium-footer .login-btn-primary:hover {
    background: linear-gradient(135deg, #0f5d78 0%, #0c4c63 100%) !important;
    box-shadow: 0 8px 22px -4px rgba(18, 119, 153, 0.55), 0 4px 8px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-2px);
}

#loginModal .md-raised.md-warn.btn-nax-material:hover::before,
.login-premium-footer .login-btn-primary:hover::before {
    left: 100%;
}

#loginModal .md-raised.md-warn.btn-nax-material:active,
.login-premium-footer .login-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(18, 119, 153, 0.3) !important;
}

#loginModal .md-raised.md-warn.btn-nax-material[disabled],
.login-premium-footer .login-btn-primary[disabled] {
    opacity: 0.7 !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* === Secondary Buttons (Reinit, Annuler, etc.) === */
.auth-modal-window .md-raised.md-primary.btn-nax-material {
    font-family: 'Inter', 'Roboto', sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 0 22px !important;
    height: 42px !important;
    border-radius: 10px !important;
    background: linear-gradient(135deg, #127799 0%, #1a9bc7 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 3px 10px -2px rgba(18, 119, 153, 0.35) !important;
    transition: all 0.3s ease !important;
    text-transform: none !important;
}

.auth-modal-window .md-raised.md-primary.btn-nax-material:hover {
    box-shadow: 0 6px 16px -3px rgba(18, 119, 153, 0.45) !important;
    transform: translateY(-1px);
}

/* Cancel / Annuler button */
.auth-modal-window .md-raised.md-warn.btn-nax-material.pull-left {
    font-family: 'Inter', 'Roboto', sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    padding: 0 22px !important;
    height: 42px !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #6b7280 !important;
    border: 2px solid #e5e7eb !important;
    box-shadow: none !important;
    transition: all 0.3s ease !important;
    text-transform: none !important;
    order: -1;
    margin-right: auto !important;
    float: none !important;
}

.auth-modal-window .md-raised.md-warn.btn-nax-material.pull-left:hover {
    background: #f9fafb !important;
    border-color: #d1d5db !important;
    color: #374151 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06) !important;
}

/* === All modal footers in auth-modal-window: flex layout === */
.auth-modal-window .modal-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: wrap;
    gap: 8px;
}

/* === Forgot links container: force left alignment === */
.auth-modal-window .modal-footer [layout="column"].pull-left,
.auth-modal-window .modal-footer [layout="column"][style*="text-align: left"] {
    text-align: left !important;
    float: none !important;
    margin-right: auto !important;
    order: -1;
}

.auth-modal-window .modal-footer [layout="column"].pull-left a,
.auth-modal-window .modal-footer [layout="column"][style*="text-align: left"] a {
    display: block !important;
    text-align: left !important;
}

/* === Turnstile Captcha Block === */
#loginModal .turnstile-block,
.login-premium-body .turnstile-block {
    margin-top: 16px;
    padding: 14px 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    animation: loginSlideDown 0.4s ease 0.3s both;
}

#loginModal .turnstile-caption,
.login-premium-body .turnstile-caption {
    font-family: 'Inter', 'Roboto', sans-serif !important;
    font-size: 12px !important;
    font-weight: 500;
    color: #0369a1 !important;
}

/* === Privacy / CGU links === */
#loginModal .modal-footer .privacy-links,
.login-premium-footer .privacy-links {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

#loginModal .modal-footer .privacy-links a,
.login-premium-footer .privacy-links a {
    font-size: 11.5px !important;
    color: #94a3b8 !important;
    font-weight: 400;
    transition: color 0.2s ease;
}

#loginModal .modal-footer .privacy-links a:hover,
.login-premium-footer .privacy-links a:hover {
    color: #64748b !important;
}

#loginModal .modal-footer .privacy-links a::after,
.login-premium-footer .privacy-links a::after {
    display: none;
}

/* === Staggered animation for form fields === */
#loginModal .modal-body [layout="column"] > [layout="column"]:nth-child(1) {
    animation: loginSlideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

#loginModal .modal-body [layout="column"] > [layout="column"]:nth-child(2) {
    animation: loginSlideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

#loginModal .modal-body [layout="column"] > [layout="column"]:nth-child(3) {
    animation: loginSlideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

#loginModal .modal-footer {
    animation: loginSlideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both;
}

/* === Loading spinner inside button === */
#loginModal .circular-progress-button md-progress-circular,
.login-premium-footer .circular-progress-button md-progress-circular {
    animation: loginSpinnerPulse 1.5s ease-in-out infinite;
}

#loginModal .circular-progress-button md-progress-circular svg path {
    stroke: #ffffff !important;
}

/* === Form group help-block (reset password form) === */
.auth-modal-window .form-group .help-block {
    font-family: 'Inter', 'Roboto', sans-serif !important;
    font-size: 12px !important;
    color: #dc2626 !important;
    margin-top: 4px;
    padding-left: 2px;
}

/* === Password strength bar === */
.auth-modal-window .password-strength-bar {
    height: 4px;
    border-radius: 2px;
    margin-top: 6px;
    transition: background-color 0.3s ease, width 0.3s ease;
}

/* === Overlay enhancements (keep background image!) === */
.auth-modal-overlay {
    opacity: 1 !important;
    transition: opacity 0.4s ease;
}

/* Subtle overlay darken for better contrast with card */
.auth-modal-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.35) 100%);
    z-index: 0;
}

/* === Responsive === */
@media (max-width: 480px) {
    .auth-modal-window .modal-dialog {
        margin: 2vh 16px;
        max-width: none;
    }

    #loginModal .modal-header,
    .login-premium-header {
        padding: 20px 20px 16px !important;
    }

    #loginModal .modal-body,
    .login-premium-body {
        padding: 20px !important;
    }

    #loginModal .modal-footer,
    .login-premium-footer {
        padding: 16px 20px 20px !important;
        flex-direction: column;
        gap: 12px;
    }

    #loginModal .modal-title img,
    .login-premium-header .modal-title img {
        width: 110px !important;
    }

    #loginModal .modal-title span,
    .login-premium-header .modal-title .login-title-text {
        font-size: 17px !important;
    }
}

/* === Focus visible (accessibility) === */
#loginModal .form-control:focus-visible,
.login-premium-body .form-control:focus-visible {
    outline: 2px solid #127799;
    outline-offset: 2px;
}

/* === Divider between main links and privacy === */
.login-links-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
    margin: 6px 0;
}

/* ============================================================================
   SECONDARY PANELS — Mot de passe perdu / Identifiant perdu / 2FA
   Applied to ALL modal content inside .auth-modal-window (not just #loginModal)
   ============================================================================ */

/* Header */
.auth-modal-window .modal-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border-bottom: 1px solid rgba(18, 119, 153, 0.08) !important;
    padding: 28px 32px 20px !important;
    position: relative;
}

.auth-modal-window .modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 32px;
    right: 32px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(18, 119, 153, 0.3), transparent);
}

.auth-modal-window .modal-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    animation: loginSlideDown 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.auth-modal-window .modal-title img {
    width: 140px !important;
    margin-left: 0 !important;
    filter: drop-shadow(0 2px 8px rgba(18, 119, 153, 0.15));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.auth-modal-window .modal-title img:hover {
    transform: scale(1.03);
    filter: drop-shadow(0 4px 12px rgba(18, 119, 153, 0.25));
}

.auth-modal-window .modal-title span {
    font-family: 'Inter', 'Roboto', sans-serif !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #0f4c63 !important;
    letter-spacing: -0.3px;
}

/* Body */
.auth-modal-window .modal-body {
    padding: 28px 32px 20px !important;
}

/* Labels */
.auth-modal-window label {
    font-family: 'Inter', 'Roboto', sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    letter-spacing: 0.2px;
    margin-bottom: 6px !important;
    display: flex;
    align-items: center;
    gap: 2px;
    transition: color 0.2s ease;
}

/* Inputs */
.auth-modal-window .form-control {
    font-family: 'Inter', 'Roboto', sans-serif !important;
    font-size: 14px !important;
    height: 46px !important;
    padding: 10px 16px !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 12px !important;
    background-color: #f9fafb !important;
    color: #1f2937 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    outline: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    -webkit-appearance: none;
}

.auth-modal-window .form-control::placeholder {
    color: #9ca3af !important;
    font-weight: 400;
}

.auth-modal-window .form-control:hover {
    border-color: #93c5d8 !important;
    background-color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(18, 119, 153, 0.08) !important;
}

.auth-modal-window .form-control:focus {
    border-color: #127799 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(18, 119, 153, 0.12), 0 2px 8px rgba(18, 119, 153, 0.1) !important;
    transform: translateY(-1px);
}

/* Input with icon */
.auth-modal-window .input-with-icon {
    position: relative;
}

.auth-modal-window .input-with-icon .form-control {
    padding-left: 44px !important;
}

.auth-modal-window .input-with-icon .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
    transition: color 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.auth-modal-window .input-with-icon .form-control:focus ~ .input-icon,
.auth-modal-window .input-with-icon:focus-within .input-icon {
    color: #127799;
}

/* Error / Success messages */
.auth-modal-window .redE {
    color: #dc2626 !important;
    font-family: 'Inter', 'Roboto', sans-serif !important;
    font-size: 13px;
    font-weight: 500;
    background: #fef2f2;
    padding: 8px 14px;
    border-radius: 10px;
    border-left: 3px solid #dc2626;
    display: block;
    animation: loginSlideDown 0.3s ease both;
}

.auth-modal-window .greenE {
    color: #059669 !important;
    font-family: 'Inter', 'Roboto', sans-serif !important;
    font-size: 13px;
    font-weight: 500;
    background: #ecfdf5;
    padding: 8px 14px;
    border-radius: 10px;
    border-left: 3px solid #059669;
    display: block;
    animation: loginSlideDown 0.3s ease both;
}

.auth-modal-window .redE:empty,
.auth-modal-window .greenE:empty {
    display: none;
}

/* Turnstile captcha */
.auth-modal-window .turnstile-block {
    margin-top: 16px;
    padding: 14px 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    animation: loginSlideDown 0.4s ease 0.3s both;
}

.auth-modal-window .turnstile-caption {
    font-family: 'Inter', 'Roboto', sans-serif !important;
    font-size: 12px !important;
    font-weight: 500;
    color: #0369a1 !important;
}




