/* ============================================================
   Page de connexion / comptes — UNIPOP (espace cours) — Hérens
   Design modernisé. Seules les variables de marque (:root)
   changent d'une région à l'autre.
   ============================================================ */

:root {
  --brand:        #972730;
  --brand-hover:  #7d1f25;

  --text:         #1f2937;
  --text-muted:   #6b7280;
  --bg:           #f1f1f1;
  --surface:      #ffffff;
  --border:       #e5e7eb;

  --radius:       14px;
  --radius-sm:    9px;
  --shadow:       0 10px 30px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  --focus-ring:   0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}

* { box-sizing: border-box; }

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1100px 560px at 50% -12%,
      color-mix(in srgb, var(--brand) 12%, transparent), transparent),
    var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 24px;
}

/* ── Cartes (300 px = connexion, 440 px = formulaires compte) ── */
.login-container,
.login-container2 {
  width: 100%;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  animation: card-in 0.4s ease both;
}
.login-container  { max-width: 360px; }
.login-container2 { max-width: 440px; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ── En-tête de marque (plein cadre) ────────────────────── */
.login-container header,
.login-container2 header {
  text-align: center;
  margin: -32px -32px 24px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-hover));
  color: #fff;
  padding: 26px 20px 20px;
}

.login-container header .logo,
.login-container2 header .logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  padding: 8px;
  margin-bottom: 10px;
}

.login-container header h3,
.login-container2 header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  opacity: 0.9;
}

.login-container header h1,
.login-container2 header h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 4px 0 0;
  letter-spacing: 0.2px;
}

.login-container header p,
.login-container2 header p {
  margin: 2px 0 0;
  padding: 0;
  font-size: 13px;
  opacity: 0.9;
  text-align: center;
}

/* ── Titres de section ──────────────────────────────────── */
.login-container h2,
.login-container2 h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 18px;
  text-align: center;
  color: var(--text);
}

/* ── Champs ─────────────────────────────────────────────── */
.login-container input[type="text"],
.login-container input[type="password"],
.login-container input[type="email"],
.login-container input[type="number"],
.login-container2 input[type="text"],
.login-container2 input[type="password"],
.login-container2 input[type="email"],
.login-container2 input[type="number"],
.login-container2 select {
  width: 100%;
  max-width: none;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: #fff;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-container input:focus,
.login-container2 input:focus,
.login-container2 select:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.login-container input::placeholder,
.login-container2 input::placeholder { color: var(--text-muted); }

/* ── Mot de passe + œil ─────────────────────────────────── */
.login-container .password-container,
.login-container2 .password-container {
  position: relative;
}

.login-container .password-toggle-icon,
.login-container2 .password-toggle-icon {
  position: absolute;
  top: 21px;
  right: 12px;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.login-container .password-toggle-icon:hover,
.login-container2 .password-toggle-icon:hover { color: var(--brand); }

/* ── Libellés de formulaire ─────────────────────────────── */
.login-container2 label {
  display: block;
  margin-bottom: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

/* ── Groupe radio en pilules segmentées ─────────────────── */
.radio-group {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

input[type="radio"] { display: none; }

input[type="radio"] + label {
  flex: 1;
  text-align: center;
  padding: 10px 12px;
  background-color: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

input[type="radio"]:checked + label {
  background-color: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ── Bouton ─────────────────────────────────────────────── */
.login-container button,
.login-container2 button {
  width: 100%;
  padding: 12px;
  margin-top: 4px;
  background: linear-gradient(135deg, var(--brand), var(--brand-hover));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.login-container button:hover,
.login-container2 button:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 35%, transparent);
  transform: translateY(-1px);
}

.login-container button:active,
.login-container2 button:active { transform: translateY(0); }

/* ── Liens ──────────────────────────────────────────────── */
p {
  margin: 0;
  padding: 0;
  text-align: center;
}

a {
  font-size: 13px;
  text-decoration: none;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
a:hover { color: var(--brand); }

.link a { font-size: 14px; color: var(--text-muted); }
.link a:hover { color: var(--brand); }

.annonce a { font-size: 13px; color: var(--brand); font-weight: 500; }
.annonce a:hover { color: var(--brand-hover); }

/* ── Aide « Comment s'inscrire » : déclencheur + panneau ── */

/* Encart-bouton mis en évidence sous « Connexion » */
.help-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0 0 18px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--brand) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--border));
  border-radius: var(--radius-sm);
  color: var(--brand);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.help-trigger:hover {
  background: color-mix(in srgb, var(--brand) 14%, #fff);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 18%, transparent);
  transform: translateY(-1px);
}
.help-trigger > span { flex: 1; }
.help-trigger .help-trigger-icon { font-size: 18px; }
.help-trigger-arrow { font-size: 12px; transition: transform 0.15s ease; }
.help-trigger:hover .help-trigger-arrow { transform: translateX(3px); }

/* Voile sombre derrière le panneau */
.help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1000;
}
.help-overlay.visible { opacity: 1; }

/* Panneau latéral glissant depuis la droite */
.help-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 90vw;
  background: var(--surface);
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.18);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1001;
  display: flex;
  flex-direction: column;
}
.help-panel.open { transform: translateX(0); }

.help-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px;
  background: linear-gradient(135deg, var(--brand), var(--brand-hover));
  color: #fff;
  flex-shrink: 0;
}
.help-panel-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}
.help-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.help-close:hover { background: rgba(255, 255, 255, 0.32); }

.help-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
}

.help-panel-intro {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: left;
}

/* Étapes numérotées reliées par un filet */
.help-steps {
  list-style: none;
  counter-reset: step;
  margin: 0 0 22px;
  padding: 0;
}
.help-steps li {
  position: relative;
  counter-increment: step;
  padding: 0 0 20px 48px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  text-align: left;
}
.help-steps li:last-child { padding-bottom: 0; }
.help-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-hover));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.help-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 36px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

/* Bouton d'action « Créer un compte » dans le panneau */
.help-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-hover));
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.12s ease;
}
.help-cta:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  color: #fff;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .login-container,
  .login-container2 {
    padding: 24px;
    max-width: 100%;
  }
  .login-container header,
  .login-container2 header {
    margin: -24px -24px 20px;
    padding: 22px 16px 16px;
  }
  .help-panel { width: 100%; max-width: 100%; }
}
