/* ──────────────────────────────────────────────────────────────────────────
   Portail Veuzain-sur-Loire — Inscription ALSH & Admin ALSH
   Styles complémentaires — variables/reset/base dans main.css
   ────────────────────────────────────────────────────────────────────────── */

/* ── Variables supplémentaires (absent ou alias de main.css) ────────────── */
:root {
  --slate-50:    #F8FAFC;
  --slate-100:   var(--gray-100);
  --slate-200:   #E2E8F0;
  --slate-300:   var(--gray-200);
  --slate-500:   var(--gray-600);
  --slate-700:   var(--gray-800);
  --slate-900:   var(--gray-800);
  --red:         #DC2626;
  --red-light:   #FEE2E2;
  --amber:       #B45309;
  --amber-light: #FEF3C7;
  --blue-mid:    var(--blue);
  --radius-sm:   4px;
  --radius-lg:   var(--radius);
  --shadow-sm:   0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   var(--shadow);
  --focus:       0 0 0 3px rgba(61,191,191,.30);
  --font-heading: var(--font);
}

/* ── Container formulaire ──────────────────────────────────────────────── */
.container {
  max-width: 760px;
  margin: 36px auto;
  padding: 0 20px;
}

/* ── Alerts ────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: .95rem;
  border: 1px solid;
}
.alert::before { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.alert-error   { background: var(--red-light);   border-color: #fca5a5; color: #7f1d1d; }
.alert-error::before { content: "⚠️"; }
.alert-success { background: var(--green-light); border-color: #86efac; color: #14532d; }
.alert-success::before { content: "✓"; color: var(--green); font-weight: 900; }
.alert-info    { background: #eff6ff; border-color: #93c5fd; color: #1e3a5f; }
.alert-info::before { content: "ℹ"; color: var(--blue); font-weight: 900; }
.alert-warning { background: var(--amber-light); border-color: #fcd34d; color: #78350f; }
.alert-warning::before { content: "⚠"; color: var(--amber); }

/* ── Barre de progression ──────────────────────────────────────────────── */
nav[aria-label="Progression du formulaire"] { margin-bottom: 32px; }
.progress-steps {
  display: flex;
  list-style: none;
  gap: 0;
  position: relative;
}
.progress-steps::before {
  content: '';
  position: absolute;
  top: 18px; left: 18px; right: 18px;
  height: 2px;
  background: var(--gray-200);
  z-index: 0;
}
.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
  font-size: .72rem;
  color: var(--gray-600);
  text-align: center;
}
.step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--gray-200);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; color: var(--gray-600);
  transition: all .2s;
}
.step-done .step-num  { background: var(--green); border-color: var(--green); color: #fff; }
.step-done .step-num::after { content: "✓"; }
.step-done .step-num span { display: none; }
.step-current .step-num {
  background: var(--blue); border-color: var(--blue); color: #fff;
  box-shadow: 0 0 0 4px var(--blue-light);
}
.step-current { color: var(--blue-dark); font-weight: 600; }
.step-label { line-height: 1.2; }

/* ── Carte de formulaire ───────────────────────────────────────────────── */
.form-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 24px;
}
.form-card-header {
  background: var(--blue-dark);
  border-bottom: 3px solid var(--blue);
  color: #fff;
  padding: 18px 28px;
}
.form-card-header h1 { font-size: 1.2rem; font-weight: 700; color: #fff; margin: 0; }
.form-card-header p  { font-size: .875rem; opacity: .85; margin-top: 4px; }
.form-card-body { padding: 28px; }

/* ── Fieldsets ─────────────────────────────────────────────────────────── */
fieldset { border: none; padding: 0; margin: 0 0 28px 0; }
fieldset > legend {
  font-weight: 700;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-600);
  padding: 0 0 12px 0;
  width: 100%;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 20px;
}
fieldset fieldset {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 0;
}
fieldset fieldset > legend {
  font-size: .9rem; font-weight: 600; text-transform: none;
  letter-spacing: 0; color: var(--gray-800);
  padding: 0 8px; border: none; margin-bottom: 10px; width: auto;
}

/* ── Champs ────────────────────────────────────────────────────────────── */
.field { margin-bottom: 20px; }
.field label {
  display: block; font-size: .9rem; font-weight: 600;
  color: var(--gray-800); margin-bottom: 6px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row .field { margin-bottom: 0; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="search"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .95rem;
  font-family: var(--font);
  color: var(--gray-800);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: var(--focus);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
textarea { resize: vertical; min-height: 90px; }
input[type="file"] {
  padding: 8px 12px; background: var(--gray-100);
  cursor: pointer; font-size: .875rem;
}
input[type="date"] { cursor: pointer; }

.field-error input,
.field-error select,
.field-error textarea  { border-color: var(--red); }
.field-error-msg {
  display: flex; gap: 6px; align-items: center;
  color: var(--red); font-size: .8rem; font-weight: 600; margin-top: 6px;
}
.field-hint { color: var(--gray-600); font-size: .8rem; margin-top: 5px; line-height: 1.4; }

/* ── Radios & Checkboxes pill ──────────────────────────────────────────── */
.radio-group,
.checkbox-group { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

.radio-label,
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: 20px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 500;
  color: var(--gray-800);
  background: #fff;
  transition: all .15s;
  user-select: none;
}
.radio-label:hover,
.checkbox-label:hover { border-color: var(--blue); background: var(--blue-light); color: var(--blue-dark); }

.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--blue); }

.radio-label:has(input:checked),
.checkbox-label:has(input:checked) {
  border-color: var(--blue); background: var(--blue-light);
  color: var(--blue-dark); font-weight: 600;
}
.field-oui-non fieldset { border: none; padding: 4px 0; margin: 0; }

/* ── Toggle quotient familial (étape 1) ────────────────────────────────── */
.qf-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 4px;
}
.qf-opt { position: relative; }
.qf-opt input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.qf-label {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 18px; border: 2px solid var(--gray-200); border-radius: var(--radius);
  cursor: pointer; transition: border-color .2s, background .2s; height: 100%;
}
.qf-opt input:checked + .qf-label {
  border-color: var(--blue); background: var(--blue-light);
}
.qf-label:hover { border-color: var(--blue); }
.qf-title { font-size: .9rem; font-weight: 700; color: var(--gray-800); }
.qf-desc  { font-size: .78rem; color: var(--gray-600); line-height: 1.4; }
.qf-opt input:checked + .qf-label .qf-title { color: var(--blue-dark); }
.qf-opt input:checked + .qf-label .qf-desc  { color: var(--blue-dark); opacity: .8; }

.qf-panel { display: none; margin-top: 4px; }

@media (max-width: 600px) {
  .qf-toggle { grid-template-columns: 1fr; }
}

/* ── Boutons supplémentaires (absents de main.css) ─────────────────────── */
.btn-ghost {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1.5px solid var(--gray-200);
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: transparent;
  color: var(--gray-600);
  transition: all .15s;
}
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); text-decoration: none; }

.btn-large { font-size: 1.05rem; padding: 14px 28px; }
.btn-sm    { font-size: .8rem;   padding: 6px 14px;  border-radius: 6px; }
.btn-block { width: 100%; text-align: center; }

.btn-success            { background: var(--green); color: #fff; border: none; }
.btn-success:hover      { filter: brightness(1.08); }

/* Override main.css btn-danger (light) → plein rouge pour actions destructives */
.btn.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn.btn-danger:hover { background: #b91c1c; filter: none; }

/* ── Actions du formulaire ─────────────────────────────────────────────── */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-100);
  flex-wrap: wrap;
}
.required-note { font-size: .78rem; color: var(--gray-600); margin-top: 12px; }

/* ── Page d'accueil inscription ────────────────────────────────────────── */
.index-hero {
  background: var(--blue-dark);
  color: #fff;
  padding: 48px 24px;
  text-align: center;
}
.index-hero h1 { font-size: 2rem; color: #fff; margin-bottom: 8px; }
.index-hero p  { font-size: 1.05rem; opacity: .85; }
.index-body { max-width: 760px; margin: -1px auto 0; padding: 0 20px 40px; }

.info-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin: 28px 0;
}
.info-card h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-600);
  margin-bottom: 16px;
}
.checklist { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; align-items: flex-start; gap: 10px; font-size: .95rem; }
.checklist li::before {
  content: "✓";
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; min-width: 22px;
  background: var(--green-light); color: var(--green);
  border-radius: 50%; font-weight: 900; font-size: .75rem; margin-top: 1px;
}
.rgpd-card {
  background: var(--blue-light);
  border: 1px solid rgba(61,191,191,.3);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0;
  font-size: .875rem;
  color: var(--gray-600);
}
.rgpd-card h2 {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--blue-dark); margin-bottom: 8px;
}

/* ── Page de confirmation ──────────────────────────────────────────────── */
.confirmation-wrapper {
  min-height: 60vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.confirmation-box {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 48px 40px; text-align: center; max-width: 520px; width: 100%;
}
.confirmation-icon {
  width: 72px; height: 72px; background: var(--green-light); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin: 0 auto 24px;
}
.confirmation-box h1 { font-size: 1.5rem; margin-bottom: 12px; }
.confirmation-box p  { color: var(--gray-600); margin-bottom: 12px; }
.tel-block {
  background: var(--gray-100); border-radius: var(--radius);
  padding: 14px 20px; margin: 20px 0; font-size: .9rem;
}
.tel-block strong { display: block; margin-bottom: 4px; color: var(--gray-800); }

/* ── Admin — Layout ────────────────────────────────────────────────────── */
.admin-container { max-width: 1100px; margin: 0 auto; padding: 36px 24px 60px; }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; margin-bottom: 24px;
}
.page-header h1 { font-size: 1.35rem; color: var(--blue-dark); margin: 0; }
.page-actions   { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Admin — Filtres ───────────────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: #fff; padding: 14px 18px; border-radius: var(--radius);
  border: 1px solid var(--gray-200); box-shadow: var(--shadow); margin-bottom: 20px;
}
.filter-group { display: contents; }
.filter-bar input[type="search"],
.filter-bar select { width: auto; padding: 8px 12px; font-size: .875rem; }
.filter-bar input[type="search"] { min-width: 200px; }

/* ── Admin — Table ─────────────────────────────────────────────────────── */
.table-wrapper {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table thead { background: var(--gray-100); }
.admin-table th {
  text-align: left; padding: 12px 16px; font-size: .75rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--gray-600); border-bottom: 1px solid var(--gray-200);
}
.admin-table td {
  padding: 13px 16px; border-bottom: 1px solid var(--gray-100);
  font-size: .9rem; vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: var(--gray-100); }
.admin-table td a { color: var(--blue-dark); font-weight: 600; text-decoration: none; }
.admin-table td a:hover { text-decoration: underline; }
.actions { display: flex; gap: 6px; }

/* ── Statut badges ─────────────────────────────────────────────────────── */
.statut-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 12px; font-size: .75rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.statut-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.statut-recu    { background: #dbeafe; color: #1d4ed8; }
.statut-verifie { background: #fef9c3; color: #a16207; }
.statut-vise    { background: var(--green-light); color: #15803d; }

/* ── Admin — Détail ────────────────────────────────────────────────────── */
.detail-section {
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--gray-200); box-shadow: var(--shadow);
  overflow: hidden; margin-bottom: 16px;
}
.detail-section h2 {
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--gray-600); margin: 0;
  padding: 10px 20px; background: var(--gray-100); border-bottom: 1px solid var(--gray-200);
}
.detail-section h3 {
  font-size: .85rem; font-weight: 700; color: var(--gray-800);
  padding: 8px 20px 4px; margin: 0;
}
.detail-section dl,
.detail-section > p,
.detail-section > ul { padding: 8px 20px 12px; }

.detail-section .admin-table { box-shadow: none; border-radius: 0; border: none; }

.detail-row {
  display: grid; grid-template-columns: 160px 1fr;
  gap: 4px 12px; padding: 6px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: .9rem; align-items: start;
}
.detail-row:last-child { border-bottom: none; }
.detail-row dt  { color: var(--gray-600); font-weight: 500; }
.detail-row dd  { color: var(--gray-800); font-weight: 500; }
.detail-row dd.yes { color: var(--green); }
.detail-row dd.no  { color: var(--red); }

.sante-section { background: #fffbeb; border: 1px solid #fcd34d; }
.sante-section h2 { background: #fef3c7 !important; border-bottom-color: #fcd34d !important; color: #78350f !important; }

.statut-section {
  display: flex; align-items: center; gap: 16px;
  background: #fff; padding: 14px 20px;
  border-radius: var(--radius); border: 1px solid var(--gray-200);
  box-shadow: var(--shadow); margin-bottom: 20px; flex-wrap: wrap;
}
.inline-form { display: inline-flex; align-items: center; gap: 8px; }
.text-muted  { color: var(--gray-600); font-size: .875rem; }

/* ── Personnes habilitées ──────────────────────────────────────────────── */
.personne-bloc {
  background: var(--gray-100); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 20px; margin-bottom: 12px; position: relative;
}
.personne-bloc legend {
  font-size: .85rem; font-weight: 700; color: var(--gray-800);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 0; border: none; margin-bottom: 14px;
}
.btn-remove-personne {
  position: absolute; top: 16px; right: 16px;
  background: var(--red-light); border: none; border-radius: 50%;
  width: 28px; height: 28px; cursor: pointer; font-size: .85rem; color: var(--red);
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.btn-remove-personne:hover { background: #fca5a5; }
.btn-add-personne {
  width: 100%; padding: 12px; border: 2px dashed var(--gray-200);
  border-radius: var(--radius); background: transparent; color: var(--gray-600);
  font-size: .9rem; font-weight: 600; cursor: pointer; transition: all .15s; font-family: var(--font);
}
.btn-add-personne:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }

/* ── Divers ────────────────────────────────────────────────────────────── */
.form-intro { color: var(--gray-600); margin-bottom: 24px; font-size: .95rem; }
.recap-box {
  background: var(--blue-light); border: 1px solid rgba(61,191,191,.3);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px;
  font-size: .9rem; color: var(--blue-dark);
}
.empty-state { text-align: center; color: var(--gray-600); padding: 60px 24px; font-size: 1rem; }
.empty-state::before { content: "📭"; display: block; font-size: 2.5rem; margin-bottom: 12px; }

/* ── Pièces jointes ────────────────────────────────────────────────────── */
.pj-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .75rem; }
.pj-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; background: var(--gray-100); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: .75rem 1rem;
}
.pj-info { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.pj-label    { font-weight: 600; font-size: .9rem; color: var(--gray-800); }
.pj-filename { font-size: .8rem; color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-date     { font-size: .75rem; color: var(--gray-400); }

/* ── Modale de confirmation ────────────────────────────────────────────── */
.confirm-dialog {
  border: none; border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  padding: 2rem; max-width: 480px; width: 90%;
}
.confirm-dialog::backdrop { background: rgba(0,0,0,.45); }
.confirm-dialog h2 { margin-top: 0; font-size: 1.15rem; color: var(--gray-800); }
.confirm-dialog .danger-note {
  background: var(--red-light); border-left: 4px solid var(--red);
  padding: .6rem 1rem; border-radius: var(--radius-sm); font-size: .9rem; color: #7f1d1d;
}
.dialog-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* ── Barre démo ────────────────────────────────────────────────────────── */
.demo-bar { display: flex; justify-content: flex-end; margin-bottom: .75rem; }
.btn-demo {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem;
  font-weight: 600; padding: .3rem .85rem; background: var(--amber-light);
  color: #92400e; border: 1.5px dashed var(--amber); border-radius: 999px;
  cursor: pointer; letter-spacing: .01em; transition: background .15s; line-height: 1.5;
}
.btn-demo:hover { background: #fde68a; border-color: #b45309; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .index-hero h1     { font-size: 1.5rem; }
  .progress-steps::before { display: none; }
  .step-label        { display: none; }
  .step-num          { width: 30px; height: 30px; font-size: .8rem; }
  .form-card-body    { padding: 20px 16px; }
  .field-row         { grid-template-columns: 1fr; }
  .form-actions      { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; justify-content: center; }
  .detail-row        { grid-template-columns: 1fr; }
  .confirmation-box  { padding: 32px 24px; }
  .page-header       { flex-direction: column; }
  .page-actions      { flex-wrap: wrap; }
}
