/* =====================================================================
   YalendoLabs - Ecran de connexion
   Palette de marque : bleu #307BC4, navy #133a58, teal #1b8f8a, or #e8a33d
   Toutes les regles sont scopees sous .yal-login-body pour ne pas toucher
   aux pages d'inscription et vendeur qui partagent le layout auth.
   ===================================================================== */

.yal-login-body {
  --yl-blue: #307bc4;
  --yl-blue-dark: #1f5f97;
  --yl-navy: #133a58;
  --yl-navy-deep: #071b2a;
  --yl-teal: #1b8f8a;
  --yl-gold: #e8a33d;
  --yl-ink: #12283a;
  --yl-muted: #5b6f81;
  --yl-line: #dbe6f1;
  --yl-field: #f5f9fd;
  --yl-card: rgba(255, 255, 255, 0.97);

  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(900px 620px at 12% 8%, rgba(48, 123, 196, 0.28), transparent 62%),
    radial-gradient(760px 520px at 88% 92%, rgba(27, 143, 138, 0.22), transparent 64%),
    radial-gradient(520px 420px at 82% 10%, rgba(232, 163, 61, 0.12), transparent 70%),
    linear-gradient(158deg, #071b2a 0%, #0f2e47 48%, #0a2236 100%);
  color: var(--yl-ink);
  overflow-x: hidden;
}

/* Le loader du template n'a pas sa place sur un ecran de connexion. */
.yal-login-body #loading {
  display: none !important;
}

.yal-login-body .yal-login-page {
  position: relative;
  min-height: 100vh;
  z-index: 1;
}

/* Decor de fond : halos et reseau de points */
.yal-login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.yal-login-bg::before,
.yal-login-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}

.yal-login-bg::before {
  width: 520px;
  height: 520px;
  top: -170px;
  left: -140px;
  background: radial-gradient(circle, rgba(48, 123, 196, 0.34) 0%, rgba(48, 123, 196, 0) 68%);
}

.yal-login-bg::after {
  width: 620px;
  height: 620px;
  right: -200px;
  bottom: -220px;
  background: radial-gradient(circle, rgba(232, 163, 61, 0.16) 0%, rgba(232, 163, 61, 0) 70%);
}

.yal-login-bg canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.7;
}

/* Mise en page */
.yal-login-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-content: safe center;
  gap: 34px;
  padding: 28px 16px calc(22px + env(safe-area-inset-bottom, 0px));
}

/* Carte */
.yal-login-card {
  position: relative;
  width: 100%;
  max-width: 390px;
  box-sizing: border-box;
  padding: 24px 28px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: var(--yl-card);
  box-shadow:
    0 22px 52px rgba(3, 15, 26, 0.42),
    0 2px 0 rgba(255, 255, 255, 0.7) inset;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  overflow-wrap: break-word;
  animation: yal-login-rise 0.65s cubic-bezier(0.22, 0.85, 0.3, 1) both;
}

.yal-login-card__accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--yl-blue) 0%, var(--yl-teal) 55%, var(--yl-gold) 100%);
}

@keyframes yal-login-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Logo */
.yal-login-logo {
  position: relative;
  text-align: center;
  margin-bottom: 12px;
}

.yal-login-logo a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 14px 30px rgba(19, 58, 88, 0.22);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.yal-login-logo a:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(19, 58, 88, 0.16);
}

.yal-login-logo img {
  display: block;
  height: 72px;
  width: 72px;
  border-radius: 50%;
}

.yal-login-logo::after {
  content: "";
  display: block;
  width: 92px;
  height: 2px;
  margin: 8px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(48, 123, 196, 0) 0%, var(--yl-blue) 30%, var(--yl-gold) 70%, rgba(232, 163, 61, 0) 100%);
}

/* En-tete */
.yal-login-head {
  text-align: center;
  margin-bottom: 14px;
}

.yal-login-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 10px;
  margin-bottom: 8px;
  border-radius: 999px;
  border: 1px solid rgba(27, 143, 138, 0.28);
  background: rgba(27, 143, 138, 0.1);
  color: #126663;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
}

.yal-login-badge i {
  font-size: 14px;
}

.yal-login-title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--yl-navy);
  line-height: 1.2;
}

.yal-login-subtitle {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--yl-muted);
}

/* Erreurs et statuts */
.yal-login-card .alert {
  border-radius: 12px;
  border: 1px solid rgba(27, 143, 138, 0.25);
  font-size: 13.5px;
}

.yal-login-card ul.text-danger {
  margin: 0 0 18px;
  padding: 12px 16px 12px 32px;
  border-radius: 12px;
  border: 1px solid rgba(180, 42, 42, 0.22);
  background: #fdf3f3;
  color: #a32525 !important;
  font-size: 13.5px;
}

/* Champs */
.yal-login-form .yal-field {
  margin-bottom: 12px;
}

.yal-login-form .yal-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--yl-navy);
}

.yal-login-form .yal-required {
  color: #c0392b;
}

.yal-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1.5px solid var(--yl-line);
  border-radius: 12px;
  background: var(--yl-field);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.yal-input-group > i {
  flex: 0 0 auto;
  font-size: 18px;
  color: #7b8fa3;
  transition: color 0.2s ease;
}

.yal-input-group input {
  flex: 1 1 auto;
  min-width: 0;
  height: 46px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--yl-ink);
  font-size: 14px;
  box-shadow: none;
  outline: none;
}

.yal-input-group input::placeholder {
  color: #93a5b6;
}

.yal-input-group input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--yl-field) inset;
  -webkit-text-fill-color: var(--yl-ink);
}

.yal-input-group:focus-within {
  border-color: var(--yl-blue);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(48, 123, 196, 0.14);
}

.yal-input-group:focus-within > i {
  color: var(--yl-blue);
}

.yal-input-group.is-invalid {
  border-color: #c0392b;
  background: #fdf5f5;
  box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.1);
}

.yal-input-group.is-invalid > i {
  color: #c0392b;
}

.yal-login-form .invalid-feedback {
  display: none;
  margin-top: 6px;
  font-size: 12.5px;
  color: #b02a2a;
}

.yal-login-form .invalid-feedback.is-visible {
  display: block;
}

/* Bouton oeil */
.yal-eye {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #7b8fa3;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.yal-eye:hover,
.yal-eye:focus-visible {
  color: var(--yl-blue);
  background: rgba(48, 123, 196, 0.1);
}

.yal-eye i {
  font-size: 18px;
}

/* Ligne souvenir et mot de passe oublie */
.yal-login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.yal-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13.5px;
  color: var(--yl-muted);
  cursor: pointer;
  user-select: none;
}

.yal-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--yl-blue);
  cursor: pointer;
}

.yal-link {
  color: var(--yl-blue-dark);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.yal-link:hover {
  color: var(--yl-blue);
  text-decoration: underline;
}

/* Bouton principal */
.yal-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--yl-blue) 0%, var(--yl-blue-dark) 55%, var(--yl-navy) 100%);
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 14px 28px rgba(48, 123, 196, 0.3);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.yal-submit::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.28) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-18deg);
  transition: left 0.55s ease;
}

.yal-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(48, 123, 196, 0.38);
}

.yal-submit:hover::after {
  left: 115%;
}

.yal-submit:focus-visible {
  outline: 3px solid rgba(232, 163, 61, 0.55);
  outline-offset: 2px;
}

.yal-submit:disabled,
.yal-submit.is-loading {
  filter: saturate(0.7);
  cursor: progress;
  transform: none;
}

.yal-submit i {
  font-size: 18px;
  transition: transform 0.2s ease;
}

.yal-submit:hover i {
  transform: translateX(2px);
}

.yal-submit .yal-spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: yal-login-spin 0.7s linear infinite;
}

@keyframes yal-login-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Liens secondaires */
.yal-login-alt {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--yl-muted);
}

.yal-login-alt a {
  color: var(--yl-blue-dark);
  font-weight: 600;
  text-decoration: none;
}

.yal-login-alt a:hover {
  color: var(--yl-blue);
  text-decoration: underline;
}

.yal-vendor {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed rgba(48, 123, 196, 0.35);
  border-radius: 14px;
  background: rgba(48, 123, 196, 0.06);
  color: var(--yl-navy);
  font-size: 13px;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.yal-vendor i {
  flex: 0 0 auto;
  font-size: 22px;
  color: var(--yl-teal);
}

.yal-vendor__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.yal-vendor__label {
  color: var(--yl-muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.yal-vendor strong {
  color: var(--yl-blue-dark);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
}

.yal-vendor:hover {
  border-color: var(--yl-blue);
  background: rgba(48, 123, 196, 0.1);
  transform: translateY(-1px);
}

/* Comptes de demonstration */
.yal-demo {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--yl-line);
}

.yal-demo > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--yl-muted);
  cursor: pointer;
  list-style: none;
  transition: color 0.2s ease;
}

.yal-demo > summary::-webkit-details-marker {
  display: none;
}

.yal-demo > summary::before {
  content: "\25B8";
  font-size: 11px;
  transition: transform 0.2s ease;
}

.yal-demo[open] > summary::before {
  transform: rotate(90deg);
}

.yal-demo > summary:hover {
  color: var(--yl-navy);
}

.yal-demo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--yl-line);
  border-radius: 12px;
  background: var(--yl-field);
}

.yal-demo-row__id {
  min-width: 0;
}

.yal-demo-row__role {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--yl-teal);
}

.yal-demo-row__mail {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--yl-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yal-demo-row__pass {
  display: block;
  font-size: 12px;
  color: var(--yl-muted);
}

.yal-demo-fill {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid rgba(48, 123, 196, 0.35);
  border-radius: 9px;
  background: #ffffff;
  color: var(--yl-blue-dark);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.yal-demo-fill:hover {
  background: var(--yl-blue);
  border-color: var(--yl-blue);
  color: #ffffff;
}

/* Pied de page */
.yal-login-footer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #cfe0ee;
  font-size: 12px;
  letter-spacing: 0.2px;
  backdrop-filter: blur(6px);
}

.yal-login-footer__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--yl-gold);
}

/* Responsive */
@media (max-width: 520px) {
  .yal-login-wrap {
    gap: 24px;
    padding: 22px 14px calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .yal-login-card {
    padding: 22px 20px 18px;
    border-radius: 18px;
  }

  .yal-login-title {
    font-size: 22px;
  }

  .yal-login-logo img {
    height: 66px;
    width: 66px;
  }

  .yal-login-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .yal-login-alt {
    margin-top: 12px;
  }

  .yal-vendor {
    margin-top: 10px;
    padding: 9px 11px;
  }
}

/* Ecrans peu hauts : on resserre encore pour garder le pied de page visible. */
@media (max-height: 800px) {
  .yal-login-wrap {
    gap: 28px;
    padding: 14px 16px calc(6px + env(safe-area-inset-bottom, 0px));
  }

  .yal-login-card {
    padding: 18px 26px 14px;
  }

  .yal-login-logo {
    margin-bottom: 10px;
  }

  .yal-login-logo img {
    height: 56px;
    width: 56px;
  }

  .yal-login-logo::after {
    margin-top: 7px;
  }

  .yal-login-head {
    margin-bottom: 12px;
  }

  .yal-login-badge {
    margin-bottom: 6px;
  }

  .yal-login-form .yal-field {
    margin-bottom: 9px;
  }

  .yal-login-row {
    margin-bottom: 10px;
  }

  .yal-login-footer {
    padding: 6px 14px;
  }
}

/* Tres petits ecrans (iPhone SE et equivalents) : on gagne de la hauteur
   pour que le copyright reste visible sous le formulaire. */
@media (max-width: 400px) {
  .yal-login-wrap {
    gap: 22px;
    padding: 12px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .yal-login-card {
    padding: 16px 18px 12px;
  }

  .yal-login-logo img {
    height: 52px;
    width: 52px;
  }

  .yal-login-title {
    font-size: 20px;
  }

  .yal-login-badge {
    padding: 3px 9px;
    font-size: 10px;
  }

  .yal-login-form .yal-label {
    margin-bottom: 5px;
    font-size: 12.5px;
  }

  .yal-input-group {
    padding: 0 12px;
  }

  .yal-input-group input {
    height: 42px;
  }

  .yal-submit {
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .yal-login-card,
  .yal-submit,
  .yal-submit::after,
  .yal-login-logo a,
  .yal-vendor {
    animation: none;
    transition: none;
  }
}
