/* Marichal Terrassement — Écran de connexion (maquette Connexion.png) */

:root {
  --orange: #dd7807;
  --orange-hover: #c56a05;
  --orange-soft: rgba(221, 120, 7, 0.12);
  --ink: #111111;
  --muted: #6b7280;
  --line: #e5e7eb;
  --surface: #f7f7f7;
  --white: #ffffff;
  --radius: 12px;
  --shadow: 0 12px 40px rgba(17, 17, 17, 0.08);
  --font: "Barlow", "Segoe UI", sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body.login-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--orange);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.login {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* ——— Colonne marque ——— */
.login__brand {
  position: relative;
  color: var(--white);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  isolation: isolate;
  min-height: 100%;
}

.login__brand-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(12, 14, 16, 0.55) 0%, rgba(12, 14, 16, 0.72) 45%, rgba(8, 9, 10, 0.92) 100%),
    url("../../img/connexion.jpg") center / cover no-repeat;
}

.login__brand-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 70% 60%, rgba(221, 120, 7, 0.18), transparent 60%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.25), transparent 40%);
  pointer-events: none;
}

.login__brand-logo {
  width: min(200px, 52vw);
  height: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
  animation: fade-up 0.7s ease both;
}

.login__brand-copy {
  max-width: none;
  width: 100%;
  margin-top: auto;
  padding-bottom: 0.25rem;
  animation: fade-up 0.8s ease 0.1s both;
}

.login__eyebrow {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--orange);
  text-transform: uppercase;
}

.login__headline {
  margin: 0 0 0.75rem;
  max-width: 34rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.2vw, 3.15rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}

.login__subhead {
  margin: 0;
  max-width: 34rem;
  font-size: clamp(0.85rem, 1.4vw, 1rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.login__features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(1rem, 2.5vw, 2rem);
  row-gap: 1rem;
  align-items: start;
  width: 100%;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  animation: fade-up 0.85s ease 0.2s both;
}

.login__feature {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 0;
}

.login__feature-icon {
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  flex: 0 0 1.75rem;
  color: var(--orange);
  margin: 0 0 0.2rem;
}

.login__feature strong {
  display: block;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login__feature span {
  display: block;
  margin: 0;
  min-height: 2.6em;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.72);
}

/* ——— Colonne formulaire ——— */
.login__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--surface);
}

.login__card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: clamp(1.75rem, 4vw, 2.35rem) clamp(1.5rem, 3.5vw, 2.15rem);
  animation: fade-up 0.65s ease both;
}

.login__card-logo {
  width: 168px;
  margin: 0 auto 1.35rem;
}

.login__title {
  margin: 0 0 1.75rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.login__alert {
  margin: 0 0 1.1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.875rem;
  border: 1px solid #fecaca;
}

.login__alert--success {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.login-page--solo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-solo {
  width: 100%;
  max-width: 420px;
}

.login-solo .login__card {
  animation: fade-up 0.65s ease both;
}

.login-solo__hint {
  text-align: center;
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

.login__field {
  margin-bottom: 1.1rem;
}

.login__label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

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

.login__control-icon {
  position: absolute;
  left: 0.9rem;
  width: 1.15rem;
  height: 1.15rem;
  color: #9ca3af;
  pointer-events: none;
}

.login__input {
  width: 100%;
  height: 3rem;
  padding: 0 2.75rem 0 2.65rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login__input::placeholder {
  color: #9ca3af;
}

.login__input:hover {
  border-color: #d1d5db;
}

.login__input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}

.login__toggle {
  position: absolute;
  right: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.login__toggle .icon-eye,
.login__toggle .icon-eye-off {
  display: none;
  flex-shrink: 0;
}

/* Mot de passe masqué → œil barré */
.login__toggle[aria-pressed="false"] .icon-eye-off {
  display: block;
}

/* Mot de passe visible → œil ouvert */
.login__toggle[aria-pressed="true"] .icon-eye {
  display: block;
}

.login__toggle:hover {
  color: var(--ink);
  background: var(--surface);
}

.login__toggle[aria-pressed="true"] {
  color: var(--orange);
}

.login__forgot {
  display: flex;
  justify-content: flex-end;
  margin: -0.35rem 0 1.35rem;
}

.login__forgot-btn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--orange);
  cursor: pointer;
}

.login__forgot-btn:hover {
  text-decoration: underline;
}

.login__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  height: 3.05rem;
  border: 0;
  border-radius: 10px;
  background: var(--orange);
  color: var(--white);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
  box-shadow: 0 8px 20px rgba(221, 120, 7, 0.28);
}

.login__submit:hover {
  background: var(--orange-hover);
  transform: translateY(-1px);
}

.login__submit:active {
  transform: translateY(0);
}

.login__submit svg {
  width: 1.05rem;
  height: 1.05rem;
}

.login__footer {
  margin-top: 1.75rem;
  text-align: center;
  font-size: 0.78rem;
  color: #9ca3af;
}

/* ——— Modal mot de passe oublié ——— */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 14, 16, 0.55);
  backdrop-filter: blur(4px);
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: clamp(1.5rem, 4vw, 2rem);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  animation: modal-in 0.22s ease both;
}

.modal__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
}

.modal__close:hover {
  color: var(--ink);
  background: var(--surface);
}

.modal__title {
  margin: 0 2rem 0.5rem 0;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
}

.modal__text {
  margin: 0 0 1.35rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
}

.modal__success {
  margin: 0 0 1.1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.875rem;
  border: 1px solid #a7f3d0;
}

.modal__form .login__submit {
  margin-top: 0.25rem;
}

body.modal-open {
  overflow: hidden;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .login {
    grid-template-columns: 1fr;
  }

  .login__brand {
    min-height: 42vh;
    order: 2;
  }

  .login__panel {
    order: 1;
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .login__features {
    margin-top: 1.75rem;
  }
}

@media (max-width: 560px) {
  .login__card {
    box-shadow: none;
    background: transparent;
    padding: 0;
  }

  .login__panel {
    background: var(--white);
  }

  .login__features {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .login__brand {
    min-height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login__brand-logo,
  .login__brand-copy,
  .login__features,
  .login__card {
    animation: none;
  }

  .login__submit:hover {
    transform: none;
  }

  .modal__panel {
    animation: none;
  }
}
