/* ============================================================
   B-SMS — Page de connexion (templates/auth/login.html.twig)
   Page autonome (n'étend pas base.html.twig).
   Une seule carte compacte (marque + formulaire) centrée sur un
   fond clair — thème clair fixe et volontaire, pas d'adaptation
   automatique au mode sombre du système (contraste garanti).
   ============================================================ */

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

/* ── Tokens (thème clair unique) ──────────────────── */
:root {
  --brand: #2DC9A3;
  --brand-hov: #1DAF8B;
  --brand-glow: rgba(45, 201, 163, 0.25);
  --panel: #F3FAF8;
  --ptxt: #1B2A41;
  --pmuted: rgba(27, 42, 65, 0.58);
  --pborder: rgba(27, 42, 65, 0.08);

  --surface: #FFFFFF;
  --text: #0F172A;
  --text-sub: #56657B;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --input-bg: #F8FAFC;
  --focus-ring: rgba(45, 201, 163, 0.18);

  --radius: 11px;
  --font: 'Lucida Sans', 'Lucida Sans Unicode', sans-serif;
  --transition: 0.17s ease;
}

/* ── Base ───────────────────────────────────────── */
html,
body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(160deg, #F3FAF8 0%, #EEF3F9 100%);
}

/* ── Shell : une seule carte compacte ─────────────── */
.shell {
  display: grid;
  grid-template-columns: 52fr 48fr;
  width: 100%;
  max-width: 980px;
  height: min(600px, 92vh);
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface);
  box-shadow:
    0 30px 70px -24px rgba(20, 30, 48, 0.28),
    0 8px 24px -8px rgba(20, 30, 48, 0.1);
}

/* ══════════════════════════════════════════════════
   BRAND PANEL (gauche)
══════════════════════════════════════════════════ */
.brand {
  position: relative;
  background: linear-gradient(160deg, #F6FDFB 0%, var(--panel) 55%, #F2F8FC 100%);
  display: flex;
  flex-direction: column;
  padding: 2rem 2.5rem;
  overflow: hidden;
  height: 100%;
}

/* Trait en haut */
.brand::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand) 0%, rgba(45, 201, 163, 0) 80%);
}

/* ── Logo ── */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  position: relative;
  z-index: 1;
}

.brand-logo img {
  height: 156px;
  width: auto;
  object-fit: contain;
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ptxt);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-name small {
  display: block;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pmuted);
  margin-top: 3px;
}

/* ── Headline ── */
.brand-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.25rem 0;
  position: relative;
  z-index: 1;
  min-height: 0;
}

.brand-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 1rem;
}

.brand-eyebrow::before {
  content: '';
  display: block;
  width: 18px;
  height: 2px;
  background: var(--brand);
  border-radius: 2px;
}

.brand-h1 {
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ptxt);
  text-wrap: balance;
  margin-bottom: 1rem;
}

.brand-h1 em {
  font-style: normal;
  color: var(--brand);
}

.brand-desc {
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--pmuted);
  max-width: 26rem;
}

/* ── Feature pills ── */
.pills {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  border: 1px solid var(--pborder);
  background: rgba(255, 255, 255, 0.65);
  border-radius: 100px;
  padding: 0.4rem 0.8rem;
  width: fit-content;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--pmuted);
  box-shadow: 0 1px 2px rgba(27, 42, 65, 0.04);
}

.pill-dot {
  width: 6px;
  height: 6px;
  background: var(--brand);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Footer ── */
.brand-footer {
  font-size: 0.68rem;
  color: var(--pmuted);
  position: relative;
  z-index: 1;
}

/* ── Signal art (concentric rings) ── */
.signal {
  position: absolute;
  bottom: 2rem;
  right: 2.5rem;
  width: 0;
  height: 0;
  pointer-events: none;
}

.signal-ring,
.signal-dot {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
}

.signal-dot {
  width: 9px;
  height: 9px;
  background: var(--brand);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--brand), 0 0 22px rgba(45, 201, 163, 0.45);
}

.signal-ring {
  border-radius: 50%;
  border-style: solid;
  border-color: var(--brand);
}

.signal-ring:nth-child(1) {
  width: 2.75rem;
  height: 2.75rem;
  border-width: 1.5px;
  opacity: 0.7;
}

.signal-ring:nth-child(2) {
  width: 6rem;
  height: 6rem;
  border-width: 1px;
  opacity: 0.38;
}

.signal-ring:nth-child(3) {
  width: 10.5rem;
  height: 10.5rem;
  border-width: 1px;
  opacity: 0.18;
}

.signal-ring:nth-child(4) {
  width: 16rem;
  height: 16rem;
  border-width: 1px;
  opacity: 0.08;
}

/* subtle diagonal top-right glow */
.brand-glow {
  position: absolute;
  top: -6rem;
  right: -6rem;
  width: 20rem;
  height: 20rem;
  background: radial-gradient(circle, rgba(45, 201, 163, 0.16) 0%, transparent 70%);
  pointer-events: none;
}

/* ══════════════════════════════════════════════════
   FORM PANEL (droite)
══════════════════════════════════════════════════ */
.form-panel {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 2.75rem;
  position: relative;
  height: 100%;
  overflow: hidden;
}

/* Séparateur vertical très subtil entre les deux panneaux */
.form-panel::before {
  content: '';
  position: absolute;
  inset: 10% auto 10% 0;
  width: 1px;
  background: linear-gradient(180deg, transparent 0%, var(--border) 30%, var(--border) 70%, transparent 100%);
}

.form-inner {
  width: 100%;
  max-width: 320px;
  max-height: 100%;
  overflow-y: auto;
}

/* ── Header ── */
.form-header {
  margin-bottom: 1.5rem;
}

.form-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 0.4rem;
}

.form-header p {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.55;
}

/* ── Alerts ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  border-radius: 9px;
  padding: 0.7rem 0.9rem;
  font-size: 0.78rem;
  line-height: 1.5;
  margin-bottom: 1.1rem;
}

.alert svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-warn {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-left: 3px solid #F59E0B;
  color: #78350F;
}

.alert-error {
  background: #FFF5F5;
  border: 1px solid #FECACA;
  border-left: 3px solid #EF4444;
  color: #7F1D1D;
}

/* ── Form fields ── */
.field {
  margin-bottom: 0.95rem;
}

.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
  letter-spacing: 0.005em;
}

.field-wrap {
  position: relative;
}

.field-input {
  display: block;
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  -webkit-appearance: none;
}

.field-input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.field-input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.field-input.has-toggle {
  padding-right: 2.6rem;
}

.toggle-pw {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.toggle-pw:hover {
  color: var(--text);
}

/* ── Meta row ── */
.form-meta {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.1rem;
}

.form-meta-center {
  justify-content: center;
  margin-top: 1rem;
}

.forgot {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--brand);
  text-decoration: none;
  transition: opacity var(--transition);
}

.forgot:hover {
  opacity: 0.75;
}

/* ── Submit button ── */
.btn-login {
  display: block;
  width: 100%;
  padding: 0.78rem 1.1rem;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background var(--transition), box-shadow var(--transition), transform 0.1s;
}

.btn-login:hover {
  background: var(--brand-hov);
  box-shadow: 0 4px 18px var(--brand-glow);
}

.btn-login:active {
  transform: scale(0.985);
}

.btn-login:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 800px) {

  html,
  body {
    overflow: auto;
    display: block;
    padding: 0;
  }

  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    max-width: none;
    width: 100%;
    height: auto;
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }

  .brand {
    height: auto;
    padding: 1.75rem 1.75rem 2rem;
  }

  .brand-logo img {
    height: 64px;
  }

  .brand-body {
    padding: 1.5rem 0;
  }

  .pills {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .brand-footer {
    display: none;
  }

  .signal {
    opacity: 0.4;
  }

  .form-panel {
    height: auto;
    overflow: visible;
    padding: 2.5rem 1.75rem;
  }

  .form-panel::before {
    display: none;
  }

  .form-inner {
    max-height: none;
    overflow-y: visible;
    max-width: 380px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}