/* ==========================================================================
   MODALES & FORMULAIRES
   Modal d'authentification, formulaires, membre gate
   ========================================================================== */

/* ── Overlay modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
  animation: fadeInBg .2s ease;
}

@keyframes fadeInBg { from { opacity: 0; } to { opacity: 1; } }

/* ── Fenêtre modale ── */
.modal {
  background: var(--forest);
  border-radius: 22px;
  width: 100%;
  max-width: 440px;
  padding: 36px;
  position: relative;
  animation: modalIn .25s ease;
  border: 1px solid rgba(255,255,255,.1);
}

@keyframes modalIn {
  from { transform: scale(.93); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .22s;
  border: none;
}

.modal-close:hover { background: rgba(255,255,255,.2); }

/* Onglets de la modale */
.modal-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  background: rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 4px;
}

.modal-tab {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  transition: all .22s;
  border: none;
  background: none;
  font-family: inherit;
}

.modal-tab.active {
  background: rgba(255,255,255,.15);
  color: var(--white);
}

.modal-pane        { display: none; }
.modal-pane.active { display: block; }

/* En-tête de la modale */
.modal-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-accent-lt);
  margin-bottom: 6px;
}

.modal h3 {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: 1px;
  color: var(--white);
  margin-bottom: 6px;
}

.modal-sub {
  font-size: 13px;
  color: rgba(255,255,255,.6);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* Avantages membres */
.modal-perks {
  background: rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
}

.modal-perk {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: rgba(255,255,255,.8);
  padding: 4px 0;
}

.modal-perk svg { color: var(--lime-dark); flex-shrink: 0; width: 14px; height: 14px; }

/* ── Champs de formulaire ── */
.form-field { margin-bottom: 13px; }

.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.6);
  margin-bottom: 5px;
}

.form-field input {
  width: 100%;
  padding: 10px 13px;
  border-radius: 9px;
  border: 1.5px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08);
  font-size: 14px;
  color: var(--white);
  outline: none;
  transition: border-color .22s;
}

.form-field input::placeholder { color: rgba(255,255,255,.3); }
.form-field input:focus         { border-color: var(--color-accent-lt); background: rgba(255,255,255,.12); }

.form-check {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.form-check input          { width: auto; margin-top: 3px; accent-color: var(--color-accent-lt); }
.form-check label          { font-size: 12px; color: rgba(255,255,255,.65); font-weight: 400; line-height: 1.5; }
.form-check label a        { color: var(--color-accent-lt); text-decoration: underline; }

/* Messages d'état */
.modal-msg {
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 13px;
  margin-bottom: 14px;
}

.modal-msg.error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.modal-msg.success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

.form-forgot {
  font-size: 12px;
  color: var(--lime-dark);
  font-weight: 600;
  cursor: pointer;
  display: block;
  text-align: right;
  margin-top: -4px;
  margin-bottom: 14px;
  background: none;
  border: none;
  font-family: inherit;
}

/* Spinner de chargement */
.modal-spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Portail membre ── */
.member-gate {
  background: var(--chalk);
  border: 2px dashed var(--smoke);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
}

.member-gate h3 {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 1px;
  color: var(--forest);
  margin-bottom: 8px;
}

.member-gate p        { font-size: 15px; color: var(--ink-soft); margin-bottom: 22px; }
.member-gate-icon     { font-size: 38px; margin-bottom: 16px; }
