/* =====================================================
   Inscriptions Théâtre — Feuille de styles
   Esthétique : papier crème, bordeaux théâtre, classique.
   ===================================================== */

:root {
  --c-bg:        #f5f1ea;
  --c-bg-soft:   #ede5d6;
  --c-paper:     #ffffff;
  --c-ink:       #1a1a1a;
  --c-ink-soft:  #4a4640;
  --c-mute:      #8b857c;
  --c-line:      #d8cfbf;
  --c-primary:   #8B2635;
  --c-primary-d: #6e1c29;
  --c-accent:    #c89b4a;
  --c-success:   #2f7a4a;
  --c-danger:    #b03030;

  --ff-display: "Playfair Display", "DM Serif Display", Georgia, "Times New Roman", serif;
  --ff-body:    "Lora", Georgia, "Iowan Old Style", "Hoefler Text", serif;
  --ff-ui:      ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 4px;
  --radius-lg: 8px;
  --shadow-card: 0 1px 0 rgba(0,0,0,0.04), 0 8px 24px -12px rgba(80,40,30,0.18);
  --shadow-soft: 0 1px 2px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1200px 600px at 80% -200px, rgba(139,38,53,0.06), transparent 60%),
    radial-gradient(800px 400px at -10% 100%, rgba(200,155,74,0.06), transparent 60%);
  background-attachment: fixed;
}

a { color: var(--c-primary); text-underline-offset: 3px; }
a:hover { color: var(--c-primary-d); }

img { max-width: 100%; height: auto; }

/* ============ Layout ============ */
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 820px; }

/* ============ Site header ============ */
.site-header {
  background: var(--c-paper);
  border-bottom: 1px solid var(--c-line);
  position: sticky; top: 0; z-index: 50;
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px;
}
.site-header__brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--c-ink);
  font-family: var(--ff-display);
  font-size: 22px;
  letter-spacing: 0.5px;
}
.brand-mark {
  width: 36px; height: 36px;
  background: var(--c-primary);
  color: #fff;
  display: inline-block;
  border-radius: 50%;
  position: relative;
}
.brand-mark::before {
  content: "";
  position: absolute; inset: 8px;
  background: var(--c-paper);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.site-header__nav { display: flex; gap: 24px; }
.site-header__nav a {
  text-decoration: none;
  color: var(--c-ink-soft);
  font-family: var(--ff-ui);
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.site-header__nav a:hover { border-bottom-color: var(--c-primary); color: var(--c-ink); }

/* ============ Site footer ============ */
.site-footer {
  margin-top: 80px;
  padding: 32px 0;
  background: var(--c-ink);
  color: var(--c-bg);
  font-family: var(--ff-ui);
  font-size: 14px;
  text-align: center;
}

/* ============ Typography ============ */
h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--c-ink);
}
h1 { font-size: clamp(28px, 4vw, 44px); margin: 0 0 16px; }
h2 { font-size: clamp(22px, 3vw, 30px); margin: 32px 0 16px; }
h3 { font-size: 18px; margin: 24px 0 8px; }

.eyebrow {
  font-family: var(--ff-ui);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 12px;
  color: var(--c-primary);
  margin: 0 0 8px;
}
.lede { font-size: 17px; color: var(--c-ink-soft); }
.hint { font-size: 14px; color: var(--c-mute); font-style: italic; }
.legal-note { font-size: 13px; color: var(--c-mute); margin-top: 16px; line-height: 1.5; }

/* ============ Formulaire ============ */
.page-form { padding: 48px 0 80px; }
.page-form__intro { text-align: center; margin-bottom: 40px; }

/* Steps indicator */
.steps {
  list-style: none; padding: 0; margin: 0 0 32px;
  display: flex; justify-content: space-between; gap: 8px;
  font-family: var(--ff-ui);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--c-line);
}
.steps__item {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  color: var(--c-mute);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.steps__item span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--c-bg-soft);
  font-size: 11px; font-weight: 700;
}
.steps__item.is-active { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.steps__item.is-active span { background: var(--c-primary); color: #fff; }
.steps__item.is-done { color: var(--c-ink-soft); }
.steps__item.is-done span { background: var(--c-success); color: #fff; }

/* Cards */
.card {
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 0 0 20px;
  box-shadow: var(--shadow-soft);
}
.card > legend {
  padding: 4px 12px;
  background: var(--c-paper);
  font-family: var(--ff-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--c-primary);
  margin-left: -4px;
  margin-bottom: 8px;
}
.card__hint { color: var(--c-mute); font-size: 14px; margin: 0 0 16px; }

/* Step visibility */
.step { display: none; }
.step.is-visible { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(6px);} to {opacity:1;transform:none;} }

/* Course list */
.course-list { display: flex; flex-direction: column; gap: 0; }
.course {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 12px;
  border-bottom: 1px dashed var(--c-line);
  cursor: pointer;
  transition: background 0.15s;
}
.course:last-child { border-bottom: 0; }
.course:hover { background: var(--c-bg-soft); }
.course input[type="checkbox"] { transform: scale(1.15); accent-color: var(--c-primary); flex: 0 0 auto; }
.course__body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.course__title { font-weight: 500; }
.course__meta { color: var(--c-mute); font-size: 13px; font-style: italic; }
.course__price { font-family: var(--ff-display); font-size: 17px; color: var(--c-primary); white-space: nowrap; }
.course__price em { color: var(--c-mute); font-size: 12px; margin-left: 2px; font-style: normal; }
.course input:checked + .course__body { font-weight: 600; }

/* Form fields */
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field > span {
  font-family: var(--ff-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--c-ink-soft);
}
.field abbr { color: var(--c-primary); text-decoration: none; margin-left: 2px; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(139,38,53,0.12);
}

/* Checks */
.checks { display: flex; flex-direction: column; gap: 12px; }
.check {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px;
  background: var(--c-bg-soft);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
}
.check input { margin-top: 3px; transform: scale(1.1); accent-color: var(--c-primary); flex: 0 0 auto; }
.check:hover { background: #e5d9c2; }

/* Formules de paiement */
.formules { display: grid; grid-template-columns: 1fr; gap: 12px; }
.formule {
  display: flex; align-items: center; gap: 16px;
  padding: 16px;
  background: var(--c-bg-soft);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.formule:has(input:checked) { border-color: var(--c-primary); background: #fff; }
.formule input { accent-color: var(--c-primary); transform: scale(1.2); }
.formule strong { display: block; font-family: var(--ff-display); font-size: 17px; color: var(--c-ink); }
.formule span { color: var(--c-mute); font-size: 13px; }

/* Récapitulatif */
.recap {
  background: var(--c-ink);
  color: var(--c-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 24px 0;
}
.recap h3 { color: #fff; margin: 0 0 16px; font-size: 16px; letter-spacing: 1px; text-transform: uppercase; font-family: var(--ff-ui); }
.recap ul { list-style: none; padding: 0; margin: 0 0 12px; }
.recap li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.15);
  font-size: 14px;
}
.recap__line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.recap__total {
  display: flex; justify-content: space-between;
  margin-top: 16px; padding-top: 16px;
  border-top: 2px solid var(--c-primary);
  font-family: var(--ff-display);
  font-size: 22px;
}
.recap__total strong { color: var(--c-accent); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px;
  font-family: var(--ff-ui);
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, box-shadow 0.15s;
}
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-d); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--c-ink); border-color: var(--c-line); }
.btn--ghost:hover { background: var(--c-bg-soft); }
.btn--lg { padding: 14px 32px; font-size: 15px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.step__nav { display: flex; gap: 12px; justify-content: space-between; margin-top: 24px; }
.step__nav .btn--primary { margin-left: auto; }

/* Page de confirmation */
.page-confirm { padding: 80px 0; }
.confirm-card {
  background: var(--c-paper);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  border-top: 6px solid var(--c-primary);
  box-shadow: var(--shadow-card);
}
.confirm-card__icon { margin: 0 auto 24px; }
.confirm-details {
  text-align: left;
  background: var(--c-bg-soft);
  padding: 24px;
  border-radius: var(--radius);
  margin: 24px 0;
}
.confirm-details ul { list-style: none; padding: 0; margin: 8px 0; }
.confirm-details li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6px 0; border-bottom: 1px dashed var(--c-line);
}
.confirm-total, .confirm-paid {
  display: flex; justify-content: space-between;
  padding: 12px 0; margin: 0;
  font-family: var(--ff-display); font-size: 18px;
}
.confirm-total { border-top: 2px solid var(--c-primary); }
.confirm-echeances table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.confirm-echeances td { padding: 8px 12px; border-bottom: 1px solid var(--c-line); font-size: 14px; }
.confirm-actions { margin-top: 32px; display: flex; gap: 12px; justify-content: center; }

/* ============ Admin ============ */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar {
  background: var(--c-ink); color: var(--c-bg);
  padding: 24px 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar__brand {
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-family: var(--ff-display);
  font-size: 18px; color: #fff;
  letter-spacing: 0.5px;
}
.admin-sidebar__nav { display: flex; flex-direction: column; padding: 16px 0; }
.admin-sidebar__nav a {
  padding: 10px 24px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-family: var(--ff-ui);
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: background 0.15s;
}
.admin-sidebar__nav a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.admin-sidebar__nav a.is-active {
  background: rgba(139,38,53,0.2);
  border-left-color: var(--c-primary);
  color: #fff;
}
.admin-main { padding: 32px 40px; }
.admin-main__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }

.admin-table { width: 100%; border-collapse: collapse; background: var(--c-paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); }
.admin-table th {
  text-align: left; padding: 12px 16px;
  background: var(--c-bg-soft);
  font-family: var(--ff-ui); font-size: 12px;
  text-transform: uppercase; letter-spacing: 1px; color: var(--c-ink-soft);
  border-bottom: 1px solid var(--c-line);
}
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--c-line); font-size: 14px; vertical-align: middle; }
.admin-table tr:hover td { background: var(--c-bg-soft); }
.admin-table a { color: var(--c-primary); font-weight: 500; }

.badge {
  display: inline-block; padding: 2px 10px;
  border-radius: 999px; font-size: 11px;
  font-family: var(--ff-ui); text-transform: uppercase; letter-spacing: 0.5px;
  font-weight: 600;
}
.badge--en_attente { background: #fef3c7; color: #92400e; }
.badge--en_cours   { background: #dbeafe; color: #1e40af; }
.badge--payee      { background: #d1fae5; color: #065f46; }
.badge--annulee    { background: #fee2e2; color: #991b1b; }
.badge--echec      { background: #fee2e2; color: #991b1b; }
.badge--a_venir    { background: #f3f4f6; color: #374151; }
.badge--planifiee  { background: #e0e7ff; color: #3730a3; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.kpi {
  background: var(--c-paper); border-radius: var(--radius-lg); padding: 20px;
  border-left: 4px solid var(--c-primary);
  box-shadow: var(--shadow-soft);
}
.kpi__label { font-family: var(--ff-ui); font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--c-mute); margin: 0 0 4px; }
.kpi__value { font-family: var(--ff-display); font-size: 30px; color: var(--c-ink); margin: 0; }
.kpi__sub { font-size: 12px; color: var(--c-mute); margin: 2px 0 0; }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box {
  background: var(--c-paper); padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  max-width: 380px; width: 100%;
  border-top: 6px solid var(--c-primary);
}
.login-box h1 { text-align: center; font-size: 24px; margin: 0 0 8px; }
.login-box .lede { text-align: center; }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin: 0 0 16px;
  font-size: 14px;
}
.alert--danger { background: #fef2f2; color: #991b1b; border-left: 4px solid var(--c-danger); }
.alert--success { background: #f0fdf4; color: #065f46; border-left: 4px solid var(--c-success); }
.alert--info { background: #eff6ff; color: #1e40af; border-left: 4px solid #3b82f6; }

/* Toolbar / search */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input[type="search"], .toolbar select {
  padding: 8px 12px; border: 1px solid var(--c-line); border-radius: var(--radius); background: #fff; font: inherit;
}

/* Responsive */
@media (max-width: 760px) {
  .grid--2 { grid-template-columns: 1fr; }
  .site-header__nav { gap: 12px; }
  .site-header__nav a { font-size: 12px; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: relative; height: auto; }
  .card { padding: 18px; }
  .confirm-card { padding: 24px; }
  .steps__item { font-size: 10px; letter-spacing: 1px; }
  .course { flex-wrap: wrap; }
  .course__price { width: 100%; text-align: right; }
}

/* Print (factures) */
@media print {
  .site-header, .site-footer, .admin-sidebar, .toolbar, .step__nav { display: none !important; }
  body { background: #fff; }
}
