/* ═══════════════════════════════════════════════
   OXLUM GROUP — auth.css corrigé
   Pages :
   - login.html
   - signup.html
   - forgot.html
   ═══════════════════════════════════════════════ */

:root {
  --auth-bg: #050d1a;
  --auth-bg-soft: #081426;
  --auth-card: rgba(255, 255, 255, 0.065);
  --auth-card-2: rgba(255, 255, 255, 0.095);
  --auth-border: rgba(255, 255, 255, 0.13);
  --auth-border-strong: rgba(77, 163, 255, 0.32);
  --auth-blue: #1565ff;
  --auth-blue-soft: #4da3ff;
  --auth-white: #ffffff;
  --auth-muted: rgba(255, 255, 255, 0.72);
  --auth-muted-2: rgba(255, 255, 255, 0.52);
  --auth-success: #22c55e;
  --auth-warning: #f59e0b;
  --auth-danger: #ef4444;
  --auth-radius: 26px;
  --auth-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(21, 101, 255, 0.24), transparent 34%),
    radial-gradient(circle at bottom right, rgba(77, 163, 255, 0.14), transparent 34%),
    var(--auth-bg);
  color: var(--auth-white);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

/* PAGE PRINCIPALE */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background:
    linear-gradient(135deg, rgba(5, 13, 26, 0.25), rgba(5, 13, 26, 0.92));
}

/* VISUEL GAUCHE */

.auth-visual {
  position: relative;
  min-height: 100vh;
  padding: 120px 8% 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(21, 101, 255, 0.26), transparent 34%),
    radial-gradient(circle at bottom right, rgba(77, 163, 255, 0.14), transparent 34%),
    rgba(5, 13, 26, 0.72);
}

.auth-bg-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.026) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
  pointer-events: none;
}

.auth-visual::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  left: -160px;
  top: 12%;
  border-radius: 999px;
  background: rgba(21, 101, 255, 0.22);
  filter: blur(18px);
  opacity: 0.7;
}

.auth-visual::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -120px;
  bottom: 12%;
  border-radius: 999px;
  background: rgba(77, 163, 255, 0.14);
  filter: blur(18px);
  opacity: 0.75;
}

.auth-logo {
  position: absolute;
  top: 30px;
  left: 8%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.auth-logo img {
  width: auto;
  max-width: 120px;
  max-height: 76px;
  object-fit: contain;
}

.visual-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
}

.visual-content > span {
  display: inline-flex;
  align-items: center;
  margin-bottom: 18px;
  padding: 8px 14px;
  border-radius: 999px;
  color: #b8d7ff;
  background: rgba(21, 101, 255, 0.14);
  border: 1px solid rgba(77, 163, 255, 0.30);
  font-size: 0.88rem;
  font-weight: 900;
}

.visual-content h1 {
  margin: 0;
  color: var(--auth-white);
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.55rem, 5vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.visual-content p {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--auth-muted);
  font-size: 1.06rem;
  line-height: 1.75;
}

.security-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.security-badges div {
  padding: 10px 13px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.11);
  font-weight: 800;
  font-size: 0.88rem;
}

/* PANNEAU DROIT */

.auth-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 120px 6% 60px;
}

.auth-card {
  width: min(480px, 100%);
  padding: 30px;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.045));
  border: 1px solid var(--auth-border);
  box-shadow: var(--auth-shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.auth-card-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-card-header img {
  width: auto;
  max-width: 110px;
  max-height: 78px;
  object-fit: contain;
  margin-bottom: 18px;
}

.auth-card-header h2 {
  margin: 0 0 8px;
  color: var(--auth-white);
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.auth-card-header p {
  margin: 0;
  color: var(--auth-muted);
  line-height: 1.65;
}

/* FORMULAIRES */

.auth-form {
  display: block;
}

.form-group {
  margin-bottom: 17px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--auth-white);
  font-weight: 800;
  font-size: 0.94rem;
}

.form-group input,
.form-group select,
.form-group textarea,
.auth-form input,
.auth-form select,
.auth-form textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  outline: none;
  background: rgba(5, 13, 26, 0.72);
  color: var(--auth-white);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.form-group textarea,
.auth-form textarea {
  min-height: 130px;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.auth-form input::placeholder,
.auth-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.44);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
  border-color: rgba(77, 163, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(21, 101, 255, 0.12);
  background: rgba(5, 13, 26, 0.88);
}

.form-group small {
  display: block;
  margin-top: 8px;
  color: var(--auth-muted-2);
  line-height: 1.5;
}

/* PASSWORD */

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 54px;
}

.toggle-password {
  position: absolute;
  right: 8px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--auth-white);
  cursor: pointer;
}

.toggle-password:hover {
  background: rgba(21, 101, 255, 0.18);
}

/* FORCE DU MOT DE PASSE */

.password-strength {
  width: 100%;
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.password-strength span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: var(--auth-danger);
  transition:
    width 0.25s ease,
    background 0.25s ease;
}

/* BOUTONS */

.auth-submit,
.auth-secondary {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 950;
  border: none;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.auth-submit {
  width: 100%;
  color: var(--auth-white);
  background: linear-gradient(135deg, var(--auth-blue), var(--auth-blue-soft));
  box-shadow: 0 18px 40px rgba(21, 101, 255, 0.26);
}

.auth-secondary {
  color: var(--auth-white);
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.auth-submit:hover,
.auth-secondary:hover {
  transform: translateY(-2px);
}

.auth-submit:disabled,
.auth-secondary:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ÉTAPES */

.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: authStepFade 0.25s ease both;
}

@keyframes authStepFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.step-actions .auth-submit,
.step-actions .auth-secondary {
  flex: 1;
}

.hidden {
  display: none !important;
}

/* MESSAGES */

.auth-message {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--auth-blue-soft);
  text-align: center;
  font-weight: 800;
  line-height: 1.5;
}

.auth-message.success {
  color: #86efac;
}

.auth-message.error {
  color: #fca5a5;
}

/* SWITCH CONNEXION / INSCRIPTION */

.auth-switch {
  margin: 22px 0 0;
  text-align: center;
  color: var(--auth-muted);
  line-height: 1.6;
}

.auth-switch a {
  color: var(--auth-blue-soft);
  font-weight: 900;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* FOOTER LINKS */

.auth-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.auth-footer-links a {
  color: var(--auth-muted-2);
  font-size: 0.86rem;
  text-decoration: none;
  font-weight: 700;
}

.auth-footer-links a:hover {
  color: var(--auth-blue-soft);
}

/* OPTIONS RÉCUPÉRATION */

.recovery-options {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.recovery-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.recovery-card:hover {
  transform: translateY(-2px);
  border-color: rgba(77, 163, 255, 0.36);
  background: rgba(21, 101, 255, 0.10);
}

.recovery-card input {
  width: auto;
  min-height: auto;
  margin-top: 5px;
  accent-color: var(--auth-blue);
}

.recovery-card strong {
  display: block;
  color: var(--auth-white);
  margin-bottom: 4px;
}

.recovery-card span {
  color: var(--auth-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.phone-input-group.hidden,
.username-input.hidden,
.email-input.hidden {
  display: none !important;
}

/* OTP */

.otp-box {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.otp-box input {
  width: 100%;
  height: 52px;
  min-height: 52px;
  padding: 0;
  text-align: center;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.055);
  color: var(--auth-white);
  font-size: 1.2rem;
  font-weight: 950;
  outline: none;
}

.otp-box input:focus {
  border-color: rgba(77, 163, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(21, 101, 255, 0.12);
}

/* NOTES / SUCCÈS */

.auth-note {
  padding: 16px;
  border-radius: 18px;
  background: rgba(21, 101, 255, 0.10);
  border: 1px solid rgba(77, 163, 255, 0.18);
  color: var(--auth-muted);
  line-height: 1.65;
}

.success-state {
  text-align: center;
  padding: 20px 0;
}

.success-icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 24px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.26);
  font-size: 2rem;
}

.success-state h3 {
  color: var(--auth-white);
  margin: 0 0 10px;
}

.success-state p {
  color: var(--auth-muted);
  line-height: 1.7;
}

/* LIGNES */

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.phone-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
}

/* CHECKBOX */

.terms-box,
.captcha-placeholder {
  display: grid;
  gap: 12px;
  margin: 18px 0 22px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(21, 101, 255, 0.09);
  border: 1px solid rgba(77, 163, 255, 0.18);
  color: var(--auth-muted);
  line-height: 1.6;
}

.terms-box label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--auth-muted);
  line-height: 1.55;
  font-size: 0.92rem;
  cursor: pointer;
}

.terms-box input {
  width: auto;
  min-height: auto;
  margin-top: 4px;
  accent-color: var(--auth-blue);
}

.terms-box a {
  color: var(--auth-blue-soft);
  font-weight: 900;
  text-decoration: none;
}

/* TOPBAR AUTH — soutien si les pages n’ont pas tout en inline */

.auth-topbar {
  box-sizing: border-box;
}

.auth-topbar-brand img,
.auth-logo img,
.auth-card-header img {
  width: auto;
  object-fit: contain;
}

/* RESPONSIVE */

@media (max-width: 1050px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: auto;
    padding: 120px 6% 70px;
  }

  .auth-panel {
    min-height: auto;
    padding: 40px 6% 70px;
  }

  .auth-logo {
    left: 6%;
  }

  .visual-content {
    max-width: 780px;
  }
}

@media (max-width: 760px) {
  .auth-visual {
    padding: 80px 5% 54px;
  }

  .auth-panel {
    padding: 28px 5% 58px;
  }

  .auth-logo {
    position: static;
    margin-bottom: 26px;
  }

  .auth-logo img {
    max-width: 100px;
    max-height: 70px;
  }

  .auth-card {
    padding: 24px;
    border-radius: 28px;
  }

  .form-row,
  .phone-row {
    grid-template-columns: 1fr;
  }

  .step-actions {
    flex-direction: column;
  }

  .otp-box {
    gap: 7px;
  }

  .otp-box input {
    height: 46px;
    min-height: 46px;
    border-radius: 13px;
  }

  .security-badges {
    gap: 8px;
  }

  .security-badges div {
    font-size: 0.82rem;
    padding: 8px 10px;
  }

  .auth-footer-links {
    gap: 8px 12px;
  }
}

@media (max-width: 460px) {
  .auth-card {
    padding: 22px 18px;
  }

  .visual-content h1 {
    font-size: 2.35rem;
  }

  .auth-card-header h2 {
    font-size: 1.8rem;
  }

  .otp-box {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ═══════════════════════════════════════════════
   FIX FINAL AUTH — Barre Connexion / Inscription / Forgot
   Objectif :
   - Empêcher définitivement la barre auth de masquer le formulaire
   - Garder le logo visible
   - Garder les boutons compacts
   - Compatible avec login.html, signup.html, forgot.html
   ═══════════════════════════════════════════════ */

/* La barre Oxlum ID ne doit jamais être fixed sur les pages auth */
.auth-topbar {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  z-index: 20 !important;
  width: min(1120px, calc(100% - 32px)) !important;
  min-height: 62px !important;
  margin: 18px auto 26px !important;
  padding: 9px 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  border-radius: 24px !important;
  background: rgba(5, 13, 26, 0.86) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.22) !important;
  overflow: visible !important;
}

/* Logo Oxlum ID visible et propre */
.auth-topbar-brand {
  display: inline-flex !important;
  align-items: center !important;
  gap: 11px !important;
  color: #ffffff !important;
  text-decoration: none !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  min-width: 0 !important;
}

.auth-topbar-brand img {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  object-fit: contain !important;
  display: block !important;
  border-radius: 10px !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

.auth-topbar-brand span {
  font-size: 1rem !important;
  line-height: 1 !important;
}

/* Boutons de la barre auth */
.auth-topbar-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 9px !important;
  flex-wrap: nowrap !important;
  min-width: 0 !important;
}

.auth-mini-btn {
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 0 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.07) !important;
  text-decoration: none !important;
  font-size: 0.84rem !important;
  font-weight: 850 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
}

/* Bouton langue compact */
#authLangToggle,
.auth-mini-btn#authLangToggle {
  width: 46px !important;
  min-width: 46px !important;
  max-width: 46px !important;
  padding: 0 !important;
  font-weight: 950 !important;
  text-align: center !important;
  overflow: hidden !important;
}

/* Bouton principal */
.auth-mini-btn.primary {
  border-color: rgba(77, 163, 255, 0.38) !important;
  background: linear-gradient(135deg, #1565ff, #4da3ff) !important;
  box-shadow: 0 14px 34px rgba(21, 101, 255, 0.24) !important;
}

/* Comme la barre n'est plus fixed, on enlève les grands espaces inutiles */
main.auth-page,
.auth-page {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Réduction de l'espace vertical sur desktop */
@media (min-width: 1051px) {
  .auth-page {
    min-height: calc(100vh - 106px) !important;
  }

  .auth-visual {
    min-height: calc(100vh - 106px) !important;
    padding-top: 70px !important;
    padding-bottom: 60px !important;
  }

  .auth-panel {
    min-height: calc(100vh - 106px) !important;
    padding-top: 40px !important;
    padding-bottom: 60px !important;
  }
}

/* Sur mobile, la barre reste simple et ne cache rien */
@media (max-width: 760px) {
  .auth-topbar {
    position: relative !important;
    width: calc(100% - 20px) !important;
    min-height: auto !important;
    margin: 12px auto 18px !important;
    padding: 10px 12px !important;
    border-radius: 20px !important;
    flex-wrap: wrap !important;
  }

  .auth-topbar-brand {
    width: 100% !important;
    justify-content: center !important;
  }

  .auth-topbar-brand img {
    width: 40px !important;
    height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
  }

  .auth-topbar-actions {
    width: 100% !important;
    justify-content: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
  }

  .auth-mini-btn {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    padding: 0 12px !important;
    font-size: 0.8rem !important;
  }

  #authLangToggle,
  .auth-mini-btn#authLangToggle {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
  }

  .auth-visual {
    padding-top: 54px !important;
  }

  .auth-panel {
    padding-top: 28px !important;
  }
}