/* ==========================================================================
   Newo — Écran de connexion
   Design system : "nuit urbaine" — bleu asphalte profond + tracé de trajet
   Nécessite tokens.css (variables + reset de base) chargé avant ce fichier.
   ========================================================================== */

/* ---------------------------------------------------------------------- */
/* Layout : deux panneaux                                                  */
/* ---------------------------------------------------------------------- */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.auth-visual {
  position: relative;
  background:
    radial-gradient(circle at 15% 10%, rgba(56, 225, 198, 0.10), transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(255, 176, 32, 0.12), transparent 50%),
    linear-gradient(160deg, var(--navy-900) 0%, var(--navy-950) 70%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 4vw, 56px);
}

.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 56px);
  background: var(--navy-950);
}

/* ---------------------------------------------------------------------- */
/* Panneau visuel : marque + carte animée                                  */
/* ---------------------------------------------------------------------- */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-name span { color: var(--amber); }

.visual-copy {
  z-index: 2;
  margin-top: clamp(28px, 6vh, 64px);
  max-width: 30ch;
}

.visual-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.visual-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(56, 225, 198, 0.18);
}

.visual-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
  line-height: 1.2;
  margin: 0 0 10px;
  font-weight: 600;
}

.visual-copy p {
  color: var(--fog);
  font-size: 0.98rem;
  line-height: 1.6;
  margin: 0;
}

.map-wrap {
  position: relative;
  flex: 1;
  margin-top: clamp(20px, 4vh, 40px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--navy-700);
  background: linear-gradient(180deg, var(--navy-900), var(--navy-950));
  min-height: 280px;
}

.map-svg { width: 100%; height: 100%; display: block; }

.route-line {
  fill: none;
  stroke: url(#routeGradient);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 9 10;
  animation: dash-flow 2.4s linear infinite;
}

@keyframes dash-flow {
  to { stroke-dashoffset: -38; }
}

/* ---------------------------------------------------------------------- */
/* Bandeau mobile : le composant est défini dans route-widget.css.        */
/* Ici, on ne garde que son activation par media query (voir plus bas).   */
/* ---------------------------------------------------------------------- */

.route-strip {
  display: none; /* réactivé sur mobile, voir media query plus bas */
  margin-top: 16px;
}

.node-pickup, .node-dropoff {
  filter: drop-shadow(0 0 6px rgba(0,0,0,0.5));
}

.map-grid line {
  stroke: var(--navy-700);
  stroke-width: 1;
  opacity: 0.55;
}

/* Carte flottante "course en cours" */
.stat-float {
  position: absolute;
  left: 20px;
  bottom: 20px;
  background: rgba(15, 22, 38, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid var(--navy-700);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  gap: 18px;
  z-index: 3;
}

.stat-float .stat { display: flex; flex-direction: column; gap: 2px; }

.stat-float .stat-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fog-dim);
}

.stat-float .stat-value {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--white);
}

.stat-float .stat-value.accent { color: var(--amber); }

/* ---------------------------------------------------------------------- */
/* Formulaire                                                              */
/* ---------------------------------------------------------------------- */

.form-card {
  width: 100%;
  max-width: 400px;
}

.form-header { margin-bottom: 30px; }

.form-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fog-dim);
  margin: 0 0 10px;
}

.form-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  margin: 0 0 8px;
  font-weight: 600;
}

.form-header p {
  color: var(--fog);
  margin: 0;
  font-size: 0.95rem;
}

.alert {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.87rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.alert-error {
  background: var(--danger-bg);
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: #ffb3b3;
}

.alert-error ul { margin: 0; padding-left: 18px; }
.alert-error li + li { margin-top: 4px; }

.alert-success {
  background: var(--success-bg);
  border: 1px solid rgba(56, 225, 198, 0.3);
  color: var(--cyan);
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 0.83rem;
  color: var(--fog);
  margin-bottom: 7px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap svg.icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--fog-dim);
  pointer-events: none;
}

.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  width: 100%;
  background: var(--navy-900);
  border: 1px solid var(--navy-700);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 14px 12px 42px;
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(56, 225, 198, 0.15);
}

.phone-field-row {
  display: flex;
  gap: 8px;
}

.phone-country-select {
  flex: none;
  width: 108px;
  background: var(--navy-900);
  border: 1px solid var(--navy-700);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.phone-country-select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(56, 225, 198, 0.15);
}

.phone-field-row .input-wrap input {
  padding-left: 42px;
}

@media (max-width: 380px) {
  .phone-country-select { width: 88px; font-size: 0.82rem; }
}

.btn-locate {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px dashed var(--navy-600);
  background: var(--navy-900);
  color: var(--cyan);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-locate svg { width: 18px; height: 18px; }
.btn-locate:hover { border-color: var(--cyan); background: var(--navy-800); }

.btn-locate.is-loading { color: var(--amber); border-style: solid; border-color: rgba(255,176,32,.4); cursor: default; }
.btn-locate.is-captured { color: var(--on-accent); background: linear-gradient(90deg, var(--amber-soft), var(--amber)); border: none; }
.btn-locate.is-error { color: var(--danger); border-color: rgba(255,107,107,.4); }

.field input.field-invalid {
  border-color: var(--danger);
}

.toggle-visibility {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--fog-dim);
  cursor: pointer;
  padding: 8px;
  display: flex;
  border-radius: 6px;
}

.toggle-visibility:hover { color: var(--fog); }
.toggle-visibility svg { width: 18px; height: 18px; }

.field-hint {
  font-size: 0.76rem;
  color: var(--fog-dim);
  margin-top: 6px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 0.87rem;
}

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

.checkbox-field input {
  appearance: none;
  width: 17px;
  height: 17px;
  border: 1px solid var(--navy-600);
  border-radius: 5px;
  background: var(--navy-900);
  cursor: pointer;
  display: grid;
  place-content: center;
  flex-shrink: 0;
}

.checkbox-field input::before {
  content: "";
  width: 9px;
  height: 9px;
  transform: scale(0);
  border-radius: 2px;
  background: var(--cyan);
  transition: transform 0.1s ease;
}

.checkbox-field input:checked::before { transform: scale(1); }
.checkbox-field input:checked { border-color: var(--cyan); }

.link {
  color: var(--cyan);
  text-decoration: none;
}

.link:hover { text-decoration: underline; }

.btn-submit {
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--on-accent);
  background: linear-gradient(90deg, var(--amber-soft), var(--amber));
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn-submit:hover { filter: brightness(1.05); }
.btn-submit:active { transform: scale(0.99); }

.btn-submit:focus-visible,
.checkbox-field input:focus-visible,
.toggle-visibility:focus-visible,
a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.form-footer {
  margin-top: 26px;
  text-align: center;
  font-size: 0.87rem;
  color: var(--fog);
}

.demo-note {
  margin-top: 22px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--navy-900);
  border: 1px dashed var(--navy-600);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--fog-dim);
  line-height: 1.6;
}

.demo-note b { color: var(--fog); }

/* ---------------------------------------------------------------------- */
/* Responsive                                                              */
/* ---------------------------------------------------------------------- */

@media (max-width: 960px) {
  .auth-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .auth-visual {
    padding: 22px clamp(20px, 6vw, 40px);
  }

  .visual-copy { display: none; }

  /* La carte détaillée cède la place au bandeau compact en ligne droite */
  .map-wrap { display: none; }
  .route-strip { display: flex; }
}

@media (max-width: 480px) {
  .auth-form-panel { padding: 22px 18px 40px; }
  .form-card { max-width: none; }
  .route-strip { height: 46px; padding: 0 12px; gap: 9px; }
  .route-strip-meta { font-size: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .route-line { animation: none; }
}
