:root{
  /* Couleurs (uniformisées avec le thème global)
     - Les variables --primary / --primary-dark sont injectées via PHP (login/forgot/reset)
     - Fallbacks: valeurs ci-dessous
  */
  --primary: #C8102E;
  --primary-dark: #A50E26;

  /* RGB helpers (override via Paramètres -> Couleurs) */
  --app-primary-rgb: 200,16,46;
  --app-primary-dark-rgb: 165,14,38;

  /* Legacy names (conservées pour compatibilité) */
  --alsace-red: var(--primary);
  --alsace-red-2: var(--primary-dark);
  --alsace-cream:#f7f1e8;

  --auth-bg:var(--alsace-cream);
  --auth-card:#ffffff;
  --auth-muted:#6b7280;
  --auth-input:#f1f2f4;
  --auth-radius:28px;
  --auth-shadow:0 20px 60px rgba(15, 23, 42, .18);
  --auth-grad:linear-gradient(135deg, var(--alsace-red) 0%, var(--alsace-red-2) 100%);
}

body.auth-page{
  min-height:100vh;
  background: radial-gradient(1200px 700px at 50% -10%, rgba(var(--app-primary-rgb), .10), transparent 60%),
              radial-gradient(900px 600px at 100% 0%, rgba(var(--app-primary-dark-rgb), .10), transparent 55%),
              var(--auth-bg);
}

.auth-shell{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}

.auth-card{
  position:relative;
  width:min(420px, 100%);
  background:var(--auth-card);
  border-radius:var(--auth-radius);
  box-shadow:var(--auth-shadow);
  padding:34px 26px 30px;
  overflow:hidden;
}

.auth-blob{
  position:absolute;
  background:var(--auth-grad);
  filter:saturate(1.05);
  opacity:.22;
  z-index:0;
}

.auth-blob.one{
  top:-70px;
  left:50%;
  transform:translateX(-50%) rotate(-10deg);
  width:320px;
  height:210px;
  border-radius:110px;
}

.auth-blob.two{
  top:-55px;
  right:-95px;
  width:190px;
  height:150px;
  border-radius:90px;
  transform:rotate(25deg);
  opacity:.18;
}

.auth-blob.three{
  bottom:-70px;
  left:-95px;
  width:210px;
  height:170px;
  border-radius:95px;
  transform:rotate(-18deg);
  opacity:.18;
}

.auth-content{
  position:relative;
  z-index:1;
}

/* Logo rond type avatar */
.auth-logo-ring{
  width:84px;
  height:84px;
  border-radius:999px;
  background:#fff;
  border:3px solid rgba(var(--app-primary-rgb), .18);
  box-shadow:0 14px 28px rgba(15, 23, 42, .12);
  display:grid;
  place-items:center;
  margin:0 auto 12px;
}

.auth-logo-img{
  width:54px;
  height:54px;
  object-fit:contain;
}

.auth-brand{
  font-weight:800;
  letter-spacing:.2px;
  color:#111827;
  margin:0;
  text-align:center;
  font-size:18px;
}

.auth-title{
  font-size:30px;
  line-height:1.15;
  font-weight:800;
  color:var(--alsace-red);
  margin:10px 0 8px 0;
  text-align:center;
}

.auth-subtitle{
  color:var(--auth-muted);
  font-size:13px;
  text-align:center;
  margin:0 0 16px 0;
}

.auth-input{
  background:var(--auth-input);
  border:1px solid rgba(17,24,39,.08);
  border-radius:12px;
  padding:12px 14px;
}

.auth-input:focus{
  background:#ffffff;
  border-color:rgba(var(--app-primary-rgb), .35);
  box-shadow:0 0 0 .2rem rgba(var(--app-primary-rgb), .14);
}

.auth-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.auth-link{
  color:rgba(17,24,39,.72);
  text-decoration:none;
  font-size:13px;
}

.auth-link:hover{ text-decoration:underline; }

.auth-btn{
  border:none;
  border-radius:14px;
  padding:12px 16px;
  font-weight:800;
  color:#ffffff;
  background:var(--auth-grad);
  box-shadow:0 10px 26px rgba(var(--app-primary-rgb), .22);
}

.auth-btn:hover{ filter:brightness(.98); }

.auth-muted{
  color:var(--auth-muted);
  font-size:13px;
  text-align:center;
}

@media (max-width:380px){
  .auth-card{padding:28px 18px 24px;}
  .auth-title{font-size:26px;}
  .auth-logo-ring{width:76px;height:76px;}
  .auth-logo-img{width:48px;height:48px;}
}

/* Loader overlay (login) */
.auth-loader{
  position:fixed;
  inset:0;
  z-index:2000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(10, 14, 25, .55);
  backdrop-filter: blur(6px);
}

.auth-loader-card{
  width:min(360px, 92vw);
  background:rgba(255,255,255,.96);
  border-radius:22px;
  box-shadow:0 20px 60px rgba(15, 23, 42, .35);
  padding:18px 18px 14px;
  text-align:center;
}

.auth-loader-title{
  font-weight:800;
  margin-top:6px;
  color:#111827;
}

.auth-loader-sub{
  font-size:13px;
  color:#6b7280;
}

/* Animation de connexion autour du logo */
.auth-loader{animation:authLoaderIn .25s ease both;}
.auth-loader-card{padding:28px 22px 22px;animation:authConnCardIn .45s cubic-bezier(.2,.8,.2,1) both;}
.auth-conn{position:relative;width:132px;height:132px;margin:2px auto 14px;}
.auth-conn > span{position:absolute;border-radius:50%;}
.auth-conn-halo{inset:10px;background:var(--app-primary,#C8102E);opacity:.16;animation:authConnHalo 2.2s ease-out infinite;}
.auth-conn-ring{inset:0;
  -webkit-mask:radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
          mask:radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));}
.auth-conn-ring.r1{background:conic-gradient(from 0deg, transparent 0 15%, var(--app-primary,#C8102E) 60%, transparent 61% 100%);animation:authConnSpin 1.15s linear infinite;}
.auth-conn-ring.r2{inset:12px;opacity:.55;background:conic-gradient(from 180deg, transparent 0 40%, var(--app-primary,#C8102E) 85%, transparent 86% 100%);animation:authConnSpin 1.8s linear infinite reverse;}
.auth-conn-orbit{inset:-4px;animation:authConnSpin 2.6s cubic-bezier(.55,.1,.45,.9) infinite;}
.auth-conn-orbit i{position:absolute;top:0;left:50%;width:10px;height:10px;margin-left:-5px;border-radius:50%;
  background:var(--app-primary,#C8102E);box-shadow:0 0 0 4px rgba(255,255,255,.9), 0 0 14px var(--app-primary,#C8102E);}
.auth-conn-logo{inset:24px;background:#fff;display:flex;align-items:center;justify-content:center;
  box-shadow:0 8px 22px rgba(15,23,42,.14), inset 0 0 0 1px rgba(15,23,42,.06);animation:authConnBreathe 2.2s ease-in-out infinite;}
.auth-conn-logo img{width:62%;height:62%;object-fit:contain;}
.auth-conn-dots i{font-style:normal;animation:authConnDot 1.2s infinite;}
.auth-conn-dots i:nth-child(2){animation-delay:.2s}
.auth-conn-dots i:nth-child(3){animation-delay:.4s}
.auth-conn-bar{height:4px;border-radius:4px;background:rgba(15,23,42,.07);overflow:hidden;margin:14px auto 2px;width:70%;}
.auth-conn-bar span{display:block;height:100%;width:40%;border-radius:4px;background:var(--app-primary,#C8102E);animation:authConnBar 1.4s ease-in-out infinite;}
@keyframes authConnSpin{to{transform:rotate(360deg)}}
@keyframes authConnHalo{0%{transform:scale(.85);opacity:.22}70%{transform:scale(1.25);opacity:0}100%{opacity:0}}
@keyframes authConnBreathe{0%,100%{transform:scale(1)}50%{transform:scale(1.05)}}
@keyframes authConnDot{0%,100%{opacity:.2}40%{opacity:1}}
@keyframes authConnBar{0%{transform:translateX(-110%)}100%{transform:translateX(260%)}}
@keyframes authConnCardIn{from{opacity:0;transform:translateY(12px) scale(.96)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion: reduce){
  .auth-conn *, .auth-conn > span, .auth-conn-bar span, .auth-conn-dots i, .auth-loader-card{animation-duration:3s!important;animation-iteration-count:infinite}
  .auth-conn-halo, .auth-conn-logo, .auth-loader-card{animation:none!important}
}

.auth-btn[disabled]{
  opacity:.7;
  cursor:not-allowed;
}

/* ── Animations d'entrée (page de connexion) ───────────────────────────── */
@keyframes authIn   { from{ opacity:0; transform:translateY(20px) scale(.985);} to{ opacity:1; transform:none; } }
@keyframes authPop  { 0%{ opacity:0; transform:scale(.7) rotate(-8deg);} 60%{ opacity:1; transform:scale(1.06) rotate(2deg);} 100%{ opacity:1; transform:none; } }
@keyframes authFade { from{ opacity:0; transform:translateY(10px);} to{ opacity:1; transform:none; } }
@keyframes authBlob { 0%,100%{ transform:translate(0,0) scale(1);} 50%{ transform:translate(14px,-16px) scale(1.10);} }
@keyframes authLoaderIn { from{ opacity:0;} to{ opacity:1; } }

.auth-card{ animation: authIn .7s cubic-bezier(.2,.8,.2,1) both; }
.auth-logo-ring{ animation: authPop .85s cubic-bezier(.2,.8,.2,1) .10s both; }
.auth-brand{ animation: authFade .6s ease .26s both; }
.auth-title{ animation: authFade .6s ease .34s both; }
.auth-content form > *{ animation: authFade .55s ease both; }
.auth-content form > *:nth-child(1){ animation-delay:.42s; }
.auth-content form > *:nth-child(2){ animation-delay:.50s; }
.auth-content form > *:nth-child(3){ animation-delay:.58s; }
.auth-content form > *:nth-child(4){ animation-delay:.66s; }
.auth-content form > *:nth-child(5){ animation-delay:.74s; }
.auth-content form > *:nth-child(6){ animation-delay:.82s; }
.auth-blob{ animation: authBlob 9s ease-in-out infinite; }
.auth-blob.two{ animation-duration:11s; animation-delay:-3s; }
.auth-blob.three{ animation-duration:13s; animation-delay:-6s; }
.auth-loader{ animation: authLoaderIn .25s ease both; }

@media (prefers-reduced-motion: reduce){
  .auth-card, .auth-logo-ring, .auth-brand, .auth-title,
  .auth-content form > *, .auth-blob, .auth-loader{ animation:none !important; }
}
