/* Chronometre.ma - Mobile-first, fast and simple */
:root {
  --bg: #ffffff;
  --text: #0f172a; /* slate-900 */
  --subtext: #475569; /* slate-600 */
  --primary: #0C7BEF;
  --primary-dark: #085fb9;
  --border: #e2e8f0; /* slate-200 */
  --muted: #f8fafc; /* slate-50 */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container { max-width: 1000px; margin: 0 auto; padding: 0 16px; }

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; position: relative; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.burger { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); padding: 8px; gap: 4px; margin-left: auto; }
.burger span { display: block; width: 22px; height: 2px; background: var(--text); }
.nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 12px 16px; flex-direction: column; gap: 12px; }
.nav a { color: var(--text); text-decoration: none; }
.nav a:hover { text-decoration: underline; }
.nav.is-open { display: flex; }

.main { padding: 24px 0; }

/* Timer display (style inspiré des images) */
.display {
  margin: 16px auto;
  max-width: 560px;
  background: #f1f5f9; /* slate-100 */
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}

.controls { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 16px; }
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.success { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn.success:hover { background: #15803d; border-color: #15803d; }
.btn.danger { background: #ef4444; border-color: #ef4444; color: #fff; }
.btn.danger:hover { background: #dc2626; border-color: #dc2626; }
.btn.secondary { background: #e2e8f0; border-color: #e2e8f0; color: var(--text); }
.btn.secondary:hover { background: #cbd5e1; border-color: #cbd5e1; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Accessibilité: focus visible clair pour clavier */
button:focus-visible,
.btn:focus-visible,
a:focus-visible,
.nav a:focus-visible,
.footer-nav a:focus-visible {
  outline: 3px solid #0C7BEF;
  outline-offset: 2px;
}

.laps {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.laps-list { list-style: none; margin: 0; padding: 0; }
.laps-head { display: grid; grid-template-columns: 160px 1fr 60px; gap: 12px; font-weight: 700; padding: 8px 0; border-bottom: 2px solid var(--border); }
.lap { display: grid; grid-template-columns: 160px 1fr 60px; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.lap-time { font-weight: 700; }
.lap-note { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.lap-delete { border: 1px solid var(--border); background: transparent; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.lap-delete:hover { background: var(--muted); }
.laps-actions { display: flex; gap: 12px; align-items: center; margin-top: 12px; }

/* Content */
.section { margin-top: 32px; }
.section h2 { margin: 0 0 8px; font-size: 22px; }
.section h3 { margin: 16px 0 8px; font-size: 18px; }
.section p { margin: 8px 0; color: var(--text); }
.section ul { margin: 8px 0 8px 20px; }

.site-footer { border-top: 1px solid var(--border); background: var(--bg); }
.footer-inner { padding: 20px 0; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.footer-nav a { margin-right: 12px; color: var(--text); text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }

.cookie-banner { position: fixed; bottom: 12px; left: 12px; right: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.08); }
.cookie-inner { display: flex; align-items: center; gap: 12px; padding: 12px; }
.cookie-banner[hidden] { display: none; }

/* Forms */
form { max-width: 640px; margin: 0 auto; }
.form-field { margin-bottom: 14px; }
label { display: block; margin-bottom: 6px; font-weight: 600; }
input[type="text"], input[type="email"], textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
textarea { min-height: 140px; }
.form-help { color: var(--subtext); font-size: 13px; }
.alert { margin-top: 10px; padding: 10px 12px; border-radius: 8px; }
.alert.success { background: #ecfeff; border: 1px solid #67e8f9; }
.alert.error { background: #fee2e2; border: 1px solid #ef4444; }

/* Responsive */
@media (min-width: 768px) {
  .display { font-size: 40px; }
  .burger { display: none; }
  .nav { display: flex !important; position: static; border: 0; padding: 0; flex-direction: row; gap: 16px; }
}