/* ILYGO Monitoring — Styles des pages d'auth (login, signup, forgot, reset, verify).
   Reutilise les CSS variables de marketing/styles.css (palette, fonts).
   Inclure dans cet ordre :
     <link rel="stylesheet" href="/marketing/styles.css">
     <link rel="stylesheet" href="/marketing/auth.css">

   UX-026 : meme look-and-feel que le site marketing (dark/light auto). */

/* ── Layout : header fin + box centree ──────────────────────────────────── */
.auth-body {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, var(--accent-glow), transparent 60%),
    var(--bg);
  min-height: 100vh;
  display: flex; flex-direction: column;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  margin: 0;
}

.auth-header {
  padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1200px; width: 100%; margin: 0 auto;
}
.auth-header .logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 700; color: var(--text);
  text-decoration: none;
}
.auth-header .logo:hover { color: var(--text); }
.auth-header .logo-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.auth-main {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px 48px;
}

/* ── Carte centrale ─────────────────────────────────────────────────────── */
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%; max-width: 420px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
}
.auth-card-wide { max-width: 520px; }

.auth-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 6px;
  color: var(--text);
  letter-spacing: -0.4px;
}
.auth-subtitle {
  font-size: 13px;
  color: var(--text2);
  text-align: center;
  margin: 0 0 24px;
  line-height: 1.55;
}

/* ── Formulaires ────────────────────────────────────────────────────────── */
.auth-field { margin-bottom: 14px; }
.auth-field label {
  display: block;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text2);
  margin-bottom: 6px;
}
.auth-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  padding: 11px 13px;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-input::placeholder { color: var(--text3); }
.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Boutons ────────────────────────────────────────────────────────────── */
.auth-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%;
  background: var(--accent); color: #fff;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, transform .08s, box-shadow .15s;
}
.auth-btn:hover { background: var(--accent-hover); box-shadow: 0 6px 20px var(--accent-glow); }
.auth-btn:active { transform: scale(.98); }
.auth-btn:disabled { opacity: .6; cursor: not-allowed; }

.auth-btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border2);
}
.auth-btn-ghost:hover {
  background: var(--surface2);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: none;
}

/* ── Messages d'alerte ──────────────────────────────────────────────────── */
.auth-msg {
  display: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
  text-align: center;
  line-height: 1.45;
}
.auth-msg.is-visible { display: block; }
.auth-msg.is-error {
  background: color-mix(in srgb, var(--error) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--error) 40%, transparent);
  color: var(--error);
}
.auth-msg.is-success {
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent);
  color: var(--ok);
}

/* Compat browsers qui ne supportent pas color-mix : fallback */
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .auth-msg.is-error { background: rgba(239,68,68,.10); border-color: rgba(239,68,68,.40); }
  .auth-msg.is-success { background: rgba(16,185,129,.10); border-color: rgba(16,185,129,.40); }
}

/* ── Divers ─────────────────────────────────────────────────────────────── */
.auth-divider {
  text-align: center;
  color: var(--text3);
  font-size: 12px;
  margin: 18px 0 12px;
  display: flex; align-items: center; gap: 10px;
}
.auth-divider::before,
.auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

.auth-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color .15s;
}
.auth-link:hover { color: var(--accent-hover); }

.auth-link-row {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--text2);
}

.auth-footer-link {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text2);
}

.auth-strength {
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  margin: 6px 0 10px;
  overflow: hidden;
}
.auth-strength-bar {
  height: 100%; width: 0;
  background: var(--error);
  transition: width .2s ease, background .2s ease;
}

.auth-hint {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 14px;
}

/* Selecteur de langue compact en haut de la carte */
.auth-lang-row {
  display: flex; justify-content: center;
  margin: 4px 0 18px;
}
.auth-lang-switcher {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 6px 26px 6px 12px;
  border-radius: 8px;
  font-size: 12px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path fill='%2394a3b8' d='M6 8 0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 8px;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-card { padding: 28px 22px; }
  .auth-title { font-size: 20px; }
}

/* ── Signup multi-etapes ────────────────────────────────────────────────── */
.auth-step-indicator {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 20px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text3);
}
.auth-step { display: flex; align-items: center; gap: 6px; }
.auth-step.is-active { color: var(--accent); }
.auth-step.is-done { color: var(--ok); }
.auth-step-num {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 11px;
}
.auth-step.is-active .auth-step-num {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.auth-step.is-done .auth-step-num {
  background: var(--ok); color: #fff; border-color: var(--ok);
}
.auth-step-line {
  width: 30px; height: 1px; background: var(--border);
}

.auth-step-section { display: none; }
.auth-step-section.is-active { display: block; }

.auth-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.auth-row .auth-field { margin-bottom: 14px; }
@media (max-width: 480px) {
  .auth-row { grid-template-columns: 1fr; gap: 0; }
}

.auth-btn-row {
  display: grid; grid-template-columns: auto 1fr; gap: 8px;
  margin-top: 6px;
}

/* Badge "plan pre-selectionne" en haut du signup */
.auth-plan-banner {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px;
  margin-bottom: 14px;
  text-align: center;
}
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .auth-plan-banner {
    background: rgba(59,130,246,.10); border-color: rgba(59,130,246,.30);
  }
}

/* Indication d'asterisque champ obligatoire */
.auth-req { color: var(--error); font-weight: 700; margin-left: 2px; }

/* Petit pied de page "trust" sous le bouton primary (signup) */
.auth-trust {
  font-size: 11px;
  color: var(--text3);
  text-align: center;
  margin-top: 16px;
  line-height: 1.6;
}
.auth-trust span::before { content: '✓ '; color: var(--ok); }

.auth-skip-link {
  display: block; text-align: center;
  color: var(--text3); font-size: 12px;
  text-decoration: none; margin-top: 8px;
}
.auth-skip-link:hover { color: var(--text2); }

/* Password strength meter (utilise sur signup ET reset) */
.auth-pwd-meter-bar {
  height: 4px; background: var(--surface2);
  border-radius: 3px; overflow: hidden;
}
.auth-pwd-meter-fill {
  height: 100%; width: 0;
  background: var(--error);
  transition: width .25s, background-color .25s;
}
.auth-pwd-meter-label {
  font-size: 11px; margin-top: 4px;
  color: var(--text2);
}
.auth-pwd-match { font-weight: 600; }
.auth-pwd-match.is-ok { color: var(--ok); }
