﻿*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --cl-primary: #0A6CA8;
    --cl-primary-d: #085A8F;
    --cl-cyan: #12A8E8;
    --cl-dark: #181713;
    --cl-light-blue: #E3F4FA;
    --cl-surface: #F4F8FC;
    --cl-card: #FFFFFF;
    --cl-border: #D8E8F2;
    --cl-text: #1A2535;
    --cl-muted: #6B7A90;
    --cl-success: #2E7D32;
    --cl-danger: #D32F2F;
    --cl-shadow-sm: 0 2px 10px rgba(10,108,168,.10);
    --cl-shadow-md: 0 8px 30px rgba(10,108,168,.15);
    --cl-shadow-lg: 0 20px 60px rgba(10,108,168,.22);
    --cl-radius: 12px;
    --cl-radius-sm: 8px;
    --cl-transition: all .22s cubic-bezier(.4,0,.2,1);
}

html, body {
    height: 100%;
    font-family: 'DM Sans', sans-serif;
    background: var(--cl-surface);
    color: var(--cl-text);
    -webkit-font-smoothing: antialiased;
}

    /* ── Fond animé ── */
    body::before {
        content: '';
        position: fixed;
        inset: 0;
        background: radial-gradient(ellipse 80% 60% at 10% 20%, rgba(10,108,168,.07) 0%, transparent 60%), radial-gradient(ellipse 60% 80% at 90% 80%, rgba(18,168,232,.05) 0%, transparent 55%);
        pointer-events: none;
        z-index: 0;
    }

/* ── Wrapper centré ── */
.cl-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    position: relative;
    z-index: 1;
}

/* ── Carte principale ── */
.cl-card {
    background: var(--cl-card);
    border-radius: 16px;
    box-shadow: var(--cl-shadow-lg);
    width: 100%;
    max-width: 900px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    animation: clCardIn .45s cubic-bezier(.4,0,.2,1) both;
}

@keyframes clCardIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ══════════════════════════════════════════
       PANNEAU GAUCHE — Branding (bleu)
       ══════════════════════════════════════════ */
.cl-brand {
    background: linear-gradient(145deg, var(--cl-primary) 0%, #0D82C8 60%, var(--cl-cyan) 100%);
    padding: 52px 44px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

    /* Cercles décoratifs (équivalent Ellipse WPF) */
    .cl-brand::before,
    .cl-brand::after,
    .cl-brand-circle3 {
        content: '';
        position: absolute;
        border-radius: 50%;
        pointer-events: none;
    }

    .cl-brand::before {
        width: 340px;
        height: 340px;
        top: -130px;
        left: -110px;
        background: rgba(255,255,255,.05);
    }

    .cl-brand::after {
        width: 220px;
        height: 220px;
        bottom: -90px;
        right: -80px;
        background: rgba(255,255,255,.08);
    }

.cl-brand-circle3 {
    width: 160px;
    height: 160px;
    bottom: 120px;
    left: 40px;
    background: rgba(255,255,255,.06);
}

/* Logo */
.cl-brand-logo-wrap {
    width: 110px;
    height: 110px;
    background: rgba(255,255,255,.95);
    border-radius: 24px;
    display: grid;
    place-items: center;
    margin: 0 auto 28px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    position: relative;
    z-index: 1;
    animation: clLogoIn .5s cubic-bezier(.4,0,.2,1) .2s both;
}

@keyframes clLogoIn {
    from {
        opacity: 0;
        transform: scale(.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cl-brand-logo-bg {
    position: absolute;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--cl-light-blue);
    opacity: .35;
}

.cl-brand-logo-wrap img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

/* Texte de bienvenue */
.cl-brand-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.cl-brand-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 10px;
    animation: clTextIn .5s ease .3s both;
}

.cl-brand-sub {
    font-size: .93rem;
    color: rgba(255,255,255,.82);
    line-height: 1.5;
    margin-bottom: 36px;
    animation: clTextIn .5s ease .35s both;
}

@keyframes clTextIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Feature list */
.cl-features {
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: clTextIn .5s ease .4s both;
}

.cl-feature {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cl-feature-icon {
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,.18);
    border-radius: var(--cl-radius-sm);
    display: grid;
    place-items: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,.2);
}

.cl-feature-texts {
    flex: 1;
}

.cl-feature-title {
    font-size: .88rem;
    font-weight: 600;
    color: #fff;
}

.cl-feature-desc {
    font-size: .75rem;
    color: rgba(255,255,255,.72);
    margin-top: 2px;
}

/* Footer du panneau gauche */
.cl-brand-footer {
    text-align: center;
    position: relative;
    z-index: 1;
    padding-top: 28px;
    border-top: 1px solid rgba(255,255,255,.2);
    animation: clTextIn .5s ease .5s both;
}

    .cl-brand-footer p {
        font-size: .75rem;
        color: rgba(255,255,255,.6);
    }

/* ══════════════════════════════════════════
       PANNEAU DROIT — Formulaire de connexion
       ══════════════════════════════════════════ */
.cl-form-panel {
    padding: 52px 50px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.cl-form-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Titre du formulaire */
.cl-form-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--cl-dark);
    margin-bottom: 6px;
    animation: clTextIn .45s ease .15s both;
}

.cl-form-sub {
    font-size: .875rem;
    color: var(--cl-muted);
    margin-bottom: 36px;
    animation: clTextIn .45s ease .2s both;
}

/* ── Champs ── */
.cl-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
    animation: clTextIn .45s ease .25s both;
}

    .cl-field + .cl-field {
        animation-delay: .3s;
    }

.cl-field-label {
    font-size: .73rem;
    font-weight: 700;
    color:black;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.cl-field-wrap {
    position: relative;
}

.cl-field-input {
    width: 100%;
    height: 50px;
    padding: 0 44px 0 44px;
    border: 1.5px solid var(--cl-border);
    border-radius: var(--cl-radius-sm);
    background: var(--cl-surface);
    color: var(--cl-text);
    font-family: inherit;
    font-size: .925rem;
    transition: var(--cl-transition);
}

    .cl-field-input:focus {
        outline: none;
        border-color: var(--cl-primary);
        background: #fff;
        box-shadow: 0 0 0 3px rgba(10,108,168,.12);
    }

    .cl-field-input::placeholder {
        color: #B0BEC5;
    }

    .cl-field-input.error {
        border-color: var(--cl-danger);
    }

        .cl-field-input.error:focus {
            box-shadow: 0 0 0 3px rgba(211,47,47,.12);
        }

/* Icône gauche du champ */
.cl-field-icon-left {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cl-muted);
    font-size: .9rem;
    pointer-events: none;
    transition: var(--cl-transition);
}

.cl-field-wrap:focus-within .cl-field-icon-left {
    color: var(--cl-primary);
}

/* Bouton afficher/masquer mot de passe */
.cl-pwd-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--cl-muted);
    cursor: pointer;
    font-size: .9rem;
    padding: 4px;
    border-radius: 4px;
    transition: var(--cl-transition);
    line-height: 1;
}

    .cl-pwd-toggle:hover {
        color: var(--cl-primary);
    }

    .cl-pwd-toggle:focus-visible {
        outline: 2px solid var(--cl-primary);
        outline-offset: 2px;
    }

/* Texte d'erreur */
.cl-field-error {
    font-size: .72rem;
    color: var(--cl-danger);
    font-weight: 500;
    display: none;
}

    .cl-field-error.visible {
        display: block;
    }

/* ── Ligne "Se souvenir / Mot de passe oublié" ── */
.cl-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    animation: clTextIn .45s ease .35s both;
}

.cl-checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.cl-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--cl-primary);
    cursor: pointer;
    border-radius: 4px;
}

.cl-checkbox-label {
    font-size: .83rem;
    color: var(--cl-muted);
    user-select: none;
}

.cl-forgot {
    font-size: .83rem;
    font-weight: 600;
    color: var(--cl-primary);
    text-decoration: none;
    transition: var(--cl-transition);
}

    .cl-forgot:hover {
        color: var(--cl-cyan);
        text-decoration: underline;
    }

    .cl-forgot:focus-visible {
        outline: 2px solid var(--cl-primary);
        outline-offset: 2px;
        border-radius: 3px;
    }

/* ── Bouton SE CONNECTER ── */
.cl-btn-login {
    width: 100%;
    height: 50px;
    border-radius: var(--cl-radius-sm);
    background: var(--cl-primary);
    color: #fff;
    font-family: 'Space Grotesk', inherit;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .5px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--cl-transition);
    box-shadow: 0 4px 14px rgba(10,108,168,.35);
    animation: clTextIn .45s ease .4s both;
    position: relative;
    overflow: hidden;
}

    .cl-btn-login::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, rgba(255,255,255,.12), transparent);
        pointer-events: none;
    }

    .cl-btn-login:hover {
        background: var(--cl-cyan);
        box-shadow: 0 6px 20px rgba(18,168,232,.45);
        transform: translateY(-1px);
    }

    .cl-btn-login:active {
        transform: translateY(0);
    }

    .cl-btn-login:focus-visible {
        outline: 2px solid var(--cl-primary);
        outline-offset: 3px;
    }

    .cl-btn-login:disabled {
        opacity: .65;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

/* Spinner dans le bouton */
.cl-btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: clSpin .7s linear infinite;
}

/* Liens secondaires */
.link-secondary {
    color: #6c757d !important;
    font-size: 0.9rem;
    font-weight: 500;
}

a {
    text-decoration: none;
}

.link-secondary:hover {
    color: #0A6CA8 !important;
}

.navigation-extra {
    font-size: 0.9rem;
}

button.cl-btn-link {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: #0066cc;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    outline: none;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    display: inline;
}

    button.cl-btn-link:hover {
        color: #004499;
        text-decoration: none;
    }

    button.cl-btn-link:focus {
        outline: 2px solid #0066cc;
        outline-offset: 2px;
        border-radius: 2px;
    }

    button.cl-btn-link:active {
        color: #003377;
    }

@keyframes clSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Alerte erreur globale ── */
.cl-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #FFEBEE;
    border: 1px solid #FFCDD2;
    border-radius: var(--cl-radius-sm);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: .83rem;
    color: var(--cl-danger);
    font-weight: 500;
    display: none;
}

.cl-alert--success {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--cl-success);
    border: 1px solid #FFCDD2;
    border-radius: var(--cl-radius-sm);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: .83rem;
    color: white;
    font-weight: 500;
    display: none;
}

    .cl-alert.visible {
        display: flex;
    }

    .cl-alert i {
        flex-shrink: 0;
    }

/* ── Responsive ── */
@media (max-width: 720px) {
    .cl-card {
        grid-template-columns: 1fr;
        border-radius: var(--cl-radius);
    }

    .cl-brand {
        display: none;
    }
    /* masquer sur mobile pour garder focus formulaire */
    .cl-form-panel {
        padding: 40px 28px;
    }
}

@media (max-width: 400px) {
    .cl-sso-row {
        grid-template-columns: 1fr;
    }

    .cl-form-title {
        font-size: 1.65rem;
    }
}