/* ==========================================================================
   PAGES HORS CONNEXION (v95.1) — connexion, mot de passe oublié, réinitialisation
   Même langage que l'intranet : sombre par défaut, orange du « H », animations
   d'entrée. Tout est coupé si l'utilisateur demande moins d'animations.
   ========================================================================== */

body.auth-page, body:has(.login-area) {
    min-height: 100vh; overflow-x: hidden; background: var(--h-bg) !important;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
html[data-theme="light"] body.auth-page, html[data-theme="light"] body:has(.login-area) { background: #f4f4f5 !important; }

/* --- Fond animé : halos qui dérivent, grille, lignes de carrosserie ------------ */
.auth-fond { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.auth-halo { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; will-change: transform; }
.auth-halo-1 { width: 520px; height: 520px; left: -120px; top: -140px; background: radial-gradient(circle, rgba(245,165,36,.55), transparent 65%); animation: authDerive1 18s ease-in-out infinite alternate; }
.auth-halo-2 { width: 460px; height: 460px; right: -140px; bottom: -160px; background: radial-gradient(circle, rgba(245,120,36,.40), transparent 65%); animation: authDerive2 22s ease-in-out infinite alternate; }
.auth-halo-3 { width: 300px; height: 300px; left: 42%; top: 38%; background: radial-gradient(circle, rgba(250,200,90,.22), transparent 65%); animation: authDerive3 26s ease-in-out infinite alternate; }
html[data-theme="light"] .auth-halo { opacity: .35; }
.auth-grille {
    position: absolute; inset: -50%;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 46px 46px; transform: perspective(700px) rotateX(58deg) translateY(10%);
    mask-image: radial-gradient(ellipse at 50% 60%, #000 25%, transparent 70%);
    animation: authGrille 30s linear infinite;
}
html[data-theme="light"] .auth-grille {
    background-image: linear-gradient(rgba(0,0,0,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.05) 1px, transparent 1px);
}
.auth-lignes { position: absolute; left: 0; bottom: 0; width: 100%; height: 70%; }
.auth-lignes path { fill: none; stroke: rgba(245,165,36,.35); stroke-width: 1.5; stroke-dasharray: 1600; stroke-dashoffset: 1600; animation: authTrace 3.2s cubic-bezier(.6,.1,.2,1) forwards; }
.auth-lignes path:nth-child(2) { stroke: rgba(245,165,36,.18); animation-delay: .35s; }
.auth-lignes path:nth-child(3) { stroke: rgba(255,255,255,.08); animation-delay: .7s; }
html[data-theme="light"] .auth-lignes path:nth-child(3) { stroke: rgba(0,0,0,.08); }

/* --- Mise en page ---------------------------------------------------------------- */
.auth-shell {
    position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
    align-items: center; gap: 48px; max-width: 1180px; margin: 0 auto; padding: 48px 32px;
}
.auth-theme {
    position: fixed; top: 20px; right: 20px; z-index: 5; width: 42px; height: 42px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    background: rgba(255,255,255,.06); border: 1px solid var(--h-border, #e6e6ea); color: var(--h-accent);
    backdrop-filter: blur(8px); transition: transform .2s ease, background-color .2s ease;
}
.auth-theme:hover { transform: rotate(18deg) scale(1.06); }
.auth-theme svg { width: 18px; height: 18px; stroke: var(--h-accent); }
html[data-theme="light"] .auth-theme { background: #fff; }

/* --- Côté marque ------------------------------------------------------------------- */
.auth-marque { color: var(--h-text-strong, #111); }
.auth-logo { margin-bottom: 26px; animation: authApparait .7s cubic-bezier(.2,.9,.25,1.2) .1s backwards; }
.auth-logo-h {
    display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 18px;
    background: linear-gradient(145deg, #ffbf47, #f5a524 45%, #e2870f); color: #17130a; font-weight: 800; font-size: 38px; line-height: 1;
    box-shadow: 0 18px 40px rgba(245,165,36,.35), inset 0 1px 0 rgba(255,255,255,.45);
    position: relative; overflow: hidden;
}
.auth-logo .auth-logo-h { animation: authFlotte 6s ease-in-out 1s infinite; }
.auth-logo-h::after {   /* reflet qui balaie le logo */
    content: ""; position: absolute; top: -40%; left: -60%; width: 40%; height: 180%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); transform: rotate(20deg);
    animation: authReflet 4.5s ease-in-out 1.2s infinite;
}
.auth-titre {
    font-size: clamp(42px, 5.2vw, 64px); font-weight: 800; letter-spacing: -.03em; margin: 0 0 6px; color: var(--h-text-strong, #111);
    animation: authMonte .7s cubic-bezier(.2,.8,.2,1) .2s backwards;
}
.auth-point { color: var(--h-accent); display: inline-block; animation: authPoint 2.4s ease-in-out 1.5s infinite; }
.auth-accroche { font-size: 17px; color: var(--h-muted, #6b7280); margin: 0 0 30px; animation: authMonte .7s cubic-bezier(.2,.8,.2,1) .32s backwards; }
.auth-atouts { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth-atouts li {
    display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--h-text, #374151);
    animation: authGlisse .6s cubic-bezier(.2,.8,.2,1) backwards;
}
.auth-atouts li:nth-child(1) { animation-delay: .45s; }
.auth-atouts li:nth-child(2) { animation-delay: .57s; }
.auth-atouts li:nth-child(3) { animation-delay: .69s; }
.auth-puce {
    width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--h-accent-soft); border: 1px solid rgba(245,165,36,.25); flex-shrink: 0;
}
.auth-puce svg { width: 16px; height: 16px; stroke: var(--h-accent); }

/* --- Carte de connexion ----------------------------------------------------------- */
.auth-carte {
    position: relative; padding: 36px 34px 26px; border-radius: 20px;
    background: rgba(25,25,28,.72); border: 1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow: 0 30px 80px rgba(0,0,0,.45);
    animation: authCarte .75s cubic-bezier(.2,.9,.25,1.1) .25s backwards;
}
html[data-theme="light"] .auth-carte { background: rgba(255,255,255,.82); border-color: #e6e6ea; box-shadow: 0 30px 70px rgba(17,17,17,.12); }
.auth-carte::before {   /* liseré lumineux qui tourne */
    content: ""; position: absolute; inset: -1px; border-radius: 21px; padding: 1px; pointer-events: none;
    background: conic-gradient(from var(--auth-angle, 0deg), transparent 0 70%, rgba(245,165,36,.9) 80%, transparent 90%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
    animation: authTour 6s linear infinite;
}
@property --auth-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.auth-carte-tete { margin-bottom: 22px; }
.auth-carte-tete h2 { font-size: 24px; font-weight: 700; margin: 0 0 4px; color: var(--h-text-strong, #111); }
.auth-carte-tete p { margin: 0; color: var(--h-muted, #6b7280); font-size: 14px; }
.auth-logo-mobile { display: none; width: 46px; height: 46px; font-size: 24px; border-radius: 12px; margin-bottom: 14px; }

.auth-erreur { display: flex; align-items: center; gap: 8px; font-size: 13.5px; border-radius: 10px; }
.auth-erreur svg { width: 17px; height: 17px; flex-shrink: 0; }
.auth-secoue { animation: authCarte .75s cubic-bezier(.2,.9,.25,1.1) .25s backwards, authSecoue .5s ease 1s; }

/* Champs à étiquette flottante */
.auth-champ { position: relative; margin-bottom: 16px; animation: authMonte .5s ease backwards; }
.auth-form .auth-champ:nth-of-type(1) { animation-delay: .45s; }
.auth-form .auth-champ:nth-of-type(2) { animation-delay: .55s; }
.auth-champ input {
    width: 100%; height: 56px; padding: 22px 46px 6px 44px; border-radius: 12px; font-size: 15px;
    background: var(--h-input, #fff) !important; color: var(--h-text-strong, #111) !important;
    border: 1px solid var(--h-border-strong, #d4d4d8); outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
html[data-theme="light"] .auth-champ input { background: #fff !important; border-color: #dcdce2; }
.auth-champ input:focus { border-color: var(--h-accent); box-shadow: 0 0 0 4px var(--h-accent-soft); }
.auth-champ label {
    position: absolute; left: 44px; top: 18px; font-size: 15px; color: var(--h-muted, #6b7280); pointer-events: none;
    transform-origin: left top; transition: transform .2s ease, color .2s ease;
}
.auth-champ input:focus + label, .auth-champ input:not(:placeholder-shown) + label { transform: translateY(-11px) scale(.76); color: var(--h-accent); }
.auth-champ-icone { position: absolute; left: 15px; top: 18px; color: var(--h-muted, #9ca3af); transition: color .2s ease, transform .2s ease; }
.auth-champ-icone svg { width: 18px; height: 18px; }
.auth-champ input:focus ~ .auth-champ-icone { color: var(--h-accent); transform: scale(1.1); }
.auth-oeil {
    position: absolute; right: 10px; top: 12px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent;
    color: var(--h-muted, #9ca3af); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: color .2s, background-color .2s;
}
.auth-oeil:hover, .auth-oeil.actif { color: var(--h-accent); background: var(--h-accent-soft); }
.auth-oeil svg { width: 17px; height: 17px; }

.auth-options { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0 20px; font-size: 13.5px; animation: authMonte .5s ease .62s backwards; }
.auth-souvenir { display: inline-flex; align-items: center; gap: 8px; color: var(--h-text, #374151); cursor: pointer; }
.auth-souvenir .form-check-input { margin: 0; }
.auth-options a { color: var(--h-accent) !important; text-decoration: none; font-weight: 500; }
.auth-options a:hover { text-decoration: underline; }

.auth-bouton {
    width: 100%; height: 52px; border-radius: 12px; font-weight: 600; font-size: 15px;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px; position: relative; overflow: hidden;
    background: linear-gradient(135deg, #ffb83d, #f5a524 50%, #e8901a) !important; border: 0 !important; color: #17130a !important;
    box-shadow: 0 12px 28px rgba(245,165,36,.32); animation: authMonte .5s ease .7s backwards;
}
.auth-bouton svg { width: 18px; height: 18px; transition: transform .25s ease; }
.auth-bouton:hover svg { transform: translateX(4px); }
.auth-bouton:hover { box-shadow: 0 16px 34px rgba(245,165,36,.45); transform: translateY(-1px); }
.auth-bouton::after {   /* brillance au survol */
    content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-20deg);
}
.auth-bouton:hover::after { animation: authBrille .8s ease; }
.auth-bouton.h-envoi::after { animation: hTourne .7s linear infinite; }
.auth-pied { margin: 22px 0 0; text-align: center; font-size: 12px; color: var(--h-muted, #9ca3af); }

/* --- Mot de passe oublié / réinitialisation (ancienne mise en page) ---------------- */
body:has(.login-area)::before {
    content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(600px 400px at 10% 0%, rgba(245,165,36,.22), transparent 70%),
                radial-gradient(500px 400px at 100% 100%, rgba(245,120,36,.18), transparent 70%);
    animation: authRespire 9s ease-in-out infinite alternate;
}
.login-area { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 40px 0; }
.login-area img[alt="logo"] { display: none; }
.login-area > .text-center:first-child a::before {
    content: "H"; display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 16px;
    background: linear-gradient(145deg, #ffbf47, #f5a524 45%, #e2870f); color: #17130a; font: 800 32px/1 Inter, Arial, sans-serif;
    box-shadow: 0 16px 36px rgba(245,165,36,.35); animation: authApparait .7s cubic-bezier(.2,.9,.25,1.2) backwards;
}
.login-area > .text-center:first-child a { text-decoration: none; }
.login-area .card {
    border-radius: 20px !important; background: rgba(25,25,28,.75) !important; border: 1px solid rgba(255,255,255,.08) !important;
    backdrop-filter: blur(16px); box-shadow: 0 30px 80px rgba(0,0,0,.45) !important; animation: authCarte .7s cubic-bezier(.2,.9,.25,1.1) .15s backwards;
}
html[data-theme="light"] .login-area .card { background: rgba(255,255,255,.88) !important; border-color: #e6e6ea !important; box-shadow: 0 30px 70px rgba(17,17,17,.12) !important; }
.login-area .btn-primary { border-radius: 12px !important; font-weight: 600; box-shadow: 0 12px 28px rgba(245,165,36,.3); }

/* --- Mobile ------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .auth-shell { grid-template-columns: 1fr; gap: 0; padding: 24px 16px; max-width: 480px; }
    .auth-marque { display: none; }
    .auth-logo-mobile { display: inline-flex; }
    .auth-carte { padding: 28px 22px 22px; }
}

/* --- Animations -------------------------------------------------------------------- */
@keyframes authDerive1 { to { transform: translate(140px, 90px) scale(1.15); } }
@keyframes authDerive2 { to { transform: translate(-120px, -80px) scale(1.1); } }
@keyframes authDerive3 { to { transform: translate(-160px, 60px) scale(1.3); } }
@keyframes authGrille { to { background-position: 0 460px; } }
@keyframes authTrace { to { stroke-dashoffset: 0; } }
@keyframes authApparait { from { opacity: 0; transform: scale(.6) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes authFlotte { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(-3deg); } }
@keyframes authReflet { 0%, 60% { left: -60%; } 100% { left: 130%; } }
@keyframes authPoint { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes authMonte { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes authGlisse { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes authCarte { from { opacity: 0; transform: translateY(28px) scale(.97); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes authTour { to { --auth-angle: 360deg; } }
@keyframes authSecoue { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }
@keyframes authBrille { to { left: 130%; } }
@keyframes authRespire { to { opacity: .6; transform: scale(1.08); } }

@media (prefers-reduced-motion: reduce) {
    .auth-fond *, .auth-logo, .auth-logo .auth-logo-h, .auth-logo-h::after, .auth-titre, .auth-point, .auth-accroche,
    .auth-atouts li, .auth-carte, .auth-carte::before, .auth-champ, .auth-options, .auth-bouton, .auth-secoue,
    body:has(.login-area)::before, .login-area .card, .login-area > .text-center:first-child a::before { animation: none !important; }
    .auth-lignes path { stroke-dashoffset: 0; }
}
