/* ============================================================================
   Pages PUBLIQUES « Connexion » (wp-login.php) et « Créer un compte » (/register/) — bureau et tablette.
   Panneau de marque (Desk\AuthDesk : logo, accroche, 3 points forts, personnages des niveaux) à GAUCHE + la carte de formulaire à DROITE ;
   en tablette (801 – 1099 px) le panneau devient une bande fine au-dessus de la carte. Le téléphone (≤ 800 px) ne change pas :
   .ar-auth-brand reste masqué par login.css / register.css, et tout ce qui suit est sous body.ar-auth-dk + @media (min-width: 801px).
   Pas de body.ar-dk2 ici (visiteur déconnecté) : body.ar-auth-dk est posé par LoginPage / RegisterPage quand le filtre
   `school_portal_desktop_v2` est actif (à false : ni panneau ni classe, l'ancien aspect revient).
   Chargé APRÈS login.css / register.css (même spécificité : le dernier gagne ; id de « Login Customizer » : !important ciblé).
   ============================================================================ */

@media (min-width: 801px) {

    /* L'écran « courriel envoyé » pose sa classe de carte (.ar-login-sent) aussi sur <body> : sans cadre ni ombre ici (liseré d'1 px autour de la page). */
    body.login.ar-login.ar-login-sent.ar-auth-dk { margin: 0; border: 0; border-radius: 0; box-shadow: none; }

    /* ---------- Panneau de marque (commun aux deux pages) ---------- */
    /* display : plus fort que « display: none » de login.css (body.login.ar-login …) et de register.css (.ar-auth-brand). */
    body.login.ar-login.ar-auth-dk .ar-auth-brand, body.ar-register.ar-auth-dk .ar-auth-brand { display: flex; }
    body.ar-auth-dk .ar-auth-brand {
        position: relative; flex-direction: column; justify-content: space-between; gap: 28px; box-sizing: border-box; min-width: 0; padding: 48px 56px;
        overflow: hidden; color: #fff; text-align: left; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
        background:
            radial-gradient(circle at 88% 8%, rgba(143, 219, 230, .20), transparent 42%),
            radial-gradient(circle at 6% 96%, rgba(249, 165, 75, .12), transparent 38%),
            linear-gradient(160deg, #0f5967, #0d3f4d 70%);
    }
    body.ar-auth-dk .ar-auth-brand *, body.ar-auth-dk .ar-auth-brand *::before, body.ar-auth-dk .ar-auth-brand *::after { box-sizing: border-box; }

    /* Logo : sur une pastille blanche (le logo du site est turquoise / orange / gris, il disparaîtrait sur le fond sombre). */
    body.ar-auth-dk .ar-auth-brand .ar-auth-logo, body.ar-auth-dk .ar-auth-brand .ar-auth-logo:hover, body.ar-auth-dk .ar-auth-brand .ar-auth-logo:focus {
        display: inline-flex; align-items: center; align-self: flex-start; flex: 0 0 auto; margin: 0; padding: 9px 16px; border: 0; border-radius: 16px;
        background: #fff; box-shadow: 0 12px 28px -14px rgba(0, 0, 0, .55); color: #0f172a; font-size: 17px; font-weight: 800; text-decoration: none;
    }
    body.ar-auth-dk .ar-auth-brand .ar-auth-logo:focus-visible { outline: 3px solid rgba(255, 255, 255, .75); outline-offset: 3px; }
    body.ar-auth-dk .ar-auth-brand .ar-auth-logo img { display: block; width: auto; max-width: 100%; height: 50px; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; }

    body.ar-auth-dk .ar-auth-brand .ar-auth-body { min-width: 0; }
    body.ar-auth-dk .ar-auth-brand .ar-auth-title { margin: 0 0 14px; padding: 0; max-width: 17ch; font-size: clamp(28px, 2.7vw, 38px); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; color: #fff; }
    body.ar-auth-dk .ar-auth-brand .ar-auth-lead { margin: 0; padding: 0; max-width: 44ch; font-size: 16px; line-height: 1.6; color: rgba(255, 255, 255, .88); }
    body.ar-auth-dk .ar-auth-brand .ar-auth-points { display: flex; flex-direction: column; gap: 12px; margin: 26px 0 0; padding: 0; list-style: none; }
    body.ar-auth-dk .ar-auth-brand .ar-auth-points li { display: flex; align-items: center; gap: 10px; margin: 0; padding: 0; font-size: 15px; font-weight: 600; line-height: 1.35; color: #fff; list-style: none; }
    body.ar-auth-dk .ar-auth-brand .ar-auth-points li::before, body.ar-auth-dk .ar-auth-brand .ar-auth-points li::marker { content: none; }
    body.ar-auth-dk .ar-auth-brand .ar-auth-ck { flex: 0 0 auto; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
    body.ar-auth-dk .ar-auth-brand .ar-auth-ck svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

    /* Personnages des niveaux (images du plugin, jamais des lettres) */
    body.ar-auth-dk .ar-auth-brand .ar-auth-levels { display: flex; flex-direction: column; gap: 10px; margin-top: 30px; }
    body.ar-auth-dk .ar-auth-brand .ar-auth-levels-lab { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .62); }
    body.ar-auth-dk .ar-auth-brand .ar-auth-levels-row { display: flex; flex-wrap: wrap; gap: 8px; }
    body.ar-auth-dk .ar-auth-brand .ar-lv { position: relative; display: inline-block; flex: 0 0 auto; border-radius: 50%; }
    body.ar-auth-dk .ar-auth-brand .ar-lv > img {
        display: block; width: 100%; height: 100%; max-width: none; margin: 0; padding: 0; border-radius: 50%; box-sizing: border-box; object-fit: cover;
        background: #fff; border: 2px solid var(--lv, #d5dbe6); box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .45);
    }
    body.ar-auth-dk .ar-auth-brand .ar-lv > .ar-lv-ph { display: none; }

    body.ar-auth-dk .ar-auth-brand .ar-auth-foot { margin: 0; padding: 0; max-width: 52ch; font-size: 12px; line-height: 1.5; color: rgba(255, 255, 255, .68); }
}


/* ============================================================================
   CONNEXION (wp-login.php) — body.login.ar-login.ar-auth-dk
   ============================================================================ */

/* Bureau : brand à gauche, carte à droite (le fond de Login Customizer est remplacé par un fond uni : le panneau fait office d'image). */
@media (min-width: 1100px) {
    body.login.ar-login.ar-auth-dk {
        display: grid; grid-template-columns: minmax(0, 1fr) clamp(480px, 40vw, 620px); grid-template-rows: minmax(0, 1fr) auto; grid-auto-rows: 0;
        align-items: stretch; justify-items: stretch; padding: 0; background-image: none !important; background-color: #f1f7f9;
    }
    body.login.ar-login.ar-auth-dk > * { grid-column: 2; min-width: 0; }
    body.login.ar-login.ar-auth-dk > .ar-auth-brand {
        grid-column: 1; grid-row: 1 / span 2; position: sticky; top: 0; align-self: start; height: 100vh; min-height: 560px; padding: 48px 56px;
    }
    body.login.ar-login.ar-auth-dk div#login { align-self: center; justify-self: center; width: calc(100% - 64px) !important; max-width: 420px; margin: 48px 0 16px !important; }
    /* Le logo est dans le panneau. */
    body.login.ar-login.ar-auth-dk div#login h1 { display: none; }
    body.login.ar-login.ar-auth-dk .language-switcher { align-self: end; justify-self: center; margin: 0; padding: 0 0 28px; }
}

/* Tablette : bande fine au-dessus de la carte (logo, accroche, personnages). */
@media (min-width: 801px) and (max-width: 1099px) {
    body.login.ar-login.ar-auth-dk { padding: 0 24px 28px; background-image: none !important; background-color: #f1f7f9; }
    body.login.ar-login.ar-auth-dk > .ar-auth-brand { align-self: stretch; flex: 0 0 auto; width: auto; margin: 0 -24px; }
    body.login.ar-login.ar-auth-dk div#login { margin: 40px auto 0 !important; }
    body.login.ar-login.ar-auth-dk div#login h1 { display: none; }
}


/* ============================================================================
   BANDE (tablette) — commune aux deux pages
   ============================================================================ */
@media (min-width: 801px) and (max-width: 1099px) {
    body.ar-auth-dk .ar-auth-brand { flex-direction: row; align-items: center; justify-content: space-between; gap: 18px; height: 72px; padding: 0 28px; }
    body.ar-auth-dk .ar-auth-brand .ar-auth-logo, body.ar-auth-dk .ar-auth-brand .ar-auth-logo:hover, body.ar-auth-dk .ar-auth-brand .ar-auth-logo:focus { align-self: center; padding: 6px 12px; border-radius: 12px; }
    body.ar-auth-dk .ar-auth-brand .ar-auth-logo img { height: 34px; }
    body.ar-auth-dk .ar-auth-brand .ar-auth-body { display: flex; flex: 1 1 auto; align-items: center; justify-content: space-between; gap: 16px; }
    body.ar-auth-dk .ar-auth-brand .ar-auth-title { flex: 1 1 0; max-width: none; margin: 0; font-size: 15px; line-height: 1.25; letter-spacing: -.01em; }
    body.ar-auth-dk .ar-auth-brand .ar-auth-lead, body.ar-auth-dk .ar-auth-brand .ar-auth-points,
    body.ar-auth-dk .ar-auth-brand .ar-auth-levels-lab, body.ar-auth-dk .ar-auth-brand .ar-auth-foot { display: none; }
    body.ar-auth-dk .ar-auth-brand .ar-auth-levels { flex: 0 0 auto; margin: 0; }
    /* Pile de personnages qui se chevauchent : la bande reste fine. */
    body.ar-auth-dk .ar-auth-brand .ar-auth-levels-row { flex-wrap: nowrap; gap: 0; }
    body.ar-auth-dk .ar-auth-brand .ar-lv { width: 30px !important; height: 30px !important; margin-left: -8px; }
    body.ar-auth-dk .ar-auth-brand .ar-lv:first-child { margin-left: 0; }
}


/* ============================================================================
   INSCRIPTION (/register/) — widget d'Elementor : le panneau est inséré par desk-auth.js à côté du widget, dans son conteneur.
   Cadre arrondi : panneau à gauche, carte à droite (conteneur = .ar-auth-frame, ou son équivalent par :has() avant que le script ne s'exécute).
   ============================================================================ */
@media (min-width: 1100px) {
    body.ar-register.ar-auth-dk .e-con-inner:has(> .elementor-widget-uael-registration-form) {
        display: grid !important; grid-template-columns: minmax(0, 1fr) clamp(440px, 42%, 540px); align-items: stretch; gap: 0 !important;
        min-height: 700px; padding: 0 !important; overflow: hidden; border: 1px solid #dfe9ee; border-radius: 28px; background: #f1f7f9; box-shadow: 0 26px 60px -34px rgba(13, 63, 77, .5);
    }
    body.ar-register.ar-auth-dk .ar-auth-frame {
        display: grid !important; grid-template-columns: minmax(0, 1fr) clamp(440px, 42%, 540px); align-items: stretch; gap: 0 !important;
        min-height: 700px; padding: 0 !important; overflow: hidden; border: 1px solid #dfe9ee; border-radius: 28px; background: #f1f7f9; box-shadow: 0 26px 60px -34px rgba(13, 63, 77, .5);
    }
    body.ar-register.ar-auth-dk .ar-auth-frame > .ar-auth-brand { grid-column: 1; grid-row: 1; }
    body.ar-register.ar-auth-dk .ar-auth-frame > .elementor-widget-uael-registration-form {
        grid-column: 2; grid-row: 1; align-self: center; justify-self: center; width: calc(100% - 56px) !important; max-width: 440px !important; margin: 36px auto !important;
    }
    /* La mention « élèves mineurs » est déjà au pied du panneau. */
    body.ar-register.ar-auth-dk .ar-reg-minors { display: none; }
}

@media (min-width: 801px) and (max-width: 1099px) {
    body.ar-register.ar-auth-dk .ar-auth-frame {
        display: flex !important; flex-direction: column; align-items: stretch; gap: 0 !important; padding: 0 !important; overflow: hidden;
        border: 1px solid #dfe9ee; border-radius: 24px; background: #f1f7f9; box-shadow: 0 26px 60px -34px rgba(13, 63, 77, .5);
    }
    body.ar-register.ar-auth-dk .ar-auth-frame > .ar-auth-brand { width: auto; }
    body.ar-register.ar-auth-dk .ar-auth-frame > .elementor-widget-uael-registration-form { width: calc(100% - 48px) !important; max-width: 440px !important; margin: 32px auto !important; flex: 0 0 auto !important; }
}
