/* ============================================================
   STYLES EXISTANTS — inchangés
   ============================================================ */

* {
    font-family: Verdana;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    min-height: 100vh;
    background: #131416;
}

#account_css {
    background: transparent;
    margin: 0 auto;
    color: #444444;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: static;
    bottom: auto;
}

.box-identifier {
    color: #000000;
    border: 2px solid;
    border-radius: 10px;
    height: 30px;
    margin-top: 15px;
    position: relative;
    transition: all 0.4s ease;
}

.box-identifier input {
    height: 95%;
    width: 95%;
    border: none;
    background: transparent;
    margin-Left: 8px;
    margin-top: 1.5px;
    color: #666666;
    transition: all 0.4s ease;
}

.box-password1 {
    color: #000000;
    border: 2px solid;
    border-radius: 10px;
    height: 30px;
    margin-top: 15px;
    position: relative;
    transition: all 0.4s ease;
}

.box-password1 input {
    height: 90%;
    width: 90%;
    border: none;
    background-color: rgb(31,31,31) !important;
    margin-Left: 8px;
    margin-top: 1.5px;
    color: #666666;
    transition: all 0.4s ease;
}

.box-identifier i, .box-password1 i {
    cursor: pointer;
}

.box-password1 input:focus, .box-identifier input:focus {
    color: #aaaaaa;
    outline: none;
}

.box-password1:focus-within, .box-identifier:focus-within {
    border-color: #ff2525;
    box-shadow: 0 0 10px rgba(255, 37, 37, 0.3) !important;
}

@media screen and (max-width: 1024px) {
    .box-identifier input { width: 93%; }
}
@media (max-width: 480px) {
    .box-password1 input { width: 89.5%; }
}
@media (max-width: 460px) {
    .box-password1 input { width: 89%; }
}
@media (max-width: 440px) {
    .box-password1 input { width: 88.5%; }
}
@media (max-width: 420px) {
    .box-password1 input { width: 88%; }
}
@media (max-width: 400px) {
    .box-password1 input { width: 87%; }
}
@media (max-width: 380px) {
    .box-password1 input { width: 86%; }
}
@media (max-width: 360px) {
    .box-password1 input { width: 85%; }
}
@media (max-width: 340px) {
    .box-password1 input { width: 84%; }
}
@media (max-width: 321px) {
    .box-password1 input { width: 83%; }
}

#signin-button {
    background: #ff2525;
    position: relative;
    z-index: 1;
    padding: 0px 3px;
    border: 2px solid #ff2525;
    border-radius: 8px;
    height: 40px !important;
}

#signin-button:hover {
    background: #aa0000;
    border-color: #aa0000;
}

.custom-error-message {
    background-color: rgba(255, 37, 37, 0.1);
    color: #ff2525;
    padding: 12px;
    border-radius: 5px;
    margin: 15px 0;
    border: 1px solid #ff2525;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

.errorlist {
    color: #ff2525;
    font-size: 12px;
    margin: 5px 0;
    padding: 0;
    list-style: none;
}

.errorlist li {
    margin: 2px 0;
}

@keyframes animate {
    0%   { background-position: 0 0; }
    50%  { background-position: 300% 0; }
    100% { background-position: 0 0; }
}

.message_account {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
    color: #444444;
}

@media (max-width: 480px) {
    .message_account { width: 90%; }
}

.placement {
    padding: 4.5% 0%;
    display: none;
}

.checkbox {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 332px;
}

.checkbox:hover .checkbox_check { background: #ff2525; }

.checkbox_input {
    width: 0;
    height: 0;
    opacity: 0;
}

.checkbox_input:checked + .checkbox_check {
    background: #ff2525;
    stroke-dashoffset: 0;
}

.checkbox_check {
    border: 0.2em solid #ff2525;
    border-radius: 0.2em;
    fill: none;
    stroke: #000000;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dashoffset: 25;
    stroke-dasharray: 25;
    transition: background 0.4s, stroke-dashoffset 0.6s;
    background: rgb(31, 31, 31);
    flex-shrink: 0;
}

.error-message {
    color: #ff2525;
    margin: 15px 5px 0 5px;
}

.space {
    padding: 20px 0 11px 0;
}

#signin-button.disabled {
    background: #6c757d !important;
    border-color: #6c757d !important;
    color: #adb5bd !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

#signin-button.active {
    background: #ff2525 !important;
    border-color: #ff2525 !important;
    color: white !important;
    cursor: pointer !important;
    opacity: 1;
}

#signin-button.active:hover {
    background: #cc1f1f !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 37, 37, 0.3);
}

#signin-button.disabled:active {
    animation: shake 0.3s ease-in-out;
}

#signin-button.loading {
    opacity: 0.7;
    pointer-events: none;
    padding: 5px;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-5px); }
    75%       { transform: translateX(5px); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   STYLES MODAL
   ============================================================ */

/* ── Landing ── */
.landing {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 44px;
    position: relative;
}

.landing::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 700px 400px at 15% 55%, rgba(255,37,37,0.07) 0%, transparent 70%),
        radial-gradient(ellipse 500px 300px at 85% 30%, rgba(255,37,37,0.04) 0%, transparent 70%);
    pointer-events: none;
}

.landing::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,37,37,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,37,37,0.025) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

.landing-logo {
    position: relative;
    z-index: 1;
    text-align: center;
    #animation: fadeDown 0.7s cubic-bezier(.16,1,.3,1) both;
}

.landing-logo img {
    width: 400px;
    max-width: 90vw;
}

.landing-tagline {
    font-size: 0.65rem;
    color: var(--gray-dim);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 8px;
}

.landing-actions {
    display: flex;
    gap: 16px;
    position: relative;
    z-index: 1;
    #animation: fadeUp-landing 0.7s 0.15s cubic-bezier(.16,1,.3,1) both;
}

.btn-landing-primary {
    padding: 12px 40px;
    background: var(--red);
    border: 2px solid var(--red);
    border-radius: 8px;
    color: #000;
    font-family: Verdana, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-landing-primary:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255,37,37,0.3);
}

.btn-landing-ghost {
    padding: 12px 40px;
    background: transparent;
    border: 2px solid var(--border);
    border-radius: 8px;
    color: #888;
    font-family: Verdana, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, transform 0.15s;
}

.btn-landing-ghost:hover {
    border-color: var(--red);
    color: var(--red-texte, var(--red));
    transform: translateY(-2px);
}

/* ── Overlay ── */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.overlay.open {
    opacity: 1;
    pointer-events: all;
}

.overlay.no-anim,
.overlay.no-anim .modal-glow {
    transition: none !important;
}

/* Quand le modal est ouvert, la vitrine derrière est déjà assombrie (pas de flash clair). */
.overlay[data-open="true"] {
    opacity: 1 !important;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    pointer-events: all;
}

/* Écran tactile : pas de flou plein écran derrière la fenêtre (recomposé à chaque image de
   l'animation de la bordure, et pendant le défilement) — un voile plus sombre à la place. */
@media (hover: none), (pointer: coarse) {
    .overlay,
    .overlay[data-open="true"] {
        background: rgba(0,0,0,0.86);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* ── Wrapper bordure animée ── */
/*
    .modal-glow  : porte l'animation de bordure rouge via ::before / ::after
                   Son background est le dégradé animé, visible uniquement
                   sur les 2px qui dépassent autour de .modal
    .modal       : fond gris uni — aucun pseudo-élément, aucun conflit
*/
.modal-glow {
    position: relative;
    width: 400px;
    max-width: 94vw;
    isolation: isolate;
    transform: translateY(28px) scale(0.97);
    opacity: 0;
    transition: transform 0.38s cubic-bezier(.16,1,.3,1), opacity 0.3s ease;
}

.overlay.open .modal-glow {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Bordure animée sur le wrapper (base_modal.html : .mg-halo, .mg-bord).
   Avant : background-position animé sur deux pseudo-éléments, dont un flou de 20px —
   la page entière repeinte et le flou recalculé à chaque image, ce qui ramait sur mobile.
   Maintenant chaque calque découpe (overflow: hidden) un dégradé à bandes répétées, plus
   large que lui, qui glisse par transform : le navigateur le déplace sur la carte graphique
   sans rien repeindre. Le glissement fait exactement une période des bandes (990px en x
   pour 700px le long de l'axe à 45°) : la boucle est continue, sans à-coup. */
/* Les deux calques : la bordure nette (4px autour de la fenêtre) et le halo (26px). Leurs
   dégradés couvrent EXACTEMENT le même rectangle (26px autour de la fenêtre, plus une période
   à droite pour le glissement) : mêmes bandes, au même endroit, au même instant — le halo suit
   la bordure. Pas de scale() : il déplacerait et étirerait les bandes d'un seul des deux. */
.mg-halo,
.mg-bord {
    position: absolute;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.mg-bord {
    inset: -4px;
}

/* Le halo : sans filtre de flou (recalculé à chaque image, il ramait sur mobile). Le flou est
   dessiné d'avance : des bandes rouges aux bords très progressifs, et un masque fixe qui les
   estompe vers l'extérieur. Rien n'est recalculé pendant le glissement, sur tous les écrans. */
.mg-halo {
    inset: -26px;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 26px, #000 calc(100% - 26px), transparent),
                        linear-gradient(to bottom, transparent, #000 26px, #000 calc(100% - 26px), transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent, #000 26px, #000 calc(100% - 26px), transparent),
                linear-gradient(to bottom, transparent, #000 26px, #000 calc(100% - 26px), transparent);
    mask-composite: intersect;
}

.mg-halo::before,
.mg-bord::before {
    content: '';
    position: absolute;
    /* Une période de plus que le calque à droite : il reste couvert pendant tout le glissement. */
    will-change: transform;
    animation: ds-bordure-glisse 7s linear infinite;
}

/* Le même rectangle pour les deux (le calque du halo commence 22px avant celui de la bordure). */
.mg-halo::before {
    top: 0;
    bottom: 0;
    left: 0;
    width: calc(100% + 990px);
    background: repeating-linear-gradient(45deg,
        rgba(255,37,37,.8) 0, rgba(128,18,18,.6) 60px, rgba(0,0,0,.55) 150px,
        rgba(0,0,0,.55) 550px, rgba(128,18,18,.6) 640px, rgba(255,37,37,.8) 700px);
}

.mg-bord::before {
    top: -22px;
    bottom: -22px;
    left: -22px;
    width: calc(100% + 44px + 990px);
    background: repeating-linear-gradient(45deg,
        #ff2525 0, #000 78px, #000 622px, #ff2525 700px);
}

@keyframes ds-bordure-glisse {
    from { transform: translate3d(-990px, 0, 0); }
    to   { transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .mg-halo::before,
    .mg-bord::before { animation: none; }
}

/* ── Modal — fond gris pur, aucun pseudo-élément ── */
.modal {
    position: relative;     /* au-dessus des ::before/::after du parent */
    z-index: 1;
    width: 100%;
    background: rgb(31, 31, 31);
    padding: 36px 28px 28px;
    max-height: 92vh;
    overflow-y: auto;
    scrollbar-width: none;
}

.modal::-webkit-scrollbar { display: none; }

/* Bouton fermeture */
.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: var(--gray-dim);
    font-size: 1rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    z-index: 2;
}

.modal-close:hover {
    color: var(--red-texte, var(--red));
    background: rgba(255,37,37,0.08);
}

/* ── En-tête modal ── */
.modal-header {
    text-align: center;
    margin-bottom: 22px;
}

.modal-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--red-texte, var(--red));
    margin-bottom: 5px;
}

.modal-sub {
    font-size: 0.72rem;
    color: var(--gray);
    line-height: 1.5;
}

/* ── Champs .m-field ── */
.m-field {
    position: relative;
    margin-bottom: 12px;
    isolation: isolate;
    border-radius: 10px;
}

.m-field input {
    width: 100% !important;
    height: 40px !important;
    background: transparent !important;
    border: 2px solid var(--border) !important;
    border-radius: 10px !important;
    color: #888 !important;
    font-family: Verdana, sans-serif !important;
    font-size: 0.78rem !important;
    outline: none !important;
    display: block !important;
    margin: 0 !important;
    padding: 0px 40px 0px 14px !important;
    transition: border-color 0.3s, box-shadow 0.3s, color 0.3s;
    position: relative;
    z-index: 1;
}

.m-field input::placeholder { color: #555 !important; }

.m-field input:focus {
    border-color: var(--red) !important;
    color: #bbb !important;
}

.m-field:focus-within {
    border-color: var(--red);
    box-shadow: 0 0 10px rgba(255, 37, 37, 0.3) !important;
    color: #bbb !important;

}

.m-field .f-icon {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    font-size: 0.82rem;
    cursor: pointer;
    transition: color 0.2s;
}

.m-field .f-icon:hover { color: var(--red-texte, var(--red)); }

/* ── .box-password1  dans le modal ── */
.modal .box-password1  {
    border: none !important;
    color: inherit !important;
    height: auto !important;
    margin-top: 0 !important;
    margin-bottom: 12px !important;
    position: relative !important;
    background: transparent !important;
    border-radius: 10px !important;
}

.modal .box-password1 input {
    width: 100% !important;
    height: 40px !important;
    background: transparent !important;
    border: 2px solid var(--border) !important;
    border-radius: 10px !important;
    padding: 0 40px 0 14px !important;
    color: #888 !important;
    font-family: Verdana, sans-serif !important;
    font-size: 0.78rem !important;
    outline: none !important;
    display: block !important;
    margin: 0 !important;
    transition: border-color 0.3s, box-shadow 0.3s, color 0.3s;
    position: relative;
    z-index: 1;
}

.modal .box-password1 input::placeholder { color: #555 !important; }

.modal .box-password1 input:focus {
    border-color: var(--red) !important;
    box-shadow: 0 0 10px rgba(255,37,37,0.3) !important;
    color: #bbb !important;
}

.modal .box-password1 .show1 {
    position: absolute !important;
    right: 13px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    left: auto !important;
    color: #555 !important;
    font-size: 0.82rem !important;
    cursor: pointer !important;
    transition: color 0.2s;
}

.modal .box-password1 .show2 {
    position: absolute !important;
    right: 13px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    left: auto !important;
    color: #555 !important;
    font-size: 0.82rem !important;
    cursor: pointer !important;
    transition: color 0.2s;
}
.modal .box-password1 .show2:hover { color: var(--red-texte, var(--red)) !important; }

.modal .box-password1 .show1:hover { color: var(--red-texte, var(--red)) !important; }

.floating-label {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.78rem;
    color: #555;
    pointer-events: none;
    z-index: 2;

    transition:
        transform 0.2s cubic-bezier(.4,0,.2,1),
        top 0.2s cubic-bezier(.4,0,.2,1),
        font-size 0.2s,
        color 0.2s;

    /* 🔥 clé du fix */
    background: linear-gradient(
        to bottom,
        transparent 40%,
        rgb(31,31,31) 40%
    );

    padding: 0 4px;
    will-change: transform;
    border-radius: 4px;
}

.m-field input:focus + .floating-label,
.m-field input:not(:placeholder-shown) + .floating-label,
.box-password1 input:focus + .floating-label,
.box-password1 input:not(:placeholder-shown) + .floating-label
 {
    top: -6.5px;
    transform: scale(0.9);
    transform-origin: left;
    font-size: 0.8rem;
}

.m-field input:focus + .floating-label,
.box-password1 input:focus + .floating-label  {
    color: var(--red-texte, var(--red));
}

.m-field input:not(:placeholder-shown):not(:focus) + .floating-label,
.box-password1 input:not(:placeholder-shown):not(:focus) + .floating-label {
    color: #333;
}

.m-field input:-webkit-autofill + .floating-label,
.box-password1 input:-webkit-autofill + .floating-label
.m-field input:-moz-autofill + .floating-label,
.box-password1 input:-moz-autofill + .floating-label {
    top: -6.5px;
    transform: scale(0.9);
    color: var(--red-texte, var(--red));
}
.m-field input:focus ~ .f-icon {
    color: var(--red-texte, var(--red));
}

/* ── Bouton submit modal ── */
.m-submit {
    width: 100%;
    padding: 11px 0;
    margin-top: 10px;
    background: var(--red);
    border: 2px solid var(--red);
    border-radius: 8px;
    color: #000;
    font-family: Verdana, sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.m-submit:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
    transform: translateY(-1px);
}

.m-submit:active { transform: translateY(0); }

/* États bouton S'inscrire */
.modal #signin-button.disabled,
.modal #resetSubmit.disabled {
    background: #444 !important;
    border-color: #444 !important;
    color: #777 !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
    transform: none !important;
}

.modal #signin-button.active {
    background: var(--red) !important;
    border-color: var(--red) !important;
    color: #000 !important;
    cursor: pointer !important;
    opacity: 1 !important;
}

.modal #signin-button.active:hover {
    background: var(--red-dark) !important;
    border-color: var(--red-dark) !important;
    transform: translateY(-1px) !important;
}

.modal #signin-button.loading {
    opacity: 0.7 !important;
    pointer-events: none !important;
}

/* ── Liens bas de modal ── */
.modal-links {
    text-align: center;
    margin-top: 14px;
}

.modal-links a {
    color: var(--red-texte, var(--red));
    font-size: 0.72rem;
    text-decoration: none;
    transition: color 0.2s;
}

.modal-links a:hover { color: var(--red-dark); }

.modal-links p {
    font-size: 0.72rem;
    color: var(--gray-dim);
    margin-top: 8px;
    left: 0;
}

.modal-links p a { font-size: 0.72rem; }

/* ── Checkbox modale ── */
.m-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 4px;
    cursor: pointer;
}

.m-checkbox input { display: none; }

.m-check-box {
    width: 17px;
    height: 17px;
    border: 2px solid var(--red);
    border-radius: 3px;
    background: var(--box-bg);
    flex-shrink: 0;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 1px;
}

.m-checkbox input:checked + .m-check-box { background: var(--red); }

.m-checkbox input:checked + .m-check-box::after {
    content: '✓';
    color: #000;
    font-size: 10px;
    font-weight: bold;
}

.m-checkbox span { font-size: 0.72rem; color: var(--gray); line-height: 1; }
.m-checkbox a { color: var(--red-texte, var(--red)); font-size: 0.72rem; }

/* Checkbox container dans le modal */

/* Messages d'erreur modal */
.modal .custom-error-message {
    background: rgba(255,37,37,0.1) !important;
    color: var(--red-texte, var(--red)) !important;
    padding: 10px 12px !important;
    border-radius: 6px !important;
    border: 1px solid var(--red) !important;
    font-size: 0.72rem !important;
    margin: 6px 0 !important;
}

.form-global-error {
    color: var(--red-texte, var(--red));
    font-size: 0.7rem;
    margin: 6px 0 10px;
    padding: 8px 12px;
    background: rgba(255,37,37,0.08);
    border-radius: 6px;
    border: 1px solid var(--red);
}

/* Indicateurs signup-form.js */
.modal #password-strength-indicator {
    margin: 6px 0 10px !important;
    background: transparent !important;
}

.modal #password-strength-indicator ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 4px 0 0 !important;
}

.modal #password-strength-indicator li {
    font-size: 0.65rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 2px 0 !important;
    left: 0 !important;
    background: transparent !important;
    color: #dc3545;
}

.modal #password-match-indicator {
    margin: 4px 0 8px !important;
    background: transparent !important;
}

.modal #match-text {
    font-size: 0.7rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    left: 0 !important;
    background: transparent !important;
}

/* Flash messages */
.modal-flash { margin-bottom: 12px; }

.modal-flash-item {
    font-size: 0.72rem;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
}

.modal-flash-item.error {
    color: var(--red-texte, var(--red));
    background: rgba(255,37,37,0.1);
    border: 1px solid var(--red);
}

.modal-flash-item.success {
    color: #28a745;
    background: rgba(40,167,69,0.1);
    border: 1px solid #28a745;
}

/* ── Animations ── */
@keyframes borderAnim {
    0%   { background-position: 0 0; }
    50%  { background-position: 300% 0; }
    100% { background-position: 0 0; }
}

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

@keyframes fadeUp-landing {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .modal-glow { max-width: 94vw; }
    .modal { padding: 32px 18px 24px; }
    .landing-actions { flex-direction: column; align-items: center; }
    .btn-landing-primary, .btn-landing-ghost { width: 220px; text-align: center; }
}

/* =====================================================================
   À AJOUTER à la fin de authentication/static/css/account-css.css
   ===================================================================== */

/* ── Texte indicatif sous le sous-titre ── */
.verif-hint {
    text-align: center;
    font-size: 0.76rem;
    color: #888;
    margin: 0 0 20px;
    line-height: 1.5;
}

.verif-hint strong { color: #bbb; }

/* ── Grille des 6 cases ── */
.code-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 16px;
}

.code-digit {
    width: 42px;
    height: 52px;
    background: transparent;
    border: 2px solid var(--border);
    border-radius: 10px;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
    caret-color: var(--red);
}

.code-digit:not(:placeholder-shown) {
    border-color: #555;
    color: #fff;
}
.code-digit:focus {
    border-color: var(--red);
    box-shadow: 0 0 12px rgba(255, 37, 37, 0.3);
    color: #fff;
}

.code-sep {
    color: #444;
    font-size: 1.2rem;
    margin: 0 2px;
    user-select: none;
}

/* ── Animation d'erreur (shake) ── */
@keyframes shake-code {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

.code-inputs.shake {
    animation: shake-code 0.5s ease;
}

/* ── Zone renvoyer ── */
.verif-resend-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 12px 0 4px;
}

.btn-text-link {
    background: none;
    border: none;
    color: var(--red-texte, var(--red));
    font-size: 0.76rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: opacity 0.2s;
    font-family: Verdana, sans-serif;
}

.btn-text-link:hover:not(:disabled) { opacity: 0.75; }
.btn-text-link:disabled { color: #888; cursor: default; opacity: 0.8; }

/* ── Expire warning ── */
.verif-expire {
    text-align: center;
    font-size: 0.65rem;
    color: #555;
    margin: 12px 0 0;
}

/* ── Responsive ── */
@media (max-width: 360px) {
    .code-digit { width: 36px; height: 46px; font-size: 1.2rem; }
    .code-inputs { gap: 5px; }
}

.show1, .show2 {
    z-index : 3;
}

/* 🔥 FIX AUTOFILL CHROME / SAFARI */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px rgb(31,31,31) inset !important;
    box-shadow: 0 0 0 1000px rgb(31,31,31) inset !important;

    -webkit-text-fill-color: #bbb !important;
    caret-color: #bbb !important;

    transition: background-color 9999s ease-in-out 0s;
}

input:-webkit-autofill + .floating-label, {
    top: -6.5px;
    transform: scale(0.9);
    font-size: 0.8rem;

}

.m-field input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px rgb(31,31,31) inset !important;
    box-shadow: 0 0 0 1000px rgb(31,31,31) inset !important;

    -webkit-text-fill-color: #bbb !important;
    caret-color: #bbb !important;
}

/* 🔥 BLOQUER totalement le fond autofill */
.box-password1 input:-webkit-autofill:hover,
.box-password1 input:-webkit-autofill:focus,
.box-password1 input:-webkit-autofill:active {

    -webkit-box-shadow: 0 0 0 1000px rgb(31,31,31) inset !important;
    box-shadow: 0 0 0 1000px rgb(31,31,31) inset !important;

    -webkit-text-fill-color: #bbb !important;
    caret-color: #bbb !important;
}

.box-password1 input:-webkit-autofill:focus {
    border-color: var(--red) !important;
    box-shadow:
        0 0 0 1000px rgb(31,31,31) inset,
        0 0 10px rgba(255,37,37,0.3) !important;
}

.m-field input:-webkit-autofill:focus {
    border-color: var(--red) !important;
    box-shadow:
        0 0 0 1000px rgb(31,31,31) inset,
        0 0 10px rgba(255,37,37,0.3) !important;
}

.box-password1 input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px rgb(31,31,31) inset !important;
    box-shadow: 0 0 0 1000px rgb(31,31,31) inset !important;

    -webkit-text-fill-color: #bbb !important;

    border-radius: 10px !important;
    background-clip: padding-box !important;
}

.m-field input:focus,
.box-password1 input:focus {
    box-shadow:
        0 0 0 1000px rgb(31,31,31) inset,
        0 0 10px rgba(255,37,37,0.3);
}

.m-field input:-moz-autofill,
.box-password1 input:-moz-autofill {

    box-shadow: 0 0 0 1000px rgb(31,31,31) inset !important;

    -moz-text-fill-color: #bbb !important;
    caret-color: #bbb !important;

    filter: brightness(1) !important;
}

/* Réduit au MAX le flash jaune Firefox */
.m-field input:-moz-autofill,
.box-password1 input:-moz-autofill {
    transition: background-color 9999s ease-in-out 0s;
}

form {
    opacity: 0;
    will-change: opacity;
}

form.form-ready {
    opacity: 1;
    transition: opacity 0.2s ease;
}

@keyframes autofill-start {
    from {}
    to {}
}

input:-webkit-autofill {
    animation-name: autofill-start;
    animation-duration: 0.01s;
}

input {
    background-color: #2a2a2a;
    color: #bbb;
    transition: background-color 0.15s ease, color 0.15s ease;
}

#modal-swap {
    width: 100%;
    box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════════════
   Modale 2FA (setup)
   ═══════════════════════════════════════════════════════════════════ */

/* QR code centré, fond blanc (lisibilité du scan) */
.twofa-qr-wrap {
    display: flex;
    justify-content: center;
    margin: 18px 0;
}
.twofa-qr-wrap img {
    width: 190px;
    height: 190px;
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

/* Saisie manuelle (alternative au scan) */
.twofa-manual {
    margin: 12px 0;
    font-size: 0.72rem;
    color: var(--gray);
}
.twofa-manual summary {
    cursor: pointer;
    color: var(--gray);
    transition: color 0.15s;
}
.twofa-manual summary:hover { color: var(--red-texte, var(--red)); }
.twofa-secret-box {
    margin-top: 10px;
    padding: 12px 14px;
    background: var(--box-bg);
    border: 2px solid var(--border);
    border-radius: 10px;
    font-family: monospace;
    font-size: 0.95rem;
    letter-spacing: 2px;
    color: #ddd;
    text-align: center;
    word-break: break-all;
    user-select: all;
}

/* Liste des codes de secours (grille 2 colonnes) */
.twofa-backup-list {
    list-style: none;
    margin: 0 0 6px;
    padding: 16px;
    background: var(--box-bg);
    border: 2px solid var(--border);
    border-radius: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 18px;
    font-family: monospace;
    font-size: 0.9rem;
    color: #eee;
}
.twofa-backup-list li {
    padding: 3px 0;
    letter-spacing: 1px;
    text-align: center;
    user-select: all;
}

/* Boutons d'action 2FA (calqués sur #signin-button) */
.modal-action-btn {
    width: 100%;
    padding: 11px 14px;
    background: var(--red);
    border: 2px solid var(--red);
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.modal-action-btn:hover:not(:disabled) {
    background: var(--red-dark);
    border-color: var(--red-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 37, 37, 0.3);
}
.modal-action-btn:disabled {
    background: #444;
    border-color: #444;
    color: #777;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Variante secondaire (Télécharger les codes) */
.modal-action-btn--secondary {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--gray);
}
.modal-action-btn--secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--red);
    color: var(--red-texte, var(--red));
    transform: none;
    box-shadow: none;
}

/* Case "j'ai noté mes codes" */

/* Bouton visuellement inactif (mais cliquable → affiche un toast explicatif) */
.modal-action-btn.is-inactive {
    background: #444;
    border-color: #444;
    color: #777;
    box-shadow: none;
}
.modal-action-btn.is-inactive:hover {
    background: #444;
    border-color: #444;
    transform: none;
    box-shadow: none;
}

.modal-action-btn.is-loading {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
    opacity: 0.75;
    cursor: wait;
}

/* Edge/IE ajoutent leur propre bouton « révéler le mot de passe » dans les champs
   password, en doublon du nôtre. On les masque : notre bouton est déjà là, et
   celui d'Edge ne suit pas notre design ni notre logique d'accessibilité. */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear{
    display:none;
    width:0;
    height:0;
}
.oauth-sep {
    display: flex; align-items: center; gap: 12px;
    margin: 18px 0; color: var(--gray-dim); font-size: .72rem;
}
.oauth-sep::before, .oauth-sep::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.oauth-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 11px; border-radius: 10px;
    border: 1.5px solid var(--border); background: var(--bg);
    color: var(--text); font-size: .82rem; font-weight: 600;
    text-decoration: none; box-sizing: border-box;
    transition: border-color .15s, background .15s;
}
.oauth-btn:hover { border-color: var(--gray-dim); background: var(--hover-bg); }