/* ==========================================================================
   Écran de connexion — bloc CMS « connexion-btob-fullpage » (même structure
   que l'écran de connexion de Beneco, retenue le 27/10/2026)
   Vue : resources/views/blocs/connexion-btob-fullpage.blade.php (surcharge du
   package) et auth/passwords/email-pro-ajax.blade.php (mot de passe oublié,
   chargé en ajax dans .container-connexion par front.js).
   Image du bloc estompée sous un voile bleu marine à gauche (logo, devise),
   formulaire à droite ; sous 992px le panneau devient un bandeau au-dessus
   du formulaire.
   ========================================================================== */

.cnx {
    --cnx-primary: var(--main-primary-color, #01058e);
    --cnx-primary-text: var(--cnx-primary);
    --cnx-focus: #3d5ff2;
    --cnx-ring: color-mix(in srgb, var(--cnx-focus) 22%, transparent);
    --cnx-navy: #070b3a;
    --cnx-accent: #8fa2ff;
    --cnx-text: #2f3a52;
    --cnx-muted: #6b7590;
    --cnx-placeholder: #9aa3b8;
    --cnx-border: #cfd6e4;
    --cnx-border-hover: #aab5ca;
    --cnx-danger: #c8322b;

    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
    background: #fff;
    color: var(--cnx-text);
    font-family: 'Mulish', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
}

.cnx *,
.cnx *::before,
.cnx *::after {
    box-sizing: border-box;
}

/* --- Panneau image (bandeau en haut sur mobile et tablette) ------------------ */
.cnx-side {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 26px 20px 56px;
    background: var(--cnx-navy);
    color: #fff;
    isolation: isolate;
}

/* Image du bloc : l'éditeur du CMS réécrit le background en ligne, d'où les !important */
.cnx-side-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
}

/* Voile bleu marine : l'image reste visible en haut et s'efface derrière la devise */
.cnx-side::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(7, 11, 58, 0.55) 0%, rgba(7, 11, 58, 0.35) 45%, rgba(7, 11, 58, 0.9) 100%),
        linear-gradient(90deg, rgba(1, 5, 142, 0.35), rgba(1, 5, 142, 0.15));
    pointer-events: none;
}

.cnx-side-logo {
    display: inline-flex;
    align-self: flex-start;
}

.cnx-side-logo img {
    display: block;
    width: auto;
    height: 44px;
}

.cnx-side-text {
    max-width: 280px;
    padding-top: 26px;
}

.cnx-side-tagline {
    margin: 0;
    color: #fff;
    font-family: inherit;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.cnx-side-tagline em {
    color: var(--cnx-accent);
    font-style: normal;
}

.cnx-side-desc {
    display: none;
    margin: 0;
    max-width: 420px;
    color: #c9d0ea;
    font-size: 17px;
    line-height: 1.55;
}

@media (min-width: 576px) {
    .cnx-side {
        padding: 36px 48px 64px;
    }

    .cnx-side-logo img {
        height: 52px;
    }

    .cnx-side-text {
        max-width: 380px;
        padding-top: 32px;
    }

    .cnx-side-tagline {
        font-size: 38px;
    }
}

/* --- Colonne du formulaire --------------------------------------------------- */
.cnx-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: -24px;
    padding: 30px 20px 24px;
    border-radius: 22px 22px 0 0;
    background: #fff;
}

@media (min-width: 576px) {
    .cnx-panel {
        padding: 40px 48px 32px;
    }
}

.cnx-body,
.cnx-footer {
    width: 100%;
    max-width: 380px;
}

.cnx-body {
    display: flex;
    flex: 1;
    align-items: flex-start;
    padding: 0 0 40px;
}

.cnx-card {
    width: 100%;
}

/* --- Grand écran : deux colonnes ------------------------------------------------ */
@media (min-width: 992px) {
    .cnx {
        grid-template-columns: 50% minmax(0, 1fr);
        grid-template-rows: none;
    }

    .cnx-side {
        padding: 44px 56px;
    }

    .cnx-side-text {
        display: flex;
        flex: 1;
        flex-direction: column;
        justify-content: flex-end;
        gap: 18px;
        max-width: 500px;
        padding: 0 0 24px;
    }

    .cnx-side-tagline {
        font-size: clamp(40px, 3.4vw, 52px);
    }

    .cnx-side-desc {
        display: block;
    }

    .cnx-panel {
        margin-top: 0;
        padding: 44px 48px;
        border-radius: 0;
    }

    .cnx-body {
        align-items: center;
        padding: 48px 0;
    }
}

/* --- Titres -------------------------------------------------------------------- */
.cnx-title {
    margin: 0 0 8px;
    color: var(--cnx-navy);
    font-family: inherit;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-transform: none;
}

.cnx-subtitle {
    margin: 0 0 32px;
    color: var(--cnx-muted);
    font-size: 15px;
    line-height: 1.5;
}

.cnx-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 24px;
    color: var(--cnx-muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.cnx-back i {
    font-size: 18px;
}

.cnx-back:hover,
.cnx-back:focus {
    color: var(--cnx-navy);
    text-decoration: none;
}

/* --- Message d'erreur ------------------------------------------------------- */
.cnx-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: -8px 0 24px;
    padding: 12px 14px;
    border: 1px solid #f3c4c1;
    border-radius: 10px;
    background: #fdf2f1;
    color: #a3261f;
    font-size: 14px;
    line-height: 1.45;
}

.cnx-alert i {
    font-size: 18px;
    line-height: 20px;
}

/* --- Champs ---------------------------------------------------------------- */
.cnx-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0;
}

.cnx-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.cnx-label {
    display: block;
    margin: 0 0 8px;
    padding: 0;
    color: var(--cnx-text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
    opacity: 1;
}

.cnx-label-row .cnx-label {
    margin: 0;
}

.cnx-link {
    color: var(--cnx-primary-text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.cnx-link:hover,
.cnx-link:focus {
    color: var(--cnx-primary-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cnx-input-wrap {
    position: relative;
}

.cnx-input {
    display: block;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 14px 0 44px;
    border: 1px solid var(--cnx-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    color: var(--cnx-navy);
    font-family: inherit;
    font-size: 15px;
    line-height: normal;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.cnx-input::placeholder {
    color: var(--cnx-placeholder);
    opacity: 1;
}

.cnx-input:hover {
    border-color: var(--cnx-border-hover);
}

.cnx-input:focus {
    border-color: var(--cnx-focus);
    outline: none;
    box-shadow: 0 0 0 4px var(--cnx-ring);
}

.cnx-input[aria-invalid="true"] {
    border-color: var(--cnx-danger);
}

.cnx-input[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 4px rgba(200, 50, 43, 0.15);
}

.cnx-input-password {
    padding-right: 52px;
}

.cnx-input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    color: var(--cnx-muted);
    font-size: 19px;
    line-height: 1;
    transform: translateY(-50%);
    pointer-events: none;
    transition: color 0.15s ease;
}

.cnx-input-wrap:focus-within .cnx-input-icon {
    color: var(--cnx-focus);
}

.cnx-reveal {
    position: absolute;
    top: 50%;
    right: 5px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--cnx-muted);
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}

.cnx-reveal:hover {
    background: #f2f4f8;
    color: var(--cnx-text);
}

.cnx-reveal:focus {
    outline: none;
}

.cnx-reveal:focus-visible {
    box-shadow: 0 0 0 3px var(--cnx-ring);
    color: var(--cnx-text);
}

/* --- Case « Se souvenir de moi » ---------------------------------------------- */
.cnx-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    align-self: flex-start;
    margin: 0;
    padding: 0;
    color: var(--cnx-text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    text-transform: none;
    cursor: pointer;
    user-select: none;
}

.cnx-check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--cnx-primary);
    cursor: pointer;
}

/* --- Bouton principal --------------------------------------------------------- */
.cnx-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 48px;
    margin-top: 4px;
    padding: 0 20px;
    border: 0;
    border-radius: 10px;
    background: var(--cnx-primary);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.cnx-submit:hover {
    filter: brightness(1.3);
}

.cnx-submit:active {
    filter: brightness(1.15);
}

.cnx-submit:focus {
    outline: none;
}

.cnx-submit:focus-visible {
    box-shadow: 0 0 0 4px var(--cnx-ring);
}

.cnx-submit.is-loading {
    cursor: progress;
    filter: none;
    opacity: 0.85;
}

.cnx-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cnx-spin 0.7s linear infinite;
}

.cnx-submit.is-loading .cnx-spinner {
    display: block;
}

@keyframes cnx-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Chargement du formulaire « mot de passe oublié » (gabarit de front.js) */
.cnx-card .loader-flex-modal {
    min-height: 200px;
    margin-top: 0;
}

.cnx-footer {
    color: var(--cnx-muted);
    font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
    .cnx *,
    .cnx *::before {
        transition: none !important;
        animation-duration: 1.5s !important;
    }
}
