/* Pages d'authentification (connexion, inscription, mot de passe) */
:root {
  --auth-primary: var(--brand-500);
  --auth-primary-dark: var(--brand-600);
  --auth-soft: var(--brand-50);
  --auth-ink: var(--ink-700);
  --auth-sand: var(--warm-300);
  --auth-sage: var(--ok-500);
  --auth-text: var(--ink-700);
  --auth-muted: var(--muted);
  --auth-border: var(--line);
  --auth-display: 'Nunito', 'Inter', system-ui, sans-serif;
  --auth-radius: 12px;
  --auth-spring: cubic-bezier(.34, 1.56, .64, 1);
  --auth-ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
body.auth-page {
  margin: 0; min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--auth-text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
@view-transition { navigation: auto; }

/* ---------- Mise en page deux panneaux ---------- */
.auth-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth-aside {
  position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding: 40px clamp(28px, 4vw, 64px); color: var(--auth-ink);
  background: var(--bg-2) radial-gradient(var(--line-strong) 1.4px, transparent 1.6px); background-size: 24px 24px;
  border-right: 1px solid var(--auth-border);
}
.auth-doodle { position: absolute; z-index: -1; pointer-events: none; background: center / contain no-repeat; }
.auth-doodle.cloud { width: 130px; height: 68px; background-image: url('/assets/images/doodles/cloud.svg?v=2'); animation: auth-drift 16s ease-in-out infinite; }
.auth-doodle.cloud.c1 { top: 16%; right: 10%; }
.auth-doodle.cloud.c2 { bottom: 26%; right: 36px; width: 90px; animation-delay: -6s; }
.auth-doodle.sun { width: 84px; height: 84px; top: 28px; right: 28px; background: var(--warm-300); -webkit-mask: url('/assets/images/doodles/sun.svg') center / contain no-repeat; mask: url('/assets/images/doodles/sun.svg') center / contain no-repeat; animation: auth-spin 60s linear infinite; }
.auth-doodle.star { width: 26px; height: 26px; background: var(--warm-300); -webkit-mask: url('/assets/images/doodles/star.svg') center / contain no-repeat; mask: url('/assets/images/doodles/star.svg') center / contain no-repeat; animation: auth-twinkle 4s ease-in-out infinite; }
.auth-doodle.star.s1 { top: 42%; right: 30%; }
.auth-doodle.star.s2 { bottom: 14%; left: 48%; animation-delay: -2s; }
.auth-doodle.heart { width: 30px; height: 28px; top: 60%; right: 14%; background: var(--brand-400); -webkit-mask: url('/assets/images/doodles/heart.svg') center / contain no-repeat; mask: url('/assets/images/doodles/heart.svg') center / contain no-repeat; animation: auth-float 5s ease-in-out infinite; }
.auth-aside-brand { position: relative; display: inline-flex; align-items: center; gap: 12px; color: var(--auth-ink); text-decoration: none; font-family: var(--auth-display); font-weight: 800; font-size: 1.25rem; }
.auth-aside-brand img { width: 52px; background: #fff; border-radius: 16px; padding: 6px; box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--ink-700) 50%, transparent); }
.auth-aside-body { position: relative; }
.auth-aside h2 { font-family: var(--auth-display); font-size: clamp(1.9rem, 3.2vw, 2.7rem); font-weight: 800; line-height: 1.15; margin: 0 0 26px; }
.auth-aside h2 span { position: relative; color: var(--auth-primary); white-space: nowrap; }
.auth-aside h2 span::after { content: ''; position: absolute; left: 0; right: 0; bottom: -.1em; height: .3em; z-index: -1; background: var(--warm-300); -webkit-mask: url('/assets/images/doodles/squiggle.svg') center / 100% 100% no-repeat; mask: url('/assets/images/doodles/squiggle.svg') center / 100% 100% no-repeat; }
.auth-benefits { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.auth-benefits li { display: flex; align-items: center; gap: 12px; font-size: 1rem; color: var(--ink-600); opacity: 0; animation: auth-in .6s var(--auth-ease) forwards; animation-delay: var(--d); }
.auth-benefits i { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--auth-primary); box-shadow: 0 4px 12px -6px color-mix(in srgb, var(--ink-700) 30%, transparent); }
.auth-floating { position: relative; height: 130px; margin-top: 34px; }
.auth-float-card {
  position: absolute; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 18px;
  background: #fff; color: var(--auth-ink); font-size: .88rem; font-weight: 600; border: 1px solid var(--auth-border);
  box-shadow: 0 20px 40px -22px color-mix(in srgb, var(--ink-700) 45%, transparent); animation: auth-float 6s ease-in-out infinite;
}
.auth-float-card.c1 { left: 0; top: 0; }
.auth-float-card.c1 i { color: var(--auth-sage); font-size: 1.1rem; }
.auth-float-card.c2 { left: 30%; top: 64px; animation-delay: -3s; }
.auth-float-card .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--auth-primary); box-shadow: 0 0 0 4px var(--auth-soft); }
.auth-founder {
  position: relative; padding: 18px 20px; border-radius: 22px; max-width: 420px;
  background: var(--warm-50); border: 2px dashed var(--warm-200);
}
.auth-founder-top { display: flex; align-items: center; gap: 8px; font-size: .95rem; font-family: var(--auth-display); }
.auth-founder-top i { color: var(--auth-primary); }
.auth-founder p { margin: 6px 0 12px; color: var(--ink-600); }
.auth-founder-bar { height: 8px; border-radius: 99px; background: var(--warm-100); overflow: hidden; }
.auth-founder-bar span { display: block; height: 100%; border-radius: inherit; background: var(--brand-400); animation: auth-bar 1.4s var(--auth-ease) both .3s; transform-origin: left; }
.auth-founder small { display: block; margin-top: 8px; color: var(--auth-muted); }

.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card {
  width: 100%; max-width: 440px; background: #fff; border-radius: 28px; border: 1px solid var(--auth-border);
  box-shadow: 0 30px 60px -34px color-mix(in srgb, var(--ink-700) 30%, transparent); padding: 36px 34px;
  animation: authSlideUp .5s var(--auth-ease);
}
.auth-card.wide { max-width: 520px; }
.auth-legal { margin-top: 18px; font-size: .8rem; color: var(--auth-muted); }
.auth-legal a { color: inherit; text-decoration: none; }
.auth-legal a:hover { color: var(--auth-primary-dark); }
.auth-founder-mini {
  display: none; margin: -6px 0 18px; padding: 10px 12px; border-radius: 12px; text-align: center; font-size: .82rem; font-weight: 600;
  color: var(--auth-ink); background: var(--warm-50); border: 1px dashed var(--warm-200); text-decoration: none;
}
.auth-founder-mini i { color: var(--auth-primary); }

@keyframes authSlideUp { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes auth-in { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes auth-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes auth-drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(18px); } }
@keyframes auth-twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(.8) rotate(20deg); } }
@keyframes auth-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* ---------- Formulaire ---------- */
.auth-logo { text-align: center; margin-bottom: 18px; }
.auth-logo img { height: 56px; width: auto; transition: transform .4s var(--auth-spring); }
.auth-logo a:hover img { transform: rotate(-6deg) scale(1.06); }
.auth-title { font-family: var(--auth-display); font-size: 1.7rem; font-weight: 800; letter-spacing: -.01em; text-align: center; margin: 0 0 6px; }
.auth-subtitle { text-align: center; color: var(--auth-muted); margin: 0 0 24px; font-size: .95rem; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--ink-600); }
.auth-input-wrap { position: relative; }
.auth-input {
  width: 100%; padding: 12px 14px; font-size: 1rem; font-family: inherit; color: var(--auth-text);
  border: 1px solid var(--auth-border); border-radius: 14px; background: var(--bg);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-input:hover { border-color: var(--line-strong); }
.auth-input:focus { outline: none; border-color: var(--auth-primary); background: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-500) 14%, transparent); }
.auth-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--faint); cursor: pointer; padding: 6px; border-radius: 8px; }
.auth-toggle:hover { color: var(--ink-700); background: var(--bg-2); }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.auth-row label { margin: 0; }
.auth-link { color: var(--auth-primary-dark); text-decoration: none; font-weight: 600; font-size: .9rem; }
.auth-link:hover { text-decoration: underline; }
.auth-btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px 16px; font-size: 1rem; font-weight: 800; font-family: var(--auth-display);
  border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .15s var(--auth-ease), box-shadow .15s, background .15s, border-color .15s, filter .15s;
}
.auth-btn:active { transform: translateY(1px) scale(.99); }
.auth-btn-primary { background: var(--auth-primary); color: #fff; box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--brand-500) 90%, transparent); }
.auth-btn-primary:hover { background: var(--auth-primary-dark); transform: translateY(-1px); }
.auth-btn.is-loading { color: transparent; pointer-events: none; }
.auth-btn.is-loading::after { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: auth-spin .7s linear infinite; }
.auth-btn-google { background: #fff; color: var(--ink-700); border-color: var(--auth-border); box-shadow: 0 1px 2px color-mix(in srgb, var(--ink-700) 5%, transparent); }
.auth-btn-google:hover { background: var(--bg); border-color: var(--line-strong); transform: translateY(-1px); box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--ink-700) 30%, transparent); }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 22px 0; color: var(--faint); font-size: .82rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--auth-border); }
.auth-footer { margin-top: 22px; text-align: center; font-size: .9rem; color: var(--auth-muted); }
.auth-alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; font-size: .92rem; line-height: 1.45; animation: authSlideUp .35s var(--auth-ease); }
.auth-alert-error { background: var(--bad-50); color: var(--bad-600); border: 1px solid var(--bad-100); }
.auth-alert-success { background: var(--ok-50); color: var(--ok-700); border: 1px solid var(--ok-100); }
.auth-alert-warning { background: var(--warm-50); color: var(--warm-700); border: 1px solid var(--warm-100); }
.auth-alert-info { background: var(--ink-50); color: var(--ink-700); border: 1px solid var(--ink-100); }
.auth-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-role { position: relative; }
.auth-role input { position: absolute; opacity: 0; width: 0; height: 0; }
.auth-role span {
  display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%;
  padding: 16px 10px; border: 2px solid var(--auth-border); border-radius: 16px; cursor: pointer;
  background: var(--bg); font-family: var(--auth-display); font-weight: 800; font-size: .95rem; transition: all .2s var(--auth-ease); text-align: center;
}
.auth-role span small { font-family: 'Inter', sans-serif; font-weight: 500; font-size: .74rem; color: var(--auth-muted); }
.auth-role span i { font-size: 1.6rem; color: var(--faint); transition: transform .35s var(--auth-spring), color .2s; }
.auth-role span:hover { border-color: var(--brand-200); transform: translateY(-2px); }
.auth-role input:checked + span { border-color: var(--auth-primary); background: var(--auth-soft); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-500) 12%, transparent); }
.auth-role input:checked + span i { color: var(--auth-primary); transform: scale(1.18) rotate(-6deg); }
.auth-role input:focus-visible + span { outline: 2px solid var(--auth-primary); outline-offset: 2px; }
.auth-check { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; color: var(--ink-600); margin: 4px 0 18px; }
.auth-check input { margin-top: 3px; accent-color: var(--auth-primary); }
.auth-hint { font-size: .78rem; color: var(--auth-muted); margin: 6px 0 0; }
.auth-strength { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.auth-strength i { flex: 1; height: 5px; border-radius: 99px; background: var(--line); transition: background .3s; }
.auth-strength span { min-width: 70px; text-align: right; font-size: .75rem; font-weight: 600; color: var(--auth-muted); }
.auth-strength[data-strength="0"] i:nth-child(-n+1),
.auth-strength[data-strength="1"] i:nth-child(-n+1) { background: var(--brand-400); }
.auth-strength[data-strength="2"] i:nth-child(-n+2) { background: var(--warm-300); }
.auth-strength[data-strength="3"] i:nth-child(-n+3),
.auth-strength[data-strength="4"] i:nth-child(-n+4) { background: var(--ok-500); }

/* ==========================================================================
   Finitions : halos, entrée en cascade et reflets
   ========================================================================== */
@property --auth-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes auth-angle { to { --auth-angle: 360deg; } }
@keyframes auth-aurora {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-3%, 3%, 0) scale(1.08) rotate(2deg); }
  100% { transform: translate3d(3%, -2%, 0) scale(1.04) rotate(-2deg); }
}
@keyframes auth-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes auth-shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
@keyframes auth-shine { 0%, 55% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
@keyframes auth-glow { from { transform: translate(-50%, -50%) scale(.9); opacity: .7; } to { transform: translate(-46%, -54%) scale(1.12); opacity: 1; } }

/* Panneau de présentation : trois halos de la palette qui dérivent derrière les dessins */
.auth-aside::before {
  content: ''; position: absolute; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(34vmax 34vmax at 80% 22%, color-mix(in srgb, var(--brand-300) 46%, transparent), transparent 70%),
    radial-gradient(30vmax 30vmax at 8% 90%, color-mix(in srgb, var(--warm-200) 62%, transparent), transparent 70%),
    radial-gradient(26vmax 26vmax at 46% 46%, color-mix(in srgb, var(--ok-200) 34%, transparent), transparent 70%);
}
@media (hover: hover) and (pointer: fine) { .auth-aside::before { animation: auth-aurora 22s ease-in-out infinite alternate; will-change: transform; } }
.auth-aside h2 span {
  background: linear-gradient(100deg, var(--brand-700), var(--brand-500) 50%, var(--brand-700)) 0 0 / 220% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
  animation: auth-gradient 8s ease-in-out infinite;
}
.auth-aside h2 span::after { animation: auth-draw 1.2s var(--auth-ease) .9s backwards; }
@keyframes auth-gradient { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes auth-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.auth-benefits li:hover i { transform: scale(1.12) rotate(-6deg); color: var(--auth-primary-dark); }
.auth-benefits i { transition: transform .35s var(--auth-spring), color .2s; }
.auth-founder-bar span { background: linear-gradient(90deg, var(--brand-500), var(--brand-300)); position: relative; overflow: hidden; }
.auth-founder-bar span::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .6) 50%, transparent 70%); animation: auth-shine 3.4s ease-in-out 1.6s infinite; }

/* Colonne du formulaire : un halo doux respire derrière la carte */
.auth-main { position: relative; overflow: hidden; isolation: isolate; }
.auth-main::before {
  content: ''; position: absolute; z-index: -1; left: 50%; top: 50%; width: min(900px, 130vw); aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand-300) 38%, transparent), color-mix(in srgb, var(--warm-200) 22%, transparent) 45%, transparent 70%);
  transform: translate(-50%, -50%);
}
@media (hover: hover) and (pointer: fine) { .auth-main::before { animation: auth-glow 11s ease-in-out infinite alternate; } }

/* Carte : fin liseré dégradé qui tourne, puis éléments qui arrivent l'un après l'autre */
@supports (background: conic-gradient(from 0deg, red, blue)) {
  .auth-card {
    border: 1px solid transparent;
    background: linear-gradient(#fff, #fff) padding-box,
      conic-gradient(from var(--auth-angle), color-mix(in srgb, var(--brand-300) 80%, transparent), var(--line), color-mix(in srgb, var(--warm-300) 80%, transparent), var(--line), color-mix(in srgb, var(--brand-300) 80%, transparent)) border-box;
  }
  @media (hover: hover) and (pointer: fine) { .auth-card { animation: authSlideUp .5s var(--auth-ease), auth-angle 14s linear infinite; } }
}
.auth-card > *, .auth-card form > * { animation: auth-rise .6s var(--auth-ease) backwards; }
.auth-card > :nth-child(1) { animation-delay: .05s; } .auth-card > :nth-child(2) { animation-delay: .1s; }
.auth-card > :nth-child(3) { animation-delay: .15s; } .auth-card > :nth-child(4) { animation-delay: .2s; }
.auth-card > :nth-child(5) { animation-delay: .25s; } .auth-card > :nth-child(6) { animation-delay: .3s; }
.auth-card > :nth-child(n+7) { animation-delay: .35s; }
.auth-card form > :nth-child(1) { animation-delay: .25s; } .auth-card form > :nth-child(2) { animation-delay: .32s; }
.auth-card form > :nth-child(3) { animation-delay: .39s; } .auth-card form > :nth-child(4) { animation-delay: .46s; }
.auth-card form > :nth-child(5) { animation-delay: .53s; } .auth-card form > :nth-child(n+6) { animation-delay: .6s; }

/* Champs : le libellé prend la couleur principale quand on écrit dedans */
.auth-field label { transition: color .2s; }
.auth-field:focus-within > label, .auth-field:focus-within .auth-row label { color: var(--auth-primary-dark); }
.auth-input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-500) 14%, transparent), 0 10px 24px -14px color-mix(in srgb, var(--brand-500) 60%, transparent); }
.auth-toggle i { transition: transform .3s var(--auth-spring); }
.auth-toggle:active i { transform: scale(.8); }

/* Bouton principal : dégradé qui glisse au survol et reflet qui balaie */
.auth-btn-primary { overflow: hidden; background: linear-gradient(135deg, var(--brand-400), var(--brand-500) 55%, var(--brand-600)) 0 0 / 150% 100%; transition: transform .15s var(--auth-ease), box-shadow .25s, background-position .7s var(--auth-ease); }
.auth-btn-primary:hover { background-position: 100% 0; box-shadow: 0 18px 30px -14px color-mix(in srgb, var(--brand-500) 90%, transparent); }
.auth-btn-primary::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 32%, rgba(255, 255, 255, .34) 50%, transparent 68%); transform: translateX(-130%); }
.auth-btn-primary:hover::before { transform: translateX(130%); transition: transform .9s var(--auth-ease); }
.auth-btn i { transition: transform .3s var(--auth-spring); }
.auth-btn:hover i { transform: translateX(3px); }

/* Message d'erreur : petit tremblement pour attirer l'œil */
.auth-alert-error { animation: authSlideUp .35s var(--auth-ease), auth-shake .5s .12s; }

/* Choix du profil : la pastille cochée « respire » */
.auth-role input:checked + span { animation: authPulse .5s var(--auth-spring); }
@keyframes authPulse { 0% { transform: scale(.96); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }

@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-main { min-height: 100vh; background: var(--bg-2) radial-gradient(var(--line-strong) 1.4px, transparent 1.6px); background-size: 24px 24px; }
  .auth-founder-mini { display: block; }
}
@media (max-width: 480px) { .auth-card { padding: 28px 20px; border-radius: 20px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .auth-benefits li { opacity: 1; } }

/* Prénom / Nom côte à côte, empilés sur très petit écran */
.auth-field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 360px) { .auth-field-row { grid-template-columns: minmax(0, 1fr); gap: 0; } }
