/*
 * zSMS — écran d'authentification (connexion, mot de passe oublié, nouveau mot de passe).
 * Coquille partagée : customers/plugins/UsersManager/templates/layout/visitor.php
 * Polices déclarées dans custom.css (chargé avant ce fichier sur le même layout) —
 * pas de @font-face ici, cf. sa section "Polices (auto-hébergées)".
 */

:root {
  --auth-bg: #EEF2FA;
  --auth-bg-grid: rgba(18, 26, 46, 0.06);
  --auth-surface: #FFFFFF;
  --auth-surface-2: #F2F5FB;
  --auth-surface-2-border: rgba(18, 26, 46, 0.10);
  --auth-text: #121A2E;
  --auth-text-muted: #5B6780;
  --auth-text-faint: #8B93A8;
  --auth-signal: #1E9E6B;
  --auth-signal-soft: rgba(30, 158, 107, 0.14);
  --auth-amber: #B96A0A;
  --auth-coral: #D6455A;
  --auth-border: rgba(18, 26, 46, 0.12);
  --auth-card-shadow: 0 1px 2px rgba(18, 26, 46, 0.04), 0 24px 48px -20px rgba(18, 26, 46, 0.22);
  --auth-focus: #2C6FE0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --auth-bg: #0A0F1C;
    --auth-bg-grid: rgba(234, 240, 250, 0.05);
    --auth-surface: #121A2E;
    --auth-surface-2: #182338;
    --auth-surface-2-border: rgba(234, 240, 250, 0.09);
    --auth-text: #EAF0FA;
    --auth-text-muted: #8996B0;
    --auth-text-faint: #5C6883;
    --auth-signal: #34E0A1;
    --auth-signal-soft: rgba(52, 224, 161, 0.14);
    --auth-amber: #F5A623;
    --auth-coral: #FF7A7A;
    --auth-border: rgba(234, 240, 250, 0.10);
    --auth-card-shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 32px 64px -24px rgba(0, 0, 0, 0.65);
    --auth-focus: #6EA0FF;
  }
}

/* ===================== Stage ===================== */
.auth-stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  isolation: isolate;
  background: var(--auth-bg);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--auth-text);
}
.auth-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, var(--auth-bg-grid) 1px, transparent 0);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 38%, black 0%, transparent 78%);
  pointer-events: none;
  z-index: -2;
}
.auth-pings { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.auth-ping {
  position: absolute;
  top: 16%; left: 82%;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1px solid var(--auth-signal);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
  animation: auth-pingwave 6s cubic-bezier(.2, .6, .3, 1) infinite;
}
.auth-ping.b { top: 78%; left: 10%; animation-delay: 2s; border-color: var(--auth-amber); }
.auth-ping.c { top: 55%; left: 92%; animation-delay: 4s; }
@keyframes auth-pingwave {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  12% { opacity: 0.5; }
  70%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(18); }
}
@media (prefers-reduced-motion: reduce) { .auth-ping { animation: none; opacity: 0; } }

.auth-frame { width: 100%; max-width: 408px; display: flex; flex-direction: column; align-items: center; gap: 22px; }

.auth-wordmark {
  display: flex; align-items: baseline; gap: 2px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 20px; letter-spacing: -0.01em;
}
.auth-wordmark .z { color: var(--auth-signal); }

/* ===================== Card ===================== */
.auth-card {
  position: relative;
  width: 100%;
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  box-shadow: var(--auth-card-shadow);
  clip-path: polygon(0 22px, 22px 0, 100% 0, 100% 100%, 0 100%);
}
.auth-card::before {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 22px; height: 22px;
  background: var(--auth-bg);
  clip-path: polygon(0 0, 22px 0, 0 22px);
}
.auth-card::after {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 31px; height: 1px;
  background: var(--auth-border);
  transform: translate(0px, 21.5px) rotate(-45deg);
  transform-origin: 0 0;
}
.auth-cardhead { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 22px 0 22px; }
.auth-signalmeter { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.auth-signalmeter i {
  display: block; width: 3px; background: var(--auth-text-faint); border-radius: 1px;
  animation: auth-bar 2.6s ease-in-out infinite;
}
.auth-signalmeter i:nth-child(1) { height: 4px; animation-delay: 0s; }
.auth-signalmeter i:nth-child(2) { height: 7px; animation-delay: .15s; background: var(--auth-signal); }
.auth-signalmeter i:nth-child(3) { height: 10px; animation-delay: .3s; background: var(--auth-signal); }
.auth-signalmeter i:nth-child(4) { height: 12px; animation-delay: .45s; background: var(--auth-signal); }
@keyframes auth-bar { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .auth-signalmeter i { animation: none; opacity: .85; } }

.auth-cardbody { padding: 8px 32px 32px 32px; }
@media (max-width: 460px) { .auth-cardbody { padding: 8px 22px 26px 22px; } }

.auth-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--auth-signal);
}
.auth-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 26px; letter-spacing: -0.01em;
  margin: 8px 0 0 0;
  text-wrap: balance;
}
@media (max-width: 460px) { .auth-heading { font-size: 23px; } }
.auth-sub { color: var(--auth-text-muted); font-size: 14px; margin: 8px 0 0 0; line-height: 1.55; max-width: 34ch; }

.auth-form { margin-top: 26px; display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 7px; }
.auth-field label { font-size: 12.5px; font-weight: 500; color: var(--auth-text-muted); }
.auth-inputwrap { position: relative; display: flex; align-items: center; }
.auth-inputwrap input {
  width: 100%;
  height: auto;
  background: var(--auth-surface-2);
  border: 1px solid var(--auth-surface-2-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14.5px;
  line-height: 1.4;
  font-family: inherit;
  color: var(--auth-text);
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.auth-inputwrap input::placeholder { color: var(--auth-text-faint); }
.auth-inputwrap input:focus-visible {
  border-color: var(--auth-focus);
  background: var(--auth-surface);
  box-shadow: 0 0 0 3px rgba(44, 111, 224, 0.18);
}
.auth-eyebtn {
  position: absolute; right: 6px;
  width: 30px; height: 30px;
  border: 0; background: transparent; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--auth-text-faint); cursor: pointer;
}
.auth-eyebtn:hover { color: var(--auth-text); background: var(--auth-border); }
.auth-eyebtn svg { width: 17px; height: 17px; }

.auth-strength { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.auth-strength .bars { display: flex; gap: 4px; flex: 1; }
.auth-strength .bars span { height: 3px; flex: 1; border-radius: 2px; background: var(--auth-border); transition: background .2s ease; }
.auth-strength .label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--auth-text-faint); min-width: 62px; text-align: right;
}

.auth-row-between { display: flex; align-items: center; justify-content: space-between; margin-top: -2px; }
.auth-linklike {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-size: 13px; font-family: inherit; color: var(--auth-text-muted); text-decoration: none;
}
.auth-linklike:hover { color: var(--auth-text); }

.auth-sendwrap { margin-top: 6px; }
.auth-sendbtn {
  width: 100%; border: 0; border-radius: 10px;
  background: var(--auth-text); color: var(--auth-surface);
  padding: 13px 16px; font-size: 14.5px; font-weight: 600; font-family: inherit;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  transition: transform .12s ease, background .2s ease, opacity .2s ease;
}
.auth-sendbtn:hover { transform: translateY(-1px); }
.auth-sendbtn:active { transform: translateY(0); }
.auth-sendbtn:disabled { opacity: .72; cursor: default; transform: none; }
.auth-sendbtn svg { width: 15px; height: 15px; }
.auth-sendbtn.is-sent { background: var(--auth-signal); }

.auth-ticktrack { margin-top: 14px; display: none; align-items: center; gap: 10px; }
.auth-ticktrack.show { display: flex; }
.auth-tickline { position: relative; flex: 1; height: 2px; background: var(--auth-border); border-radius: 2px; overflow: hidden; }
.auth-tickline i { position: absolute; inset: 0 100% 0 0; background: var(--auth-signal); animation: auth-fillline 1.4s ease forwards; }
@keyframes auth-fillline { to { inset: 0 0 0 0; } }
.auth-tickstatus {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--auth-text-faint);
  white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.auth-tickstatus .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--auth-text-faint); }
.auth-tickstatus.ok { color: var(--auth-signal); }
.auth-tickstatus.ok .dot { background: var(--auth-signal); }

.auth-successbox {
  display: none; margin-top: 18px; padding: 13px 14px; border-radius: 10px;
  background: var(--auth-signal-soft);
  border: 1px solid rgba(30, 158, 107, 0.35);
  align-items: center; gap: 10px;
}
.auth-successbox.show { display: flex; }
.auth-successbox svg { width: 17px; height: 17px; color: var(--auth-signal); flex: none; }
.auth-successbox p { font-size: 13px; color: var(--auth-text); margin: 0; }
.auth-successbox strong { color: var(--auth-signal); }

.auth-footlinks {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--auth-border);
  display: flex; align-items: center; justify-content: space-between; font-size: 13px;
}
.auth-footlinks.center { justify-content: center; }
.auth-footlinks a { text-decoration: none; color: var(--auth-text-muted); }
.auth-footlinks a:hover { color: var(--auth-text); }

.auth-helprow {
  width: 100%; max-width: 408px;
  display: flex; align-items: center; justify-content: center; gap: 18px;
  font-size: 12.5px; color: var(--auth-text-faint);
}
.auth-helprow a { color: var(--auth-text-faint); text-decoration: none; display: flex; align-items: center; gap: 6px; }
.auth-helprow a:hover { color: var(--auth-text-muted); }
.auth-helprow svg { width: 13px; height: 13px; }

.auth-trust {
  margin-top: 4px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 0.04em;
  color: var(--auth-text-faint);
}
.auth-trust svg { width: 11px; height: 11px; }

.auth-stage input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--auth-surface-2) inset;
  -webkit-text-fill-color: var(--auth-text);
}
