  :root{
    --bg: #06090b;
    --bg-2: #0a0f12;
    --panel-border: rgba(46, 230, 224, 0.28);
    --cyan: #2ee6e0;
    --cyan-soft: rgba(46, 230, 224, 0.55);
    --white: #f3f7f8;
    --muted: #9aa7ac;
    --muted-2: #7c8a8f;
    --card-bg: linear-gradient(180deg, rgba(46,230,224,0.03), transparent);
  }

  @keyframes pulseGlow{
    0%, 100%{
      box-shadow: 0 0 0px rgba(46,230,224,0);
      border-color: var(--panel-border);
    }
    50%{
      box-shadow: 0 0 30px rgba(46,230,224,0.35), 0 0 60px rgba(46,230,224,0.12);
      border-color: rgba(46,230,224,0.65);
    }
  }

  *{ box-sizing: border-box; }

  html{ scroll-behavior: smooth; background: var(--bg); }

  body{
    margin:0;
    min-height: 100vh;
    min-height: 100dvh; /* hauteur réellement visible sur téléphone (barre d'adresse comprise) */
    justify-content: center; /* logo + carte centrés verticalement dans la page */
    background: var(--bg);
    color: var(--white);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
  }

  @media (prefers-reduced-motion: reduce){
    *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  }

  a, button{ font-family: inherit; }

  /* Background ambience matching homepage tone */
  .bg-glow{
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
      radial-gradient(60% 45% at 50% -8%, rgba(46,230,224,0.10), transparent 70%),
      radial-gradient(45% 35% at 90% 100%, rgba(46,230,224,0.05), transparent 70%),
      linear-gradient(180deg, rgba(6,9,11,0.30), rgba(6,9,11,0.55)),
      url('../assets/images/connexion-fond.webp') center / cover no-repeat;
  }

  /* ---------- LOGO ---------- */

  .auth-header{
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    padding: clamp(40px, 7vh, 72px) 24px 8px;
  }

  .logo-link{
    display: inline-flex;
    align-items: center;
    text-decoration: none;
  }

  .logo-img{
    display: block;
    height: clamp(46px, 6vw, 64px);
    width: auto;
    filter: drop-shadow(0 0 16px rgba(46,230,224,0.45)) drop-shadow(0 0 34px rgba(46,230,224,0.18));
  }

  /* ---------- MAIN / CARD ---------- */

  main{
    position: relative;
    z-index: 2;
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 24px 20px clamp(60px, 8vh, 100px);
  }

  .auth-card{
    width: 100%;
    max-width: 440px;
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    background: var(--card-bg), rgba(10, 15, 18, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 0 25px rgba(46,230,224,0.20), 0 0 60px rgba(46,230,224,0.08), inset 0 0 20px rgba(46,230,224,0.04);
    padding: clamp(30px, 4vw, 44px) clamp(26px, 4vw, 38px);
    animation: pulseGlow 6s ease-in-out infinite;
  }

  .auth-title{
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: clamp(1.4rem, 2.4vw, 1.7rem);
    color: var(--cyan);
    text-shadow: 0 0 14px rgba(46,230,224,0.5), 0 0 28px rgba(46,230,224,0.2);
    margin: 0 0 6px 0;
    text-align: center;
  }

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

  .field{
    margin-bottom: 20px;
  }

  .field label{
    display: block;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.76rem;
    color: var(--muted);
    margin-bottom: 8px;
  }

  .field input[type="email"],
  .field input[type="password"],
  .field input[type="text"]{
    width: 100%;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 13px 14px;
    color: var(--white);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
  }

  .field input::placeholder{ color: var(--muted-2); }

  .field input:focus{
    border-color: var(--cyan);
    box-shadow: 0 0 14px rgba(46,230,224,0.3);
  }

  .password-wrap{ position: relative; }

  .password-wrap input{ padding-right: 44px; }

  .toggle-eye{
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .2s ease;
  }

  .toggle-eye:hover{ color: var(--cyan); }

  .toggle-eye svg{ width: 18px; height: 18px; }

  .row-between{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 26px 0;
    font-size: 0.84rem;
    flex-wrap: wrap;
    gap: 10px;
  }

  .remember{
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
  }

  .remember input[type="checkbox"]{
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--cyan-soft);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    background: transparent;
    flex-shrink: 0;
  }

  .remember input[type="checkbox"]:checked{
    background: var(--cyan);
    border-color: var(--cyan);
  }

  .remember input[type="checkbox"]:checked::after{
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #041012;
    border-width: 0 2px 2px 0;
    transform: rotate(40deg);
  }

  .forgot{
    color: var(--cyan);
    text-decoration: none;
    white-space: nowrap;
    transition: text-shadow .2s ease;
  }

  .forgot:hover{ text-shadow: 0 0 10px rgba(46,230,224,0.6); }

  .btn-submit{
    width: 100%;
    background: var(--cyan);
    color: #041012;
    border: none;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.95rem;
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 0px rgba(46,230,224,0);
    transition: box-shadow .25s ease, transform .2s ease;
  }

  .btn-submit:hover{
    box-shadow: 0 0 28px rgba(46,230,224,0.55);
    transform: translateY(-1px);
  }

  .signup-line{
    margin: 26px 0 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
  }

  .signup-line a{
    color: var(--cyan);
    font-weight: 600;
    text-decoration: none;
    transition: text-shadow .2s ease;
  }

  .signup-line a:hover{ text-shadow: 0 0 10px rgba(46,230,224,0.6); }
  /* Très petit mobile : « Inscris-toi » ne se coupe plus au tiret */
  @media (max-width: 360px){
    .signup-line a{ white-space: nowrap; }
  }

  .back-home{
    display: block;
    margin: 22px auto 0;
    text-align: center;
    color: var(--muted-2);
    text-decoration: none;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.76rem;
    transition: color .2s ease, text-shadow .2s ease;
  }

  .back-home:hover{
    color: var(--cyan);
    text-shadow: 0 0 10px rgba(46,230,224,0.5);
  }

  @media (max-width: 480px){
    .auth-card{ border-radius: 14px; }
  }

  /* ---------- TABLETTE UNIQUEMENT (641px - 980px)
     La carte de connexion était trop grande pour la hauteur visible
     de l'écran (obligeant à zoomer/défiler pour voir l'ensemble des
     éléments) : réduction ciblée des espacements et des tailles pour
     que toute la page soit visible sans défilement. ---------- */
  @media (min-width: 641px) and (max-width: 980px){
    body{
      justify-content: center;
    }
    .auth-header{
      padding: 18px 24px 4px;
    }
    .logo-img{
      height: 40px;
    }
    main{
      flex: none;
      padding: 12px 20px 28px;
    }
    .auth-card{
      max-width: 380px;
      padding: 22px 26px;
    }
    .auth-title{
      font-size: 1.25rem;
      margin: 0 0 4px 0;
    }
    .auth-subtitle{
      margin: 0 0 18px 0;
      font-size: 0.86rem;
    }
    .field{
      margin-bottom: 13px;
    }
    .field label{
      font-size: 0.68rem;
      margin-bottom: 5px;
    }
    .field input[type="email"],
    .field input[type="password"],
    .field input[type="text"]{
      padding: 10px 12px;
      font-size: 0.86rem;
    }
    .row-between{
      margin: 2px 0 16px 0;
      font-size: 0.78rem;
    }
    .btn-submit{
      padding: 12px 16px;
      font-size: 0.86rem;
    }
    .signup-line{
      margin: 16px 0 0 0;
      font-size: 0.82rem;
    }
    .back-home{
      margin: 14px auto 0;
      font-size: 0.7rem;
    }
  }

  @media (max-width: 360px){
    .logo-img{ height: 40px; max-width: 100%; }
  }

  /* ---------- ÉCRANS PEU HAUTS (petits téléphones, paysage)
     Seuls les espaces (marges) sont resserrés pour limiter le défilement :
     aucune taille de texte, de logo, de champ ni de bouton ne change. ---------- */
  @media (max-height: 640px){
    .auth-header{ padding-top: 14px; padding-bottom: 0; }
    main{ padding-top: 8px; padding-bottom: 14px; }
    .auth-card{ padding-top: 24px; padding-bottom: 24px; }
    .auth-subtitle{ margin-bottom: 18px; }
    .field{ margin-bottom: 14px; }
    .back-home{ margin-top: 12px; }
  }
  @media (max-height: 460px){
    .auth-header{ padding-top: 6px; }
    main{ padding-top: 4px; padding-bottom: 8px; }
    .auth-card{ padding-top: 14px; padding-bottom: 14px; }
    .auth-subtitle{ margin-bottom: 10px; }
    .field{ margin-bottom: 8px; }
    .back-home{ margin-top: 8px; }
  }
