/* ============================================================
   EventFlow — auth.css
   Premium SaaS authentication UI
   Style: Refined Minimal — Stripe × Linear × Notion
   Author: Generated for EventFlow
   ============================================================ */

/* ────────────────────────────────────────────────────────────
   0. IMPORTS & CUSTOM PROPERTIES
   ──────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* Brand */
  --brand-primary:      #FFB900;
  --brand-hover:        #E6A700;
  --brand-active:       #CC9200;
  --brand-text:         #A67100;
  --brand-light:        #FFF0C2;
  --brand-lighter:      #FFF8E1;
  --brand-glow:         rgba(255, 185, 0, 0.18);
  --brand-glow-strong:  rgba(255, 185, 0, 0.28);

  /* Derived palette for animated background */
  --anim-c1:            rgba(255, 185, 0, 0.055);
  --anim-c2:            rgba(255, 185, 0, 0.035);
  --anim-c3:            rgba(255, 198, 41, 0.04);
  --anim-stroke:        rgba(255, 185, 0, 0.09);
  --anim-stroke-strong: rgba(255, 185, 0, 0.14);

  /* Neutral */
  --gray-50:   #f8f9fa;
  --gray-100:  #f1f3f4;
  --gray-200:  #e8eaed;
  --gray-300:  #dadce0;
  --gray-400:  #bdc1c6;
  --gray-500:  #9aa0a6;
  --gray-600:  #80868b;
  --gray-700:  #5f6368;
  --gray-800:  #3c4043;
  --gray-900:  #202124;

  /* Semantic */
  --color-bg:           #ffffff;
  --color-surface:      #ffffff;
  --color-text:         #1a1d23;
  --color-text-muted:   #6b7280;
  --color-text-hint:    #9ca3af;
  --color-border:       #e5e7eb;
  --color-border-focus: var(--brand-active);
  --color-error:        #e03152;
  --color-error-light:  #fff0f3;
  --color-success:      #059669;

  /* Card */
  --card-bg:            rgba(255, 255, 255, 0.88);
  --card-border:        rgba(229, 231, 235, 0.7);
  --card-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.05),
    0 16px 40px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(229, 231, 235, 0.6);

  /* Typography */
  --font-sans:     'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs:  11.5px;
  --font-size-sm:  13px;
  --font-size-md:  14px;
  --font-size-base: 15px;
  --font-size-lg:  18px;
  --font-size-xl:  22px;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;

  /* Radius */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   22px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base:   220ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ────────────────────────────────────────────────────────────
   1. RESET & BASE
   ──────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin:  0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  font-size: 100%;
  height: 100%;
}

body {
  font-family:      var(--font-sans);
  font-size:        var(--font-size-base);
  color:            var(--color-text);
  background-color: var(--color-bg);
  min-height:       100vh;
  line-height:      1.6;
  -webkit-font-smoothing:  antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}


/* ────────────────────────────────────────────────────────────
   2. ANIMATED BACKGROUND CANVAS
   ──────────────────────────────────────────────────────────── */

/* The <canvas id="bg-canvas"> is injected by auth.js */
#bg-canvas {
  position: fixed;
  inset:    0;
  width:    100%;
  height:   100%;
  z-index:  0;
  pointer-events: none;
  will-change: transform; /* hint for GPU compositing */
}


/* ────────────────────────────────────────────────────────────
   3. PAGE LAYOUT
   ──────────────────────────────────────────────────────────── */

.auth-page {
  position:       relative;
  z-index:        1;
  min-height:     100vh;
  display:        flex;
  flex-direction: column;
  align-items:    center;
  justify-content: center;
  padding:        var(--space-6) var(--space-4);
}

/* Subtle gradient overlay to smooth canvas edges */
.auth-page::before {
  content:  '';
  position: fixed;
  inset:    0;
  background:
    radial-gradient(
      ellipse 80% 60% at 50% 0%,
      rgba(255, 185, 0, 0.04) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 60% 50% at 100% 100%,
      rgba(255, 185, 0, 0.03) 0%,
      transparent 70%
    );
  pointer-events: none;
  z-index: -1;
}


/* ────────────────────────────────────────────────────────────
   4. BRAND WORDMARK
   ──────────────────────────────────────────────────────────── */

.auth-brand {
  display:         flex;
  align-items:     center;
  gap:             var(--space-2);
  margin-bottom:   var(--space-8);
  text-decoration: none;
  user-select:     none;
}

.auth-brand__icon {
  width:           34px;
  height:          34px;
  background:      var(--brand-primary);
  border-radius:   var(--radius-md);
  display:         flex;
  align-items:     center;
  justify-content: center;
  flex-shrink:     0;
  box-shadow:      0 2px 8px var(--brand-glow);
  transition:      box-shadow var(--transition-base),
                   transform  var(--transition-base);
}

.auth-brand:hover .auth-brand__icon {
  box-shadow: 0 4px 16px var(--brand-glow-strong);
  transform:  translateY(-1px);
}

/* SVG lightning bolt or "E" mark */
.auth-brand__icon svg {
  width:  18px;
  height: 18px;
  fill:   none;
  stroke: #1c1917;
  stroke-width: 2.2;
  stroke-linecap:  round;
  stroke-linejoin: round;
}

.auth-brand__name {
  font-size:   18px;
  font-weight: 700;
  color:       var(--color-text);
  letter-spacing: -0.3px;
}

.auth-brand__name span {
  color: var(--brand-text);
}

.auth-brand__logo {
  max-height: 30px;
  width: auto;
  display: block;
}


/* ────────────────────────────────────────────────────────────
   5. AUTH CARD
   ──────────────────────────────────────────────────────────── */

.auth-card {
  width:         100%;
  max-width:     440px;
  background:    var(--card-bg);
  border:        1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow:    var(--card-shadow);
  padding:       var(--space-10) var(--space-8);

  /* Glass effect — frosted */
  backdrop-filter:         blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);

  /* Mount animation */
  animation: cardReveal 0.5s cubic-bezier(0.34, 1.20, 0.64, 1) both;
}

@keyframes cardReveal {
  from {
    opacity:   0;
    transform: translateY(18px) scale(0.978);
  }
  to {
    opacity:   1;
    transform: translateY(0) scale(1);
  }
}

/* Register card is slightly taller — just let it breathe */
.auth-card--register {
  max-width: 460px;
}


/* ────────────────────────────────────────────────────────────
   6. CARD HEADER
   ──────────────────────────────────────────────────────────── */

.auth-header {
  margin-bottom: var(--space-8);
  text-align:    left;
}

.auth-header h2 {
  font-size:      var(--font-size-xl);
  font-weight:    700;
  color:          var(--color-text);
  letter-spacing: -0.5px;
  line-height:    1.25;
  margin-bottom:  var(--space-2);
}

.auth-header p {
  font-size:  var(--font-size-md);
  color:      var(--color-text-muted);
  line-height: 1.5;
}


/* ────────────────────────────────────────────────────────────
   7. FORM STRUCTURE
   ──────────────────────────────────────────────────────────── */

.auth-form {
  display:        flex;
  flex-direction: column;
  gap:            var(--space-5);
}

/* Two-column row (e.g., prénom + nom) */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

@media (max-width: 400px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}


/* ────────────────────────────────────────────────────────────
   8. FORM FIELD
   ──────────────────────────────────────────────────────────── */

.form-field {
  display:        flex;
  flex-direction: column;
  gap:            var(--space-2);
}

/* Label */
.form-field label,
.form-field > label {
  font-size:   var(--font-size-sm);
  font-weight: 500;
  color:       var(--color-text);
  cursor:      default;
  user-select: none;
  letter-spacing: 0.01em;
}

/* Hint text */
.form-field small,
.form-field .field-hint {
  font-size:  var(--font-size-xs);
  color:      var(--color-text-hint);
  line-height: 1.4;
  transition: color var(--transition-fast);
}

/* Error state on hint */
.form-field.has-error small,
.form-field.has-error .field-hint {
  color: var(--color-error);
}


/* ────────────────────────────────────────────────────────────
   9. INPUTS — BASE STYLE
   ──────────────────────────────────────────────────────────── */

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="password"],
.form-field select,
/* Naked selector for PHP-rendered markup */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
select {
  width:          100%;
  height:         44px;
  padding:        0 var(--space-4);
  font-family:    var(--font-sans);
  font-size:      var(--font-size-md);
  font-weight:    400;
  color:          var(--color-text);
  background:     var(--gray-50);
  border:         1.5px solid var(--color-border);
  border-radius:  var(--radius-md);
  outline:        none;
  appearance:     none;
  -webkit-appearance: none;
  transition:
    border-color  var(--transition-fast),
    background    var(--transition-fast),
    box-shadow    var(--transition-fast);
  line-height:    1;
}

/* Placeholder */
input::placeholder {
  color:       var(--color-text-hint);
  font-weight: 400;
}

/* Hover */
input[type="text"]:hover,
input[type="email"]:hover,
input[type="tel"]:hover,
input[type="password"]:hover,
select:hover {
  background:    #ffffff;
  border-color:  var(--gray-400);
}

/* Focus */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
select:focus {
  background:   #ffffff;
  border-color: var(--brand-active);
  box-shadow:
    0 0 0 3px var(--brand-glow),
    0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Error state */
.form-field.has-error input,
.form-field.has-error select {
  border-color:  var(--color-error);
  background:    var(--color-error-light);
}

.form-field.has-error input:focus,
.form-field.has-error select:focus {
  box-shadow: 0 0 0 3px rgba(224, 49, 82, 0.12);
}

/* Success state */
.form-field.is-valid input {
  border-color: var(--color-success);
}

.form-field.is-valid input:focus {
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

/* Select chevron */
select {
  padding-right:       var(--space-8);
  background-image:    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:   no-repeat;
  background-position: right 12px center;
  cursor:              pointer;
}

select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A67100' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* Option elements */
select option {
  font-family: var(--font-sans);
  color:       var(--color-text);
  background:  #ffffff;
  padding:     var(--space-2);
}


/* ────────────────────────────────────────────────────────────
   10. PASSWORD FIELD — TOGGLE VISIBILITY
   ──────────────────────────────────────────────────────────── */

.password-field {
  position: relative;
  display:  flex;
  align-items: center;
}

.password-field input[type="password"],
.password-field input[type="text"] {
  padding-right: 48px; /* room for the toggle button */
  width: 100%;
}

/* Toggle button inside the field */
#togglePassword,
.password-toggle {
  position:   absolute;
  right:      0;
  top:        50%;
  transform:  translateY(-50%);
  width:      44px;
  height:     44px;
  display:    flex;
  align-items:     center;
  justify-content: center;

  background:   transparent;
  border:       none;
  outline:      none;
  cursor:       pointer;
  color:        var(--color-text-hint);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  transition:
    color      var(--transition-fast),
    background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

#togglePassword:hover,
.password-toggle:hover {
  color:      var(--brand-text);
  background: var(--brand-lighter);
}

#togglePassword:active,
.password-toggle:active {
  transform: translateY(-50%) scale(0.92);
}

/* SVG eye icon inside toggle (injected by JS) */
#togglePassword svg,
.password-toggle svg {
  width:  18px;
  height: 18px;
  pointer-events: none;
}

/* Text fallback (original HTML has text nodes) */
#togglePassword,
.password-toggle {
  font-size:   var(--font-size-xs);
  font-weight: 500;
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
  line-height: 1;
  color:       var(--color-text-hint);
  white-space: nowrap;
}


/* ────────────────────────────────────────────────────────────
   11. SUBMIT BUTTON
   ──────────────────────────────────────────────────────────── */

/* The main <button type="submit"> */
form > button[type="submit"],
.btn-primary {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             var(--space-2);

  width:           100%;
  height:          46px;
  padding:         0 var(--space-6);
  margin-top:      var(--space-2);

  font-family:    var(--font-sans);
  font-size:      var(--font-size-md);
  font-weight:    600;
  color:          #1C1917;
  letter-spacing: 0.01em;

  background:    var(--brand-primary);
  border:        1.5px solid var(--brand-primary);
  border-radius: var(--radius-md);
  cursor:        pointer;
  outline:       none;
  appearance:    none;

  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.08),
    0 2px 6px var(--brand-glow);

  transition:
    background   var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow   var(--transition-fast),
    transform    var(--transition-fast);

  position: relative;
  overflow: hidden;
}

/* Shimmer sweep on hover */
form > button[type="submit"]::after,
.btn-primary::after {
  content:  '';
  position: absolute;
  inset:    0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 60%
  );
  transform:   translateX(-100%);
  transition:  transform 0.45s ease;
}

form > button[type="submit"]:hover::after,
.btn-primary:hover::after {
  transform: translateX(100%);
}

form > button[type="submit"]:hover,
.btn-primary:hover {
  background:  var(--brand-hover);
  border-color: var(--brand-hover);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.1),
    0 4px 16px var(--brand-glow-strong);
  transform: translateY(-1px);
}

form > button[type="submit"]:active,
.btn-primary:active {
  background:  var(--brand-active);
  border-color: var(--brand-active);
  box-shadow:  0 1px 4px var(--brand-glow);
  transform:   translateY(0) scale(0.98);
}

form > button[type="submit"]:focus-visible,
.btn-primary:focus-visible {
  box-shadow:
    0 0 0 3px var(--brand-glow-strong),
    0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Loading state */
form > button[type="submit"].is-loading,
.btn-primary.is-loading {
  pointer-events: none;
  opacity: 0.75;
}

form > button[type="submit"].is-loading::before,
.btn-primary.is-loading::before {
  content:  '';
  width:    16px;
  height:   16px;
  border:   2px solid rgba(255,255,255,0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: var(--space-2);
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ────────────────────────────────────────────────────────────
    12. COUNTRY PICKER  (register page)
   ──────────────────────────────────────────────────────────── */

.country-picker { position: relative; }

/* Keep the dropdown above following fields:
   the fieldReveal entrance animation leaves a transform
   on every .form-field, which creates stacking contexts,
   so the next field paints over the absolutely-positioned
   dropdown and makes it look transparent. */
.country-field {
  position: relative;
  z-index:  40;
}

.country-picker__trigger {
  width:            100%;
  height:           44px;
  display:          flex;
  align-items:      center;
  gap:              10px;
  padding:          0 var(--space-4);
  font-family:      var(--font-sans);
  font-size:        var(--font-size-md);
  color:            var(--color-text);
  background:       var(--gray-50);
  border:           1.5px solid var(--color-border);
  border-radius:    var(--radius-md);
  outline:          none;
  cursor:           pointer;
  appearance:       none;
  transition:
    border-color  var(--transition-fast),
    background    var(--transition-fast),
    box-shadow    var(--transition-fast);
}

.country-picker__trigger:hover {
  background:   #ffffff;
  border-color: var(--gray-400);
}

.country-picker__trigger.open {
  background:   #ffffff;
  border-color: var(--brand-active);
  box-shadow:
    0 0 0 3px var(--brand-glow),
    0 1px 3px rgba(0, 0, 0, 0.06);
}

.country-picker__flag { font-size: 20px; line-height: 1; flex-shrink: 0; }

.country-picker__value {
  flex:            1;
  text-align:      left;
  color:           var(--color-text);
  white-space:     nowrap;
  overflow:        hidden;
  text-overflow:   ellipsis;
}

.country-picker__value.placeholder { color: var(--color-text-hint); }

.country-picker__chevron {
  width:           16px;
  height:          16px;
  flex-shrink:     0;
  fill:            none;
  stroke:          var(--color-text-hint);
  stroke-width:    2;
  stroke-linecap:  round;
  stroke-linejoin: round;
  transition:      transform var(--transition-base);
}

.country-picker__trigger.open .country-picker__chevron { transform: rotate(180deg); }

.country-picker__dropdown {
  position:         absolute;
  top:              calc(100% + 6px);
  left:             0;
  right:            0;
  z-index:          60;
  background:       #ffffff;
  border:           1px solid var(--color-border);
  border-radius:    var(--radius-md);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.10),
    0 2px 6px rgba(0, 0, 0, 0.06);
  overflow:         hidden;
  display:          none;
}

.country-picker__dropdown.open { display: block; animation: dropdownIn 0.18s ease; }

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.country-picker__search {
  display:          flex;
  align-items:      center;
  gap:              8px;
  padding:          10px 12px;
  border-bottom:    1px solid var(--color-border);
}

.country-picker__search svg {
  width:            16px;
  height:           16px;
  flex-shrink:      0;
  fill:             none;
  stroke:           var(--color-text-hint);
  stroke-width:     2;
  stroke-linecap:   round;
  stroke-linejoin:  round;
}

.country-picker__search input {
  flex:             1;
  min-width:        0;
  border:           none;
  outline:          none;
  background:       transparent;
  font-family:      var(--font-sans);
  font-size:        var(--font-size-sm);
  color:            var(--color-text);
}

.country-picker__list {
  list-style:       none;
  max-height:       240px;
  overflow-y:       auto;
  padding:          4px;
  margin:           0;
}

.country-picker__item {
  display:          flex;
  align-items:      center;
  gap:              10px;
  width:            100%;
  padding:          8px 10px;
  background:       none;
  border:           none;
  border-radius:    var(--radius-sm);
  cursor:           pointer;
  font-family:      var(--font-sans);
  font-size:        var(--font-size-sm);
  color:            var(--color-text);
  text-align:       left;
  transition:       background var(--transition-fast);
}

.country-picker__item:hover { background: var(--gray-50); }

.country-picker__item .country-picker__flag { font-size: 18px; }

.country-picker__item .country-picker__label {
  flex:           1;
  min-width:      0;
  white-space:    nowrap;
  overflow:       hidden;
  text-overflow:  ellipsis;
}

.country-picker__item .country-picker__dial {
  margin-left:  auto;
  color:        var(--color-text-hint);
  font-size:    var(--font-size-xs);
}

.country-picker__item.is-selected {
  background: var(--brand-lighter);
  color:      var(--brand-text);
  font-weight: 600;
}

.country-picker__empty {
  padding:     14px;
  text-align:  center;
  color:       var(--color-text-hint);
  font-size:   var(--font-size-sm);
}

#country_error {
  display:    block;
  color:      var(--color-error);
  font-size:  var(--font-size-xs);
  line-height: 1.4;
}

.field-error {
  color:      var(--color-error);
  font-size:  var(--font-size-xs);
  line-height: 1.4;
}

.auth-form input.has-error {
  border-color: var(--color-error);
  background:   var(--color-error-light);
  box-shadow:   0 0 0 3px rgba(224, 49, 82, 0.15);
}

.form-field--checkbox input[type="checkbox"].has-error {
  box-shadow: 0 0 0 4px rgba(224, 49, 82, 0.22);
  animation:  shakeX 0.3s ease;
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-3px); }
  75%      { transform: translateX(3px); }
}

.country-picker__custom {
  margin-top: var(--space-2);
  animation:  dropdownIn 0.18s ease;
}

.country-picker__custom input {
  width:            100%;
  height:           44px;
  padding:          0 var(--space-4);
  font-family:      var(--font-sans);
  font-size:        var(--font-size-md);
  color:            var(--color-text);
  background:       #ffffff;
  border:           1.5px solid var(--brand-active);
  border-radius:    var(--radius-md);
  outline:          none;
  box-shadow:
    0 0 0 3px var(--brand-glow),
    0 1px 3px rgba(0, 0, 0, 0.06);
}

.country-picker__custom input:focus {
  border-color: var(--brand-active);
  box-shadow:
    0 0 0 3px var(--brand-glow-strong),
    0 1px 3px rgba(0, 0, 0, 0.06);
}

.country-picker__custom input.has-error {
  border-color: var(--color-error);
  background:   var(--color-error-light);
  box-shadow:   0 0 0 3px rgba(224, 49, 82, 0.15);
}


/* ────────────────────────────────────────────────────────────
    13. FOOTER LINKS  (« Mot de passe oublié ? », « Se connecter »)
   ──────────────────────────────────────────────────────────── */

/* Remember me + forgot password row */
.auth-remember-row {
  display:         flex !important;
  flex-direction:  row !important;
  flex-wrap:       nowrap !important;
  align-items:     center;
  justify-content: space-between;
  gap:             var(--space-3);
  margin-top:      calc(-1 * var(--space-2));
}

.auth-remember-row .remember-label {
  display:         flex;
  align-items:     center;
  gap:             var(--space-2);
  font-size:       var(--font-size-sm);
  font-weight:     400;
  color:           var(--color-text-muted);
  cursor:          pointer;
  user-select:     none;
  white-space:     nowrap;
}

.auth-remember-row input[type="checkbox"] {
  width:          16px;
  height:         16px;
  min-width:      16px;
  accent-color:   #FFB900;
  cursor:         pointer;
  margin:         0;
}

.auth-remember-row .link-forgot {
  font-size:       var(--font-size-sm);
  font-weight:     500;
  color:           var(--color-text-muted);
  text-decoration: none;
  transition:      color var(--transition-fast);
  white-space:     nowrap;
}

.auth-remember-row .link-forgot:hover {
  color: var(--brand-text);
}

/* Forgot password link row (legacy) */
.form-field--forgot {
  display:        flex;
  justify-content: flex-end;
  margin-top:     calc(-1 * var(--space-2));
}

form > div > a[href="/forgot-password"],
.link-forgot {
  font-size:       var(--font-size-sm);
  font-weight:     500;
  color:           var(--color-text-muted);
  text-decoration: none;
  transition:      color var(--transition-fast);
}

form > div > a[href="/forgot-password"]:hover,
.link-forgot:hover {
  color: var(--brand-text);
}

/* Bottom redirect paragraph: "Déjà un compte ? Se connecter" */
form + p,
.auth-footer {
  margin-top:  var(--space-6);
  font-size:   var(--font-size-sm);
  color:       var(--color-text-muted);
  text-align:  center;
  line-height: 1.5;
}

form + p a,
.auth-footer a {
  color:           var(--brand-text);
  font-weight:     600;
  text-decoration: none;
  transition:      color var(--transition-fast), opacity var(--transition-fast);
}

form + p a:hover,
.auth-footer a:hover {
  color:   var(--brand-active);
  opacity: 0.85;
}


/* ────────────────────────────────────────────────────────────
   13. DIVIDER  (optional "ou continuer avec")
   ──────────────────────────────────────────────────────────── */

.auth-divider {
  display:     flex;
  align-items: center;
  gap:         var(--space-3);
  margin:      var(--space-2) 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex:    1;
  height:  1px;
  background: var(--color-border);
}

.auth-divider span {
  font-size:  var(--font-size-xs);
  color:      var(--color-text-hint);
  white-space: nowrap;
}


/* ────────────────────────────────────────────────────────────
    14. GOOGLE BUTTON
    ──────────────────────────────────────────────────────────── */

.btn-google {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             var(--space-3);
  width:           100%;
  height:          46px;
  padding:         0 var(--space-6);
  font-family:     var(--font-sans);
  font-size:       var(--font-size-md);
  font-weight:     600;
  color:           var(--color-text);
  background:      #ffffff;
  border:          1.5px solid var(--color-border);
  border-radius:   var(--radius-md);
  cursor:          pointer;
  text-decoration: none;
  transition:
    border-color var(--transition-fast),
    background   var(--transition-fast),
    box-shadow   var(--transition-fast);
}

.btn-google:hover {
  background:   var(--gray-50);
  border-color: var(--gray-400);
  box-shadow:   0 1px 3px rgba(0,0,0,0.06);
}

.btn-google:active {
  background: var(--gray-100);
  transform:  scale(0.99);
}


/* ────────────────────────────────────────────────────────────
    15. ALERT / FLASH MESSAGES
    ──────────────────────────────────────────────────────────── */

.auth-alert {
  display:       flex;
  align-items:   flex-start;
  gap:           var(--space-3);
  padding:       var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size:     var(--font-size-sm);
  line-height:   1.5;
  animation:     alertSlide 0.3s ease both;
}

@keyframes alertSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.auth-alert--error {
  background:   var(--color-error-light);
  border:       1px solid rgba(224, 49, 82, 0.2);
  color:        #9b1c32;
}

.auth-alert--success {
  background:   #eaf8f6;
  border:       1px solid rgba(5, 150, 105, 0.3);
  color:        #065f52;
}

.auth-alert__icon {
  flex-shrink: 0;
  font-size:   16px;
  margin-top:  1px;
}


/* ────────────────────────────────────────────────────────────
    16. PASSWORD STRENGTH METER  (register page)
    ──────────────────────────────────────────────────────────── */

.password-strength {
  display:        flex;
  flex-direction: column;
  gap:            var(--space-1);
  margin-top:     var(--space-1);
}

.strength-bars {
  display: flex;
  gap:     var(--space-1);
}

.strength-bar {
  flex:          1;
  height:        3px;
  border-radius: var(--radius-full);
  background:    var(--color-border);
  transition:    background 0.25s ease;
  overflow:      hidden;
}

.strength-bar.active[data-level="1"] { background: #e03152; }
.strength-bar.active[data-level="2"] { background: #f59e0b; }
.strength-bar.active[data-level="3"] { background: #3b82f6; }
.strength-bar.active[data-level="4"] { background: #059669; }

.strength-label {
  font-size: var(--font-size-xs);
  color:     var(--color-text-hint);
  transition: color 0.25s ease;
}

.strength-label[data-level="1"] { color: #e03152; }
.strength-label[data-level="2"] { color: #d97706; }
.strength-label[data-level="3"] { color: #2563eb; }
.strength-label[data-level="4"] { color: #059669; }


/* ────────────────────────────────────────────────────────────
    17. CHECKBOX / TERMS  (optional register field)
    ──────────────────────────────────────────────────────────── */

.form-field--checkbox {
  flex-direction: row;
  align-items:    flex-start;
  gap:            var(--space-3);
}

.form-field--checkbox input[type="checkbox"] {
  width:         18px;
  height:        18px;
  min-width:     18px;
  flex-shrink:   0;
  accent-color:  #FFB900;
  cursor:        pointer;
  margin-top:    2px;
  border-radius: 4px;
}

.form-field--checkbox input[type="checkbox"].checkbox-round {
  border-radius: 50%;
}

.form-field--checkbox label {
  font-size:   var(--font-size-sm);
  font-weight: 400;
  color:       var(--color-text-muted);
  cursor:      pointer;
  line-height: 1.5;
}

.form-field--checkbox label a {
  color:           var(--brand-text);
  text-decoration: none;
  font-weight:     500;
}

.form-field--checkbox label a:hover {
  text-decoration: underline;
}


/* ────────────────────────────────────────────────────────────
    18. INPUT ICON PREFIX  (optional enhancement)
    ──────────────────────────────────────────────────────────── */

.input-with-icon {
  position: relative;
}

.input-with-icon .input-icon {
  position:  absolute;
  left:      14px;
  top:       50%;
  transform: translateY(-50%);
  color:     var(--color-text-hint);
  pointer-events: none;
  transition: color var(--transition-fast);
  display:   flex;
}

.input-with-icon input {
  padding-left: 40px;
}

.input-with-icon input:focus ~ .input-icon,
.input-with-icon input:focus + .input-icon {
  color: var(--brand-active);
}


/* ────────────────────────────────────────────────────────────
    19. FOCUS VISIBLE — ACCESSIBILITY
    ──────────────────────────────────────────────────────────── */

:focus-visible {
  outline: 2.5px solid var(--brand-active);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Suppress default for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}


/* ────────────────────────────────────────────────────────────
    19b. DOUBLE AUTHENTIFICATION (2FA)
    ──────────────────────────────────────────────────────────── */

.auth-2fa-icon {
  display:         flex;
  align-items:     center;
  justify-content: center;
  width:           56px;
  height:          56px;
  margin-bottom:   var(--space-4);
  background:      var(--brand-lighter);
  border:          1px solid rgba(255, 185, 0, 0.28);
  border-radius:   var(--radius-lg);
  color:           var(--brand-active);
}

.auth-2fa-icon svg {
  width:  28px;
  height: 28px;
}

.auth-header .auth-2fa-email {
  color:       var(--color-text);
  font-weight: 600;
  word-break:  break-word;
}

.form-field input.otp-input {
  height:         58px;
  padding:        0 var(--space-4);
  background:     #ffffff;
  font-family:    var(--font-sans);
  font-size:      26px;
  font-weight:    700;
  letter-spacing: 8px;
  text-align:     center;
}

.form-field input.otp-input::placeholder {
  color:          var(--gray-300);
  font-weight:    600;
  letter-spacing: 8px;
}

.auth-resend-form {
  margin: 0;
}

/* Ces boutons sont dans un <form> : on neutralise le style du bouton
   principal (form > button[type="submit"]) pour garder un bouton secondaire. */
form > button.auth-resend-btn {
  height:         44px;
  margin-top:     0;
  padding:        0 var(--space-6);
  color:          var(--color-text);
  font-size:      var(--font-size-sm);
  font-weight:    600;
  letter-spacing: 0;
  background:     #ffffff;
  border:         1.5px solid var(--color-border);
  box-shadow:     none;
}

form > button.auth-resend-btn:hover {
  background:   var(--gray-50);
  border-color: var(--gray-400);
  box-shadow:   0 1px 3px rgba(0, 0, 0, 0.06);
  transform:    none;
}

form > button.auth-resend-btn:active {
  background:   var(--gray-100);
  border-color: var(--gray-400);
  box-shadow:   none;
  transform:    scale(0.99);
}

form > button.auth-resend-btn:focus-visible {
  box-shadow: 0 0 0 3px var(--brand-glow);
}

form > button.auth-resend-btn::after {
  content: none;
}

form > button.auth-resend-btn:disabled {
  opacity: 0.6;
  cursor:  not-allowed;
}

form > button.auth-resend-btn:disabled:hover {
  background:   #ffffff;
  border-color: var(--color-border);
  box-shadow:   none;
}

.auth-resend-btn svg {
  width:  16px;
  height: 16px;
}

.auth-cancel-form {
  margin:     0;
  text-align: center;
}

form > button.auth-link-button {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  width:           auto;
  height:          auto;
  margin-top:      0;
  padding:         var(--space-2);
  color:           var(--color-text-muted);
  font-family:     var(--font-sans);
  font-size:       var(--font-size-sm);
  font-weight:     400;
  letter-spacing:  0;
  text-decoration: underline;
  background:      none;
  border:          none;
  border-radius:   0;
  box-shadow:      none;
  position:        static;
  overflow:        visible;
  cursor:          pointer;
  transition:      color var(--transition-fast);
}

form > button.auth-link-button:hover {
  color:       var(--brand-text);
  background:  none;
  border:      none;
  box-shadow:  none;
  transform:   none;
}

form > button.auth-link-button:active {
  background: none;
  border:     none;
  box-shadow: none;
  transform:  none;
}

form > button.auth-link-button::after {
  content: none;
}


/* ────────────────────────────────────────────────────────────
    19c. PAGE 2FA — TOUT CENTRÉ, PALETTE NEUTRE, SANS OMBRE
    ──────────────────────────────────────────────────────────── */

.auth-page--2fa {
  background-color: #f6f7f8;
}

/* Fond animé et halo jaune neutralisés : seul le bouton principal
   conserve la couleur de marque. */
body:has(.auth-page--2fa) #bg-canvas {
  display: none;
}

.auth-page--2fa::before {
  background: none;
}

.auth-page--2fa .auth-card {
  background:   #ffffff;
  border-color: var(--gray-200);
  box-shadow:   none;
}

.auth-page--2fa .auth-header {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  text-align:     center;
}

.auth-page--2fa .auth-2fa-icon {
  margin-left:  auto;
  margin-right: auto;
  background:   var(--gray-100);
  border-color: var(--gray-200);
  color:        #111827;
  box-shadow:   none;
}

.auth-page--2fa .auth-header h2 {
  color: #111827;
}

.auth-page--2fa .auth-header p {
  color: #6b7280;
}

.auth-page--2fa .auth-header .auth-2fa-email {
  color: #111827;
}

.auth-page--2fa .auth-alert {
  justify-content: center;
  text-align:      center;
  box-shadow:      none;
}

/* Libellés et indications centrés, champ toujours pleine largeur. */
.auth-page--2fa .form-field {
  align-items: stretch;
}

.auth-page--2fa .form-field label,
.auth-page--2fa .form-field small {
  width:      100%;
  text-align: center;
}

.auth-page--2fa .form-field label {
  color: #111827;
}

.auth-page--2fa .form-field small {
  display: block;
  color:   #6b7280;
}

.auth-page--2fa .form-field input.otp-input,
.auth-page--2fa .form-field input.otp-input:hover,
.auth-page--2fa .form-field input.otp-input:focus {
  color:        #111827;
  background:   #ffffff;
  border-color: var(--gray-300);
  box-shadow:   none;
}

.auth-page--2fa .form-field input.otp-input:focus {
  border-color: #111827;
}

/* ── 6 cases de code : 3 + 3, séparées par un tiret ─────────── */

.otp-inputs {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             8px;
  width:           100%;
}

.form-field .otp-inputs .otp-input {
  flex:           1 1 0;
  width:          auto;
  min-width:      0;
  max-width:      52px;
  height:         58px;
  padding:        0;
  font-size:      24px;
  font-weight:    700;
  letter-spacing: 0;
  text-align:     center;
}

.form-field .otp-inputs .otp-input::placeholder {
  letter-spacing: 0;
}

.otp-separator {
  flex:        0 0 auto;
  width:       12px;
  color:       var(--gray-400);
  font-size:   20px;
  font-weight: 600;
  line-height: 1;
  text-align:  center;
  user-select: none;
}

@media (max-width: 400px) {
  .otp-inputs {
    gap: 5px;
  }

  .form-field .otp-inputs .otp-input {
    max-width: 42px;
    height:    50px;
    font-size: 20px;
  }
}

/* Le bouton principal est le seul élément jaune, et reste sans ombre. */
.auth-page--2fa .auth-form > button[type="submit"],
.auth-page--2fa .auth-form > button[type="submit"]:hover,
.auth-page--2fa .auth-form > button[type="submit"]:active {
  box-shadow: none;
  transform:  none;
}

.auth-page--2fa .auth-form > button[type="submit"]:focus-visible {
  outline:        2px solid #111827;
  outline-offset: 2px;
  box-shadow:     none;
}

.auth-page--2fa .auth-divider {
  width: 100%;
}

.auth-page--2fa form > button.auth-resend-btn {
  color:        #111827;
  background:   #ffffff;
  border-color: var(--gray-300);
}

.auth-page--2fa form > button.auth-resend-btn:hover,
.auth-page--2fa form > button.auth-resend-btn:active,
.auth-page--2fa form > button.auth-resend-btn:focus-visible {
  background:   #f3f4f6;
  border-color: #111827;
  box-shadow:   none;
  transform:    none;
  outline:      none;
}

.auth-page--2fa form > button.auth-link-button {
  color: #6b7280;
}

.auth-page--2fa form > button.auth-link-button:hover {
  color: #111827;
}


/* ────────────────────────────────────────────────────────────
    19d. FOND BLANC PUR — CONNEXION / INSCRIPTION
    ──────────────────────────────────────────────────────────── */

.auth-page--plain {
  background-color: #ffffff;
}

/* Filet de sécurité si l'animation n'a pas été désactivée côté JS. */
body:has(.auth-page--plain) #bg-canvas {
  display: none;
}

.auth-page--plain::before {
  background: none;
}

/* Formulaire temporairement bloqué après 3 échecs de connexion. */
.auth-form--locked [disabled] {
  cursor:  not-allowed;
  opacity: 0.6;
}

.auth-alert--lock {
  align-items: center;
}

.auth-alert--lock strong {
  font-variant-numeric: tabular-nums;
}


/* ────────────────────────────────────────────────────────────
    20. RESPONSIVE — MOBILE FIRST
    ──────────────────────────────────────────────────────────── */

/* ── Mobile (< 480px) ── */
@media (max-width: 480px) {
  .auth-page {
    padding:         var(--space-4) var(--space-3);
    justify-content: flex-start;
    padding-top:     var(--space-8);
  }

  .auth-brand {
    margin-bottom: var(--space-6);
  }

  .auth-card {
    padding:       var(--space-8) var(--space-5);
    border-radius: var(--radius-lg);
    /* On mobile the glass border stands out more; keep full shadow */
    box-shadow:
      0 1px 4px rgba(0,0,0,0.06),
      0 8px 24px rgba(0,0,0,0.08),
      0 0 0 1px rgba(229,231,235,0.5);
  }

  .auth-header {
    margin-bottom: var(--space-6);
  }

  .auth-header h2 {
    font-size: 20px;
  }

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  select {
    height:    46px; /* slightly taller tap target */
    font-size: var(--font-size-base);
  }

  form > button[type="submit"],
  .btn-primary {
    height:    50px;
    font-size: var(--font-size-base);
  }
}

/* ── Tablet (481px – 768px) ── */
@media (min-width: 481px) and (max-width: 768px) {
  .auth-card {
    max-width: 400px;
    padding:   var(--space-8) var(--space-7);
  }
}

/* ── Wide desktop (> 1200px) — optional subtle scale ── */
@media (min-width: 1200px) {
  .auth-card {
    max-width: 460px;
  }
}


/* ────────────────────────────────────────────────────────────
    21. MICRO-INTERACTIONS — FORM FIELD ENTRANCE
    ──────────────────────────────────────────────────────────── */

/* Staggered reveal for form fields */
.auth-form .form-field {
  animation: fieldReveal 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.auth-form .form-field:nth-child(1)  { animation-delay: 0.08s; }
.auth-form .form-field:nth-child(2)  { animation-delay: 0.12s; }
.auth-form .form-field:nth-child(3)  { animation-delay: 0.16s; }
.auth-form .form-field:nth-child(4)  { animation-delay: 0.20s; }
.auth-form .form-field:nth-child(5)  { animation-delay: 0.24s; }
.auth-form .form-field:nth-child(6)  { animation-delay: 0.28s; }
.auth-form .form-field:nth-child(7)  { animation-delay: 0.32s; }

@keyframes fieldReveal {
  from {
    opacity:   0;
    transform: translateY(10px);
  }
  to {
    opacity:   1;
    transform: translateY(0);
  }
}

/* Brand entrance */
.auth-brand {
  animation: brandReveal 0.4s ease both;
}

@keyframes brandReveal {
  from {
    opacity:   0;
    transform: translateY(-8px);
  }
  to {
    opacity:   1;
    transform: translateY(0);
  }
}


/* ────────────────────────────────────────────────────────────
    22. REDUCED MOTION — ACCESSIBILITY
    ──────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration:   0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration:  0.01ms !important;
  }

  #bg-canvas {
    display: none;
  }
}

