/* ============================================================
   KHÔL — Brutaliste Suisse
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wdth,wght@0,75..125,100..900;1,75..125,100..900&family=JetBrains+Mono:wght@400;500;700&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  --bg:    #ebe7df;
  --bg-2:  #ddd9cf;
  --paper: #f5f1e8;
  --fg:    #0c0c0c;
  --fg-2:  #2a2a2a;
  --fg-3:  #5a5a55;
  --line:  #0c0c0c;
  --pop:   #c4ff3d;
  --pop-2: #ff5b25;
  --pop-3: #2c5dff;
  --nav-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: 'Archivo', sans-serif;
  font-variation-settings: 'wdth' 100, 'wght' 500;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ─────────────────────────────────────── */
.k-tight {
  font-family: 'Archivo', sans-serif;
  font-variation-settings: 'wdth' 75, 'wght' 800;
  letter-spacing: -0.04em; line-height: 0.88; text-transform: uppercase;
}
.k-tight-md {
  font-family: 'Archivo', sans-serif;
  font-variation-settings: 'wdth' 85, 'wght' 700;
  letter-spacing: -0.03em; line-height: 0.95; text-transform: uppercase;
}
.k-wide {
  font-family: 'Archivo', sans-serif;
  font-variation-settings: 'wdth' 125, 'wght' 600;
  letter-spacing: -0.005em;
}
.k-mono   { font-family: 'JetBrains Mono', monospace; }
.k-italic { font-family: 'Instrument Serif', serif; font-style: italic; font-weight: 400; }
.k-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-2);
}

/* ── Colors ─────────────────────────────────────────── */
.k-block { border: 2px solid var(--line); background: var(--bg); }
.k-fill  { background: var(--fg); color: var(--bg); }
.k-pop   { background: var(--pop); }
.k-pop2  { background: var(--pop-2); color: var(--bg); }
.k-paper { background: var(--paper); }

/* ── Buttons ────────────────────────────────────────── */
.k-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border: 2px solid var(--line); background: var(--bg);
  font-family: 'Archivo', sans-serif;
  font-variation-settings: 'wdth' 90, 'wght' 700;
  font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; color: var(--fg);
  transition: transform 80ms, box-shadow 80ms; line-height: 1;
}
.k-btn:hover    { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--line); }
.k-btn-pop      { background: var(--pop); }
.k-btn-fill     { background: var(--fg); color: var(--bg); }
.k-btn-pop2     { background: var(--pop-2); color: var(--bg); }
.k-btn-sm       { padding: 6px 12px; font-size: 11px; }
.k-btn-lg       { padding: 18px 32px; font-size: 16px; }
.k-btn-full     { width: 100%; }

/* ── Tags ───────────────────────────────────────────── */
.k-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border: 2px solid var(--line); background: var(--bg);
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;
  line-height: 1.4; white-space: nowrap;
}
.k-tag-pop  { background: var(--pop); }
.k-tag-fill { background: var(--fg); color: var(--bg); }
.k-tag-pop2 { background: var(--pop-2); color: var(--bg); }

/* ── Inputs ─────────────────────────────────────────── */
.k-input, .k-select, .k-textarea {
  padding: 10px 12px; background: var(--bg); border: 2px solid var(--line);
  font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--fg);
  outline: none; width: 100%;
}
.k-input:focus, .k-select:focus, .k-textarea:focus { background: var(--paper); }
.k-select { appearance: none; cursor: pointer; }
.k-textarea { resize: vertical; }

/* ── Rules ──────────────────────────────────────────── */
.k-rule      { border: none; border-top: 2px solid var(--line); margin: 0; }
.k-rule-thin { border: none; border-top: 1px solid var(--fg-3); margin: 0; }

/* ── Ticker ─────────────────────────────────────────── */
.k-ticker {
  display: flex; padding: 11px 0;
  background: var(--fg); color: var(--bg);
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em;
  white-space: nowrap; overflow: hidden;
  border-top: 2px solid var(--line); border-bottom: 2px solid var(--line);
}
.k-ticker-track {
  display: flex; gap: 48px;
  animation: ticker-scroll 32s linear infinite; flex-shrink: 0;
}
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.k-ticker .pop  { color: var(--pop); }
.k-ticker .pop2 { color: var(--pop-2); }

/* ── Nav ────────────────────────────────────────────── */
.k-nav {
  position: sticky; top: 0; z-index: 100;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; padding: 0 36px; height: var(--nav-h);
  border-bottom: 2px solid var(--line); background: var(--bg);
}
.k-nav-left { font-family: 'JetBrains Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-3); }
.k-nav-logo {
  font-family: 'Archivo', sans-serif;
  font-variation-settings: 'wdth' 75, 'wght' 800;
  font-size: 28px; letter-spacing: -0.07em; text-transform: uppercase;
  text-decoration: none; color: var(--fg); line-height: 1;
}
.k-nav-right {
  display: flex; align-items: center; gap: 20px; justify-content: flex-end;
  font-family: 'Archivo', sans-serif;
  font-variation-settings: 'wdth' 90, 'wght' 700;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em;
}
.k-nav-right a {
  text-decoration: none; color: var(--fg);
  padding-bottom: 2px; border-bottom: 2px solid transparent;
}
.k-nav-right a.active, .k-nav-right a:hover { border-bottom-color: var(--fg); }
.k-nav-hamburger { display: none; cursor: pointer; border: none; background: none; padding: 6px; }
.k-nav-hamburger span { display: block; width: 24px; height: 2px; background: var(--fg); margin: 5px 0; }

/* ── Mobile menu ────────────────────────────────────── */
.k-mobile-menu {
  display: none; flex-direction: column;
  position: fixed; top: var(--nav-h); left: 0; right: 0;
  background: var(--bg); border-bottom: 2px solid var(--line);
  padding: 20px 24px; gap: 16px; z-index: 99;
}
.k-mobile-menu.open { display: flex; }
.k-mobile-menu a {
  text-decoration: none; color: var(--fg);
  font-family: 'Archivo', sans-serif;
  font-variation-settings: 'wdth' 85, 'wght' 700;
  font-size: 14px; text-transform: uppercase;
}

/* ── Footer ─────────────────────────────────────────── */
.k-footer {
  border-top: 2px solid var(--line); padding: 28px 36px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.k-footer-logo {
  font-family: 'Archivo', sans-serif;
  font-variation-settings: 'wdth' 75, 'wght' 800;
  font-size: 22px; letter-spacing: -0.07em; text-transform: uppercase;
  text-decoration: none; color: var(--fg);
}
.k-footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.k-footer-links a { text-decoration: none; color: var(--fg); font-family: 'JetBrains Mono', monospace; font-size: 11px; text-transform: uppercase; }
.k-footer-copy { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--fg-3); text-transform: uppercase; width: 100%; }

/* ── Modals ─────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(12,12,12,0.75);
  align-items: flex-start; justify-content: center;
  padding: 48px 16px; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg); border: 2px solid var(--line);
  width: 100%; max-width: 580px; position: relative; padding: 32px;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: 2px solid var(--line);
  width: 32px; height: 32px; font-size: 14px; cursor: pointer; color: var(--fg);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--fg); color: var(--bg); }
.modal-tag { font-family: 'JetBrains Mono', monospace; font-size: 10px; text-transform: uppercase; margin-bottom: 8px; }
.modal-course-title { margin: 0 0 8px; }
.modal-form-content { margin-top: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.form-input, .form-select, .form-textarea { padding: 10px 12px; background: var(--bg); border: 2px solid var(--line); font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--fg); outline: none; width: 100%; }
.form-input:focus, .form-select:focus, .form-textarea:focus { background: var(--paper); }
.form-input.error, .form-select.error { border-color: var(--pop-2); }
.form-error-msg { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--pop-2); display: none; }
.form-error-msg.visible { display: block; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.success-message { display: none; text-align: center; padding: 40px 0; }
.success-message.visible { display: block; }
.success-icon { font-size: 48px; margin-bottom: 16px; }

/* ── Slot picker ────────────────────────────────────── */
.slot-pick-label { font-family: 'JetBrains Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.order-slot-grid { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.order-slot-col  { display: flex; flex-direction: column; gap: 6px; }
.order-slot-day  { font-family: 'JetBrains Mono', monospace; font-size: 10px; text-align: center; text-transform: uppercase; color: var(--fg-3); margin-bottom: 4px; }
.order-slot-btn  { padding: 8px 12px; background: var(--paper); border: 2px solid var(--line); font-family: 'JetBrains Mono', monospace; font-size: 11px; cursor: pointer; color: var(--fg); text-transform: uppercase; }
.order-slot-btn:hover, .order-slot-btn.selected { background: var(--pop); }
.order-slot-btn.selected { font-weight: 800; }

/* ── Teacher cards ──────────────────────────────────── */
.teacher-card { border: 2px solid var(--line); background: var(--bg); cursor: pointer; padding: 20px; transition: transform 80ms, box-shadow 80ms; }
.teacher-card:hover, .teacher-card.selected { transform: translate(-2px,-2px); box-shadow: 4px 4px 0 var(--line); }
.teacher-card.selected { border-color: var(--pop); background: var(--paper); }
.teacher-avatar { width: 48px; height: 48px; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-family: 'Archivo', sans-serif; font-variation-settings: 'wdth' 75, 'wght' 800; font-size: 18px; text-transform: uppercase; }
.teacher-name { font-family: 'Archivo', sans-serif; font-variation-settings: 'wdth' 75, 'wght' 700; font-size: 20px; text-transform: uppercase; letter-spacing: -0.03em; margin: 10px 0 4px; }
.teacher-specialty { font-family: 'JetBrains Mono', monospace; font-size: 10px; text-transform: uppercase; color: var(--fg-3); margin-bottom: 8px; }
.teacher-bio { font-size: 13px; color: var(--fg-2); line-height: 1.5; }
.teacher-select-hint { font-family: 'JetBrains Mono', monospace; font-size: 10px; text-transform: uppercase; color: var(--fg-3); margin-top: 10px; }
#teachers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }

/* ── Booking section ────────────────────────────────── */
#booking-section.hidden { display: none; }
.booking-section-title { margin: 0 0 4px; }
.slots-week-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.slot-day-header { font-family: 'JetBrains Mono', monospace; font-size: 10px; text-align: center; text-transform: uppercase; color: var(--fg-3); }
.slot-day-date { display: block; font-weight: 700; color: var(--fg); }
.slots-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.slots-day-col { display: flex; flex-direction: column; gap: 4px; }
.slot-chip { padding: 8px 4px; background: var(--paper); border: 2px solid var(--line); font-family: 'JetBrains Mono', monospace; font-size: 10px; cursor: pointer; color: var(--fg); text-align: center; text-transform: uppercase; }
.slot-chip:hover, .slot-chip.selected { background: var(--pop); }
.slot-chip.selected { font-weight: 800; }
.slot-chip.unavailable { background: var(--bg-2); color: var(--fg-3); cursor: not-allowed; opacity: 0.5; }
.slot-empty { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--fg-3); text-align: center; padding: 8px 0; }

/* ── Course cards ───────────────────────────────────── */
.course-card { border: 2px solid var(--line); background: var(--bg); display: flex; flex-direction: column; animation: fadeUp 200ms both; transition: transform 80ms, box-shadow 80ms; }
.course-card:hover { transform: translate(-2px,-2px); box-shadow: 4px 4px 0 var(--line); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.course-card-top { padding: 10px 14px; border-bottom: 2px solid var(--line); display: flex; align-items: center; gap: 6px; }
.course-card h3 { padding: 14px 14px 0; font-family: 'Archivo', sans-serif; font-variation-settings: 'wdth' 85, 'wght' 700; font-size: 18px; letter-spacing: -0.02em; text-transform: uppercase; margin: 0; line-height: 1.05; }
.course-card p { padding: 8px 14px; font-size: 12px; color: var(--fg-2); flex: 1; line-height: 1.5; margin: 0; }
.course-card-footer { border-top: 2px solid var(--line); padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; }
.course-price { font-family: 'Archivo', sans-serif; font-variation-settings: 'wdth' 75, 'wght' 800; font-size: 20px; letter-spacing: -0.04em; }
.tag-maths    { background: var(--pop); }
.tag-physique { background: #d4c8ff; }
.tag-chimie   { background: #b8f5e0; }
.tag-methode  { background: var(--pop-2); color: var(--bg); }

/* ── Toast ──────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; transition: all 300ms; background: var(--fg); color: var(--bg); padding: 12px 20px; font-family: 'JetBrains Mono', monospace; font-size: 12px; display: flex; align-items: center; gap: 10px; border: 2px solid var(--line); pointer-events: none; white-space: nowrap; z-index: 300; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Page sections ──────────────────────────────────── */
.page-header { padding: 48px 36px 40px; border-bottom: 2px solid var(--line); }
.section     { padding: 56px 36px; }
.section-alt { padding: 56px 36px; background: var(--paper); border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); }

/* Courses */
.courses-section        { padding: 40px 36px; }
.courses-section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.courses-count          { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--fg-3); text-transform: uppercase; }
.courses-grid           { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.filter-bar             { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 2px solid var(--line); background: var(--paper); flex-wrap: wrap; }
.filter-group           { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn { padding: 4px 10px; border: 2px solid var(--line); background: var(--bg); font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700; text-transform: uppercase; cursor: pointer; color: var(--fg); }
.filter-btn.active { background: var(--fg); color: var(--bg); }
.filter-btn:hover  { background: var(--pop); color: var(--fg); }
.filter-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; text-transform: uppercase; color: var(--fg-3); }
.empty-state  { text-align: center; padding: 64px; grid-column: 1/-1; font-family: 'JetBrains Mono', monospace; }

/* Sur mesure */
.sur-mesure-card { border: 2px solid var(--line); background: var(--paper); padding: 28px; max-width: 720px; }

/* Corrections */
.concours-card { border: 2px solid var(--line); margin-bottom: 12px; overflow: hidden; }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border: 2px solid var(--line); font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.badge-new { background: var(--pop); }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
  .k-nav { padding: 0 20px; }
  .k-nav-left { display: none; }
  .k-nav-right a:not(.k-btn) { display: none; }
  .k-nav-hamburger { display: block; }
  .section, .section-alt { padding: 40px 20px; }
  .page-header { padding: 32px 20px 28px; }
  .courses-section { padding: 32px 20px; }
  .courses-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .k-footer { padding: 24px 20px; flex-direction: column; gap: 12px; }
}
@media (max-width: 600px) {
  .courses-grid { grid-template-columns: 1fr; }
  #teachers-grid { grid-template-columns: 1fr; }
  .modal { padding: 24px 20px; }
}
