/* ==========================================================================
   LitAppro - Pages d'authentification
   --------------------------------------------------------------------------
   Remplace login/css/style.css, reste du gabarit "w3l" : bords a 4 px,
   ombres plates, titre souligne en pointilles, aucune animation, aucun etat
   de focus visible. Les noms de classes sont conserves pour ne pas toucher
   au balisage des cinq pages.
   ========================================================================== */

:root {
    --brand-500: #1f5fe0;
    --brand-600: #164bb8;
    --brand-700: #0d3b8c;
    --brand-050: rgba(31, 95, 224, .08);

    --ink-900: #0b1220;
    --ink-700: #223049;
    --ink-500: #55637a;
    --ink-300: #8a94a6;

    --line: rgba(11, 18, 32, .10);
    --line-strong: rgba(11, 18, 32, .18);

    --paper: #fff;
    --paper-soft: #f5f7fb;

    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 24px;

    --sh-2: 0 2px 6px rgba(11, 18, 32, .07), 0 12px 28px rgba(11, 18, 32, .08);
    --sh-3: 0 10px 30px rgba(11, 18, 32, .12), 0 32px 68px rgba(11, 18, 32, .16);

    --ease: cubic-bezier(.4, 0, .2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    color: var(--ink-700);
    background: var(--paper-soft);
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--brand-600);
    text-decoration: none;
    transition: color .2s var(--ease);
}

a:hover {
    color: var(--brand-700);
    text-decoration: underline;
}

h1,
h2,
h3,
p {
    margin: 0;
}

/* Anneau de focus : le gabarit posait outline:none partout, la navigation
   au clavier etait donc totalement invisible. */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--brand-500);
    outline-offset: 2px;
    border-radius: 6px;
}

/* --------------------------------------------------------------
   Decor
   -------------------------------------------------------------- */
.w3l-mockup-form {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
    overflow: hidden;
    background:
        radial-gradient(1100px 620px at 12% -10%, #dbe7ff 0%, transparent 60%),
        radial-gradient(900px 520px at 92% 110%, #e4ecff 0%, transparent 58%),
        var(--paper-soft);
}

/* Deux halos lents en arriere-plan : le fond etait un aplat unique. */
.w3l-mockup-form::before,
.w3l-mockup-form::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
    pointer-events: none;
    z-index: 0;
}

.w3l-mockup-form::before {
    width: 460px;
    height: 460px;
    top: -140px;
    left: -120px;
    background: rgba(31, 95, 224, .30);
    animation: derive 22s var(--ease) infinite alternate;
}

.w3l-mockup-form::after {
    width: 520px;
    height: 520px;
    right: -160px;
    bottom: -180px;
    background: rgba(13, 59, 140, .22);
    animation: derive 27s var(--ease) infinite alternate-reverse;
}

@keyframes derive {
    to {
        transform: translate3d(60px, 40px, 0) scale(1.12);
    }
}

.w3l-mockup-form .container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
}

/* --------------------------------------------------------------
   Carte
   -------------------------------------------------------------- */
.w3l-mockup-form .main-mockup {
    position: relative;
    display: flex;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-3);
    overflow: hidden;
}

html.js .w3l-mockup-form .main-mockup {
    animation: carte-entree .55s var(--ease) both;
}

@keyframes carte-entree {
    from {
        opacity: 0;
        transform: translateY(22px) scale(.985);
    }
}

/* Retour au site. C'etait une croix flottante hors de la carte, sans
   intitule : rien n'indiquait qu'elle ramenait a l'accueil. */
.w3l-mockup-form .alert-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--ink-500);
    cursor: pointer;
    font-size: 15px;
    transition: all .25s var(--ease);
}

.w3l-mockup-form .alert-close:hover {
    background: var(--brand-500);
    border-color: var(--brand-500);
    color: #fff;
    transform: rotate(90deg);
}

/* --- Panneau de marque --- */
.w3l_form {
    flex: 0 0 42%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 26px;
    padding: 48px 40px;
    background:
        radial-gradient(700px 380px at 20% 0%, rgba(255, 255, 255, .16) 0%, transparent 60%),
        linear-gradient(155deg, var(--brand-500) 0%, var(--brand-700) 100%);
    color: #fff;
    overflow: hidden;
}

.w3l_form::after {
    content: "";
    position: absolute;
    inset: auto -40% -55% -40%;
    height: 300px;
    background: rgba(255, 255, 255, .07);
    border-radius: 50%;
}

.w3l_form .left_grid_info {
    position: relative;
    z-index: 1;
}

.w3l_form .left_grid_info img {
    width: min(280px, 100%);
    margin: 0 auto;
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, .22));
}

html.js .w3l_form .left_grid_info img {
    animation: flotte 7s ease-in-out infinite;
}

@keyframes flotte {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

.auth-brand {
    position: relative;
    z-index: 1;
    text-align: center;
}

.auth-brand__name {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.auth-brand__tagline {
    margin-top: 6px;
    font-size: .88rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, .78);
}

.auth-points {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .86rem;
    color: rgba(255, 255, 255, .88);
}

.auth-points li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-points i {
    flex-shrink: 0;
    font-size: 1rem;
    color: #9dc0ff;
}

/* --- Panneau de formulaire --- */
.content-wthree {
    flex: 1 1 58%;
    padding: 46px 46px 40px;
    background: var(--paper);
}

.w3l-mockup-form h2 {
    font-size: clamp(1.5rem, 3vw, 1.9rem);
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--ink-900);
    margin-bottom: 8px;
}

.content-wthree>p {
    color: var(--ink-500);
    font-size: .94rem;
    line-height: 1.65;
}

.w3l-mockup-form form {
    margin: 26px 0 20px;
}

/* Apparition en cascade des champs. */
html.js .w3l-mockup-form form>* {
    animation: champ-entree .45s var(--ease) both;
}

html.js .w3l-mockup-form form>*:nth-child(1) {
    animation-delay: .06s;
}

html.js .w3l-mockup-form form>*:nth-child(2) {
    animation-delay: .12s;
}

html.js .w3l-mockup-form form>*:nth-child(3) {
    animation-delay: .18s;
}

html.js .w3l-mockup-form form>*:nth-child(4) {
    animation-delay: .24s;
}

html.js .w3l-mockup-form form>*:nth-child(5) {
    animation-delay: .30s;
}

html.js .w3l-mockup-form form>*:nth-child(6) {
    animation-delay: .36s;
}

@keyframes champ-entree {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

.w3l-mockup-form input[type="text"],
.w3l-mockup-form input[type="email"],
.w3l-mockup-form input[type="password"] {
    width: 100%;
    margin-bottom: 14px;
    padding: 14px 18px;
    font: inherit;
    font-size: .95rem;
    color: var(--ink-900);
    background: var(--paper);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.w3l-mockup-form input::placeholder {
    color: var(--ink-300);
}

.w3l-mockup-form input:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 4px var(--brand-050);
}

.password-container {
    position: relative;
    margin-bottom: 14px;
}

.password-container input {
    margin-bottom: 0 !important;
    padding-right: 50px;
}

/* Bascule d'affichage du mot de passe : c'etait un <span> cliquable,
   donc inatteignable au clavier et muet pour un lecteur d'ecran. */
.field-icon {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-300);
    cursor: pointer;
    font-size: 1.05rem;
    transition: color .2s var(--ease), background .2s var(--ease);
}

.field-icon:hover {
    color: var(--brand-600);
    background: var(--brand-050);
}

.w3l-mockup-form button.btn,
.w3l-mockup-form button[type="submit"] {
    width: 100%;
    padding: 14px 18px;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    border: 0;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), filter .2s var(--ease);
    box-shadow: 0 6px 18px rgba(31, 95, 224, .28);
}

.w3l-mockup-form button.btn:hover,
.w3l-mockup-form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(31, 95, 224, .34);
    filter: brightness(1.05);
}

.w3l-mockup-form button.btn:active {
    transform: translateY(0);
}

.w3l-mockup-form .btn-secondary {
    color: var(--brand-700);
    background: var(--paper);
    border: 1px solid var(--line-strong);
    box-shadow: none;
}

.w3l-mockup-form .btn-secondary:hover {
    background: var(--brand-050);
    border-color: var(--brand-500);
    filter: none;
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: .9rem;
    color: var(--ink-500);
}

.social-icons {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: .92rem;
    color: var(--ink-500);
}

/* --------------------------------------------------------------
   Messages
   -------------------------------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 18px 0 0;
    padding: 13px 16px;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    font-size: .92rem;
    line-height: 1.55;
    animation: alerte-entree .35s var(--ease) both;
}

@keyframes alerte-entree {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
}

.alert::before {
    font-family: "bootstrap-icons";
    font-size: 1.05rem;
    line-height: 1.35;
    flex-shrink: 0;
}

.alert-success {
    background: #e8f8f0;
    border-color: #b5e6cd;
    color: #05713f;
}

.alert-success::before {
    content: "\F26B";
}

.alert-danger {
    background: #fdecee;
    border-color: #f6c5ca;
    color: #b3121f;
}

.alert-danger::before {
    content: "\F33A";
}

.alert-info {
    background: #e8f1fd;
    border-color: #bcd6f8;
    color: #14539e;
}

.alert-info::before {
    content: "\F431";
}

.alert-warning {
    background: #fff6e5;
    border-color: #f7dfae;
    color: #92610a;
}

.alert-warning::before {
    content: "\F33A";
}

/* --------------------------------------------------------------
   Responsive
   -------------------------------------------------------------- */
@media (max-width: 860px) {
    .w3l-mockup-form .main-mockup {
        flex-direction: column;
    }

    /* Le panneau illustre passait SOUS le formulaire (order:2) : sur
       mobile on voyait d'abord un grand aplat bleu avant tout contenu
       utile. Il devient un bandeau compact au-dessus. */
    .w3l_form {
        flex: none;
        order: 1;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 16px;
        padding: 24px 26px;
        text-align: left;
    }

    .w3l_form .left_grid_info img {
        width: 92px;
    }

    .auth-brand {
        text-align: left;
    }

    .auth-points {
        display: none;
    }

    .content-wthree {
        order: 2;
        padding: 32px 26px 28px;
    }
}

@media (max-width: 480px) {
    .w3l-mockup-form {
        padding: 16px 14px;
    }

    .w3l-mockup-form .main-mockup {
        border-radius: var(--r-md);
    }

    .w3l_form {
        padding: 20px;
    }

    .content-wthree {
        padding: 26px 20px 24px;
    }

    .auth-links {
        flex-direction: column;
    }
}

/* --------------------------------------------------------------
   Mouvement reduit
   -------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* Action secondaire sous le bouton principal. Elle etait rendue par un
   <button class="btn btn-secondary"> imbrique dans un <a> : balisage
   invalide, et un poids visuel identique a l'action principale, si bien
   que les deux boutons se disputaient l'attention. */
.auth-secondaire {
    margin-top: 14px;
    text-align: center;
    font-size: .9rem;
    color: var(--ink-500);
}
