/* ==========================================================================
   Event Studio POS — Écran de connexion (refonte "Nuit à Marrakech")
   Noir profond · accent or · verre dépoli · typographie éditoriale
   ========================================================================== */

.esl {
  --bg: #ffffff;
  --bg-2: #fafafa;
  --ink: #0f1729;
  --muted: rgba(15, 23, 41, 0.62);
  --muted-2: rgba(15, 23, 41, 0.4);
  --gold: #0f1729;
  --gold-strong: #0f1729;
  --gold-soft: #f3f4f6;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --card: #ffffff;
  --field: #f9fafb;
  --btn-ink: #ffffff;
  --font-serif: "Bricolage Grotesque", Arial, "Helvetica Neue", sans-serif;
  --font-sans: "Bricolage Grotesque", Arial, "Helvetica Neue", sans-serif;

  position: fixed;
  inset: 0;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 56px);
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

/* --- Fond : halos + grain ------------------------------------------------- */
.esl__bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.esl__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.75;
}

.esl__glow--gold {
  width: 46vw;
  height: 46vw;
  top: -14vw;
  right: -8vw;
  background: radial-gradient(circle, rgba(15, 23, 41, 0.05), rgba(15, 23, 41, 0) 68%);
  animation: eslFloat 16s ease-in-out infinite;
}

.esl__glow--deep {
  width: 52vw;
  height: 52vw;
  bottom: -22vw;
  left: -14vw;
  background: radial-gradient(circle, rgba(15, 23, 41, 0.04), rgba(15, 23, 41, 0) 70%);
  animation: eslFloat 20s ease-in-out infinite reverse;
}

.esl__grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/></svg>");
  opacity: 0.025;
  mix-blend-mode: multiply;
}

/* --- Scène ---------------------------------------------------------------- */
.esl__stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1180px;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  align-items: center;
  gap: clamp(32px, 5vw, 96px);
}

/* --- Volet marque --------------------------------------------------------- */
.esl__brand {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 4vw, 52px);
  animation: eslUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.esl__logo {
  width: clamp(220px, 24vw, 320px);
  height: auto;
  filter: invert(1) brightness(0.12);
}

.esl__hero {
  max-width: 30ch;
}

.esl__kicker {
  margin: 0 0 18px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
}

.esl__title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2.3rem, 4.4vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.esl__title em {
  font-style: italic;
  color: var(--gold-strong);
}

.esl__lead {
  margin: 22px 0 0;
  max-width: 42ch;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--muted);
}

.esl__flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid var(--line);
}

.esl__flow li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  transition: color 0.3s ease, padding-left 0.3s ease;
}

.esl__flow li:hover {
  color: var(--ink);
  padding-left: 10px;
}

.esl__flow span {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--gold);
  min-width: 26px;
}

/* --- Volet connexion ------------------------------------------------------ */
.esl__panel {
  display: flex;
  justify-content: center;
  animation: eslUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

.esl__card {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: clamp(30px, 3.4vw, 46px);
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(15, 23, 41, 0.1);
  backdrop-filter: blur(22px) saturate(120%);
  -webkit-backdrop-filter: blur(22px) saturate(120%);
  overflow: hidden;
}

.esl__cardglow {
  position: absolute;
  top: -1px;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.7;
}

.esl__mark {
  display: flex;
  justify-content: center;
  margin-bottom: 26px;
}

.esl__mark img {
  width: 178px;
  height: auto;
  opacity: 0.96;
  filter: invert(1) brightness(0.12);
}

.esl__cardhead {
  text-align: center;
  margin-bottom: 30px;
}

.esl__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--gold-soft);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-strong);
}

.esl__badgedot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-strong);
  box-shadow: 0 0 0 0 rgba(15, 23, 41, 0.6);
  animation: eslPulse 2.4s ease-out infinite;
}

.esl__cardhead h2 {
  margin: 18px 0 8px;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.esl__cardhead p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

/* --- Formulaire ----------------------------------------------------------- */
.esl__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.esl__field {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.esl__lbl {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 2px;
}

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

.esl__ico {
  position: absolute;
  left: 16px;
  color: var(--muted-2);
  pointer-events: none;
  transition: color 0.2s ease;
}

.esl__control input {
  width: 100%;
  height: 56px;
  padding: 0 16px 0 46px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: none;
  transition: border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

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

.esl__control input:focus {
  border-color: rgba(15, 23, 41, 0.6);
  background: rgba(15, 23, 41, 0.06);
  box-shadow: 0 0 0 4px rgba(15, 23, 41, 0.12);
}

.esl__control input:focus + .esl__peek,
.esl__control:focus-within .esl__ico {
  color: var(--gold);
}

.esl__peek {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: transparent;
  color: var(--muted-2);
  transition: color 0.2s ease, background 0.2s ease;
}

.esl__peek:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.esl__peek.is-on {
  color: var(--gold);
}

/* --- Bouton --------------------------------------------------------------- */
.esl__submit {
  position: relative;
  margin-top: 10px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 15px;
  font-family: var(--font-sans);
  font-size: 0.96rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--btn-ink);
  background: var(--ink);
  box-shadow: 0 4px 14px rgba(15, 23, 41, 0.18);
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.24s ease, filter 0.24s ease;
}

.esl__submit svg {
  transition: transform 0.24s ease;
}

.esl__submit::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s ease;
}

.esl__submit:hover {
  box-shadow: 0 18px 40px rgba(15, 23, 41, 0.38);
  filter: brightness(1.03);
}

.esl__submit:hover svg {
  transform: translateX(4px);
}

.esl__submit:hover::after {
  transform: translateX(120%);
}

.esl__submit:active {
  transform: translateY(1px) scale(0.99);
}

/* --- Erreur --------------------------------------------------------------- */
.esl__error {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 13px 16px;
  border-radius: 13px;
  background: rgba(201, 74, 63, 0.14);
  border: 1px solid rgba(201, 74, 63, 0.34);
  color: #f0b3ad;
  font-size: 0.9rem;
  line-height: 1.35;
  animation: eslShake 0.4s ease;
}

.esl__error svg {
  flex: 0 0 auto;
  color: #e58279;
}

/* --- Pied de carte -------------------------------------------------------- */
.esl__cardfoot {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.esl__sep {
  color: var(--gold);
}

/* --- Animations ----------------------------------------------------------- */
@keyframes eslUp {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes eslFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(3%, 4%) scale(1.06); }
}

@keyframes eslGrain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6%, 4%); }
  40% { transform: translate(4%, -5%); }
  60% { transform: translate(-3%, 6%); }
  80% { transform: translate(5%, 2%); }
}

@keyframes eslPulse {
  0% { box-shadow: 0 0 0 0 rgba(15, 23, 41, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(15, 23, 41, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 23, 41, 0); }
}

@keyframes eslShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 900px) {
  .esl {
    place-items: start center;
  }

  .esl__stage {
    grid-template-columns: 1fr;
    gap: 34px;
    max-width: 460px;
  }

  .esl__brand {
    align-items: center;
    text-align: center;
    gap: 22px;
  }

  .esl__hero {
    max-width: none;
  }

  .esl__lead {
    margin-inline: auto;
  }

  .esl__flow {
    display: none;
  }

  .esl__mark {
    display: none;
  }
}

@media (max-width: 460px) {
  .esl__card {
    padding: 26px 20px 24px;
    border-radius: 22px;
  }

  .esl__title {
    font-size: 2.6rem;
  }
}

/* Tablette de caisse en PAYSAGE COURT (ex. G-Tab T13) : le clavier PIN doit être
   visible sans défiler. On masque le volet marketing et on centre la carte compacte. */
@media (orientation: landscape) and (max-height: 720px) {
  .esl { place-items: center; padding: 16px; }
  .esl__brand { display: none; }
  .esl__mark { display: none; }
  .esl__stage {
    grid-template-columns: 1fr;
    max-width: 460px;
    gap: 0;
  }
  .esl__card { padding: 20px 26px; }
  .esl__cardhead { margin-bottom: 6px; }
  .esl__cardhead h2 { font-size: 1.5rem; }
  .esl__cardhead p { font-size: 0.9rem; }
  .esl__switch { margin-bottom: 16px; }
  .esl__dots { margin: 6px 0 16px; }
  .esl__keys { gap: 10px; }
  .esl__keys button { height: 50px; font-size: 1.3rem; }
  .esl__field { gap: 6px; }
  .esl__cardfoot { margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .esl *,
  .esl *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   MODE SOMBRE (data-theme="dark") — inverse noir & blanc
   ========================================================================== */
[data-theme="dark"] .esl {
  --bg: #0a0a0a;
  --bg-2: #101010;
  --ink: #fafafa;
  --muted: rgba(250, 250, 250, 0.6);
  --muted-2: rgba(250, 250, 250, 0.38);
  --gold: #fafafa;
  --gold-strong: #ffffff;
  --gold-soft: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.24);
  --card: #121212;
  --field: rgba(255, 255, 255, 0.04);
  --btn-ink: #0a0a0a;
}

[data-theme="dark"] .esl__logo,
[data-theme="dark"] .esl__mark img {
  filter: none;
}

[data-theme="dark"] .esl__glow--gold {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 68%);
}

[data-theme="dark"] .esl__glow--deep {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 70%);
}

[data-theme="dark"] .esl__grain {
  opacity: 0.04;
  mix-blend-mode: overlay;
}

[data-theme="dark"] .esl__card {
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .esl__error {
  color: #f0b3ad;
  background: rgba(201, 74, 63, 0.14);
  border-color: rgba(201, 74, 63, 0.34);
}

/* --- Bascule PIN / Responsable ------------------------------------------- */
.esl__switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 22px;
  border-radius: 13px;
  background: var(--field);
  border: 1px solid var(--line);
}
.esl__tab {
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.esl__tab.is-active,
.esl__switch[data-mode="pin"] .esl__tab[data-mode="pin"],
.esl__switch[data-mode="pass"] .esl__tab[data-mode="pass"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(15, 23, 41, 0.1);
}

.esl__pane[hidden] { display: none; }
.esl__pane { animation: eslUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }

/* --- Points du PIN -------------------------------------------------------- */
.esl__dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 6px 0 26px;
}
.esl__dots span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--line-strong);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.esl__dots span.is-on {
  background: var(--ink);
  border-color: var(--ink);
  transform: scale(1.12);
}
.esl__dots.is-done span { border-color: var(--ink); }

/* --- Pavé numérique ------------------------------------------------------- */
.esl__keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.esl__keys button {
  height: 62px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease, background 0.16s ease, border-color 0.16s ease;
}
.esl__keys button:hover { border-color: var(--line-strong); background: var(--field); }
.esl__keys button.is-tap,
.esl__keys button:active { transform: scale(0.94); background: var(--gold-soft); }
.esl__keys button.esl__key--ghost {
  font-size: 1.15rem;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}
.esl__keys button.esl__key--ghost:hover { background: var(--field); border-color: var(--line); }

[data-theme="dark"] .esl__tab.is-active,
[data-theme="dark"] .esl__switch[data-mode="pin"] .esl__tab[data-mode="pin"],
[data-theme="dark"] .esl__switch[data-mode="pass"] .esl__tab[data-mode="pass"] {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .esl__keys button.is-tap,
[data-theme="dark"] .esl__keys button:active { background: rgba(255, 255, 255, 0.08); }
