:root {
  --navy: #0e2a47;
  --navy-dark: #07182a;
  --accent: #ff7a1a;
  --accent-soft: #fff1e3;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1a2436;
  --muted: #6b7280;
  --border: #e3e7ee;
  --shadow: 0 6px 20px rgba(7, 24, 42, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--navy);
  color: white;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--accent);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
}
.brand-text strong { display: block; font-size: 16px; }
.brand-text span { font-size: 12px; opacity: 0.85; }
.topbar nav a {
  color: white;
  margin-left: 22px;
  font-size: 14px;
  opacity: 0.85;
}
.topbar nav a.active { opacity: 1; border-bottom: 2px solid var(--accent); padding-bottom: 4px; }

.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: white;
  padding: 64px 28px;
}
.hero-inner { max-width: 900px; margin: 0 auto; }
.hero h1 { font-size: 38px; margin: 0 0 14px; letter-spacing: -0.5px; }
.hero p { font-size: 17px; opacity: 0.85; max-width: 640px; }

.container { max-width: 1180px; margin: 32px auto; padding: 0 24px; }

.filters {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px;
}
.filter-pill {
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.filter-pill:hover { border-color: var(--accent); }
.filter-pill.active { background: var(--navy); color: white; border-color: var(--navy); }

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.course-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.course-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(7, 24, 42, 0.12); }
.course-card .badges { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.course-card h3 { margin: 0 0 8px; color: var(--navy); font-size: 17px; }
.course-card .summary { font-size: 14px; color: var(--muted); flex: 1; }
.course-card .meta { font-size: 13px; color: var(--text); margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; }
.course-card .meta strong { color: var(--accent); font-size: 15px; }

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.tag.sw-sage { background: #e0e7ff; color: #3730a3; }
.tag.sw-silae { background: #d1fae5; color: #065f46; }
.tag.sw-lucca { background: #fce7f3; color: #9d174d; }
.tag.sw-transverse { background: #e5e7eb; color: #374151; }
.tag.level-Débutant { background: #ecfdf5; color: #047857; }
.tag.level-Intermédiaire { background: #fffbeb; color: #b45309; }
.tag.level-Avancé { background: #fef2f2; color: #b91c1c; }
.tag.level-Expert { background: #ede9fe; color: #6d28d9; }

.modal {
  position: fixed; inset: 0;
  background: rgba(7, 24, 42, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 16px;
}
.modal[hidden] { display: none; }
.modal-card.large {
  background: white;
  border-radius: 12px;
  width: min(800px, 100%);
  max-height: 92vh;
  overflow: auto;
}
.modal-card header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 26px; border-bottom: 1px solid var(--border);
}
.modal-card header h2 { margin: 0; color: var(--navy); font-size: 22px; }
.modal-card header button {
  background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted);
}
.modal-body { padding: 24px 26px; }
.modal-body h3 { color: var(--navy); margin: 22px 0 8px; font-size: 15px; }
.modal-body ul { padding-left: 20px; }
.modal-body li { margin-bottom: 4px; font-size: 14px; }

.sessions {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.session-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px dashed var(--border);
}
.session-row:last-child { border-bottom: none; }
.session-row .when { font-weight: 600; }
.session-row .where { font-size: 13px; color: var(--muted); }
.session-row .seats { font-size: 13px; color: var(--muted); }
.btn-register {
  background: var(--accent); color: white; border: none;
  padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-register:disabled { background: #9ca3af; cursor: not-allowed; }
.btn-register:hover:not(:disabled) { filter: brightness(1.05); }

.register-form {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
}
.register-form label { display: block; margin-bottom: 10px; font-size: 13px; }
.register-form label span { display: block; font-weight: 600; margin-bottom: 4px; }
.register-form input, .register-form textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit; background: white;
}
.register-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.register-form .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.register-form .success { color: var(--navy); font-weight: 600; padding: 12px; background: white; border-radius: 6px; }
.register-form .error { color: #991b1b; font-weight: 600; font-size: 13px; padding-top: 4px; }

footer {
  margin-top: 60px;
  padding: 22px 24px;
  background: var(--navy);
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  text-align: center;
}
footer a { color: white; }

@media (max-width: 600px) {
  .hero h1 { font-size: 28px; }
  .session-row { flex-direction: column; align-items: flex-start; gap: 8px; }
}
