/* ============================================================
   Gubernix – Authentification (inscription / connexion)
   Design repris du site vitrine (bloc "Connexion" / "Demande de demo" /
   "Creer votre espace" du fichier gubernix-version-github-13-10-26.html),
   adapte ici en feuille de style autonome pour les pages Twig
   d'authentification de l'application (inscription, etc.).
   Toutes les regles sont scopees sous .gbx-auth pour ne jamais
   interferer avec le theme du back-office.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700&display=swap');

/* Taille de police fluide, mais plafonnee a 16px : retrecit sur petit ecran,
   ne grandit jamais au-dela (sinon tout le formulaire deborde en hauteur). */
html { font-size: clamp(13px, calc(7.8px + 0.68vw), 16px); }

.gbx-auth, .gbx-auth *, .gbx-auth *::before, .gbx-auth *::after {
  box-sizing: border-box;
}

.gbx-auth {
  --ink: #0F0F0E;
  --ink-soft: #524F49;
  --ink-ghost: #77746E;
  --paper: #F8F7F4;
  --paper-mid: #EDECEA;
  --accent: #1A4EBD;
  --accent-light: #EBF0FB;
  --gold: #E4BB5B;
  --amber: #E8921A;
  --amber-light: #FEF3E2;
  --white: #FFFFFF;
  --danger: #B3261E;
  --danger-light: #FCEDEC;
  --success: #2F5A0E;
  --success-light: #EAF3E0;
  --border: rgba(15, 15, 14, 0.09);
  --border-strong: rgba(15, 15, 14, 0.18);
  --serif: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sans: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 3px rgba(15, 15, 14, 0.06), 0 2px 10px rgba(15, 15, 14, 0.04);
  --shadow-lg: 0 4px 16px rgba(15, 15, 14, 0.1), 0 12px 40px rgba(15, 15, 14, 0.08);

  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.gbx-auth .login {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.gbx-auth .login-main {
  display: flex;
  flex-direction: column;
  padding: 1rem clamp(1.5rem, 5vw, 4.5rem);
  padding-top: max(1rem, env(safe-area-inset-top, 0px));
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
}

.gbx-auth .login-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.gbx-auth .login-logo { display: block; line-height: 0; }
.gbx-auth .login-logo img { height: 60px; width: auto; display: block; object-fit: contain; }
.gbx-auth .back-link { font-size: 0.72rem; color: var(--ink-soft); text-decoration: none; transition: color 0.15s; }
.gbx-auth .back-link:hover { color: var(--accent); }

.gbx-auth .login-center { flex: 1; display: flex; align-items: center; padding: 0.5rem 0; }
.gbx-auth .login-box { width: 100%; }

.gbx-auth .login-box h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.3rem, 4vw, 3.3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 0.7rem;
}
.gbx-auth .login-box h1.h1-sm { font-size: clamp(1.5rem, 2.4vw, 2rem); }

.gbx-auth .login-lead { font-size: 0.92rem; font-weight: 400; color: var(--ink-soft); line-height: 1.5; margin-bottom: 0.85rem; }

.gbx-auth .demo-points { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; margin: 0 0 1rem; padding: 0; font-size: 0.76rem; color: var(--ink-soft); }
.gbx-auth .demo-points li::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 0.5rem; background: var(--gold); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }

.gbx-auth .demo-legal { font-size: 0.7rem; color: var(--ink-ghost); line-height: 1.45; margin-top: 0.6rem; }

.gbx-auth .alert {
  margin-bottom: 1.4rem;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
}
.gbx-auth .alert-danger { background: var(--danger-light); border-left: 3px solid var(--danger); color: var(--danger); }
.gbx-auth .alert-success { background: var(--success-light); border-left: 3px solid #3B6D11; color: var(--success); }

.gbx-auth .demo-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 1rem; }
.gbx-auth .demo-grid .s2 { grid-column: span 2; }
.gbx-auth .demo-grid .s3 { grid-column: span 3; }
.gbx-auth .demo-grid .s6 { grid-column: 1 / -1; }

.gbx-auth .field { margin-bottom: 0.65rem; }
.gbx-auth .field label,
.gbx-auth .form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.4rem;
}
.gbx-auth .opt { font-weight: 400; color: var(--ink-soft); }

.gbx-auth .field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.4rem; }
.gbx-auth .field-row .form-label, .gbx-auth .field-row label { margin-bottom: 0; }
.gbx-auth .field-row a { font-size: 0.76rem; color: var(--accent); text-decoration: none; }
.gbx-auth .field-row a:hover { text-decoration: underline; text-underline-offset: 3px; }

.gbx-auth .remember { display: flex; align-items: center; gap: 0.6rem; margin: 0.1rem 0 1rem; font-size: 0.82rem; color: var(--ink-soft); cursor: pointer; }
.gbx-auth .remember input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }

.gbx-auth .demo-hint { margin-top: 1rem; padding: 0.6rem 0.8rem; background: var(--paper-mid); border-radius: 8px; font-size: 0.72rem; color: var(--ink-soft); }
.gbx-auth .demo-hint b { font-weight: 500; color: var(--ink); }

.gbx-auth .input-wrap { position: relative; }

.gbx-auth .form-control {
  width: 100%;
  height: 40px;
  padding: 0 0.85rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gbx-auth .form-control::placeholder { color: var(--ink-ghost); font-weight: 300; }
.gbx-auth .form-control:hover { border-color: rgba(15, 15, 14, 0.32); }
.gbx-auth .form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26, 78, 189, 0.16); }
.gbx-auth .form-control.is-invalid { border-color: var(--danger); background-image: none; }
.gbx-auth .form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.16); }
.gbx-auth .form-control.password-input.pe-5 { padding-right: 3rem; }

.gbx-auth .toggle-pw {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink-ghost);
  transition: color 0.15s, background 0.15s;
}
.gbx-auth .toggle-pw:hover { color: var(--ink); background: var(--paper-mid); }
.gbx-auth .toggle-pw:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.gbx-auth .toggle-pw svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.gbx-auth .toggle-pw .eye-off { display: none; }
.gbx-auth .toggle-pw[aria-pressed="true"] .eye { display: none; }
.gbx-auth .toggle-pw[aria-pressed="true"] .eye-off { display: block; }

.gbx-auth .invalid-feedback { display: block; margin-top: 0.4rem; font-size: 0.75rem; color: var(--danger); }
.gbx-auth .form-text { margin-top: 0.4rem; font-size: 0.75rem; color: var(--ink-ghost); }

.gbx-auth .pw-rules { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 0.4rem; padding: 0; }
.gbx-auth .pw-rules li { font-size: 0.72rem; padding: 0.25rem 0.65rem; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--ink-soft); background: var(--white); transition: background 0.2s, border-color 0.2s, color 0.2s; }
.gbx-auth .pw-rules li.ok { background: var(--success-light); border-color: #9CC27A; color: var(--success); }
.gbx-auth .pw-rules li.ok::before { content: "\2713 "; }

.gbx-auth .btn-dark {
  width: 100%;
  height: 40px;
  background: var(--ink);
  color: var(--white);
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.gbx-auth .btn-dark:hover { background: var(--gold); color: var(--ink); }
.gbx-auth .btn-dark:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.gbx-auth .btn-dark:disabled { opacity: 0.7; cursor: progress; background: var(--ink); }
.gbx-auth a.btn-dark { display: flex; align-items: center; justify-content: center; text-decoration: none; }

.gbx-auth .done { display: flex; gap: 0.9rem; align-items: flex-start; padding: 1.1rem 1.2rem; background: #EAF3E0; border-radius: 10px; border-left: 3px solid #3B6D11; font-size: 0.86rem; color: #2F5A0E; line-height: 1.6; }
.gbx-auth .done-ico { flex: none; width: 24px; height: 24px; border-radius: 50%; background: #3B6D11; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.gbx-auth .done-ico svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.gbx-auth .login-alt { margin-top: 0.92rem; padding-top: 0.8rem; border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--ink-soft); }
.gbx-auth .login-alt a { color: var(--accent); font-weight: 500; text-decoration: none; margin-left: 0.25rem; }
.gbx-auth .login-alt a:hover { text-decoration: underline; text-underline-offset: 3px; }

.gbx-auth .login-foot { font-size: 0.7rem; color: var(--ink-ghost); margin-top: 0.6rem; }

.gbx-auth .login-side { display: flex; padding: 14px; }
.gbx-auth .side-frame {
  position: relative;
  flex: 1;
  border-radius: 16px;
  overflow: hidden;
  background: #DDE5F2;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.gbx-auth .side-frame:hover { transform: translateY(-4px); border-color: rgba(26, 78, 189, 0.45); box-shadow: 0 12px 30px rgba(26, 78, 189, 0.15), 0 2px 8px rgba(15, 15, 14, 0.06); }
.gbx-auth .side-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; display: block; }
.gbx-auth .side-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 15, 14, 0.8) 0%, rgba(15, 15, 14, 0.4) 20%, rgba(15, 15, 14, 0) 42%);
}
.gbx-auth .side-caption {
  position: absolute;
  z-index: 1;
  left: clamp(1.5rem, 3vw, 2.6rem);
  right: clamp(1.5rem, 3vw, 2.6rem);
  bottom: clamp(1.5rem, 3vw, 2.4rem);
  color: var(--white);
}
.gbx-auth .side-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 2.6vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 28.75rem;
}
.gbx-auth .side-title i { font-style: normal; font-weight: 600; color: #B4C9F7; }

@media (max-width: 960px) {
  .gbx-auth .login { grid-template-columns: 1fr; }
  .gbx-auth .login-side { display: none; }
  .gbx-auth .login-center { padding: 2rem 0; }
}
@media (max-width: 640px) {
  .gbx-auth .demo-grid .s2 { grid-column: span 3; }
}
@media (max-width: 460px) {
  .gbx-auth .demo-grid > * { grid-column: 1 / -1 !important; }
}
@media (max-width: 420px) {
  .gbx-auth .login-logo img { height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .gbx-auth * { transition: none !important; }
}
