/* ============================================================
   BASE.CSS — Tokens, reset, layout global, topbar, nav, toast, popup
   Même charte graphique que 35ans.nidamour.ch (cohérence entre les
   deux applications de l'événement).
   ============================================================ */

:root {
  --bg:        #0F1923;
  --surface:   #1A2636;
  --border:    #2A3F55;
  --accent:    #F0C040;
  --accent2:   #4ECDC4;
  --text:      #E8EDF2;
  --muted:     #6B8AA8;
  --danger:    #FF6B6B;
  --success:   #4ADE80;
  --nav-h:     76px;
  --top-h:     56px;
  --font-head: 'Space Grotesk', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; width: 100%; overflow: hidden; background: var(--bg); }

body {
  color: var(--text);
  font-family: var(--font-head);
  display: flex;
  flex-direction: column;
}

/* ── Layout vues ────────────────────────────────────────── */
.content { flex: 1; overflow: hidden; position: relative; }

.view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 16px;
  gap: 16px;
}
.view.active { display: flex; }

.section-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  z-index: 1000;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  height: var(--top-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.topbar-title { font-weight: 700; font-size: 15px; }

/* ── Bottom nav ─────────────────────────────────────────── */
.bottom-nav {
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  flex-shrink: 0;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 600;
  padding: 10px 0 8px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}
.nav-item.active { color: var(--accent); }
.nav-icon { font-size: 26px; line-height: 1; transition: transform 0.15s; }
.nav-item.active .nav-icon { transform: translateY(-2px); }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title { font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.card-body  { padding: 16px 18px; }

/* ── Formulaires ────────────────────────────────────────── */
label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font-head);
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; font-family: var(--font-head); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 3px;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 16px;
  cursor: pointer;
  transition: opacity 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-full { width: 100%; }
.btn-sm { padding: 7px 11px; font-size: 12px; }
.btn-primary { background: var(--accent); color: #0F1923; border-color: var(--accent); }
.btn-success { background: var(--success); color: #0F1923; border-color: var(--success); }
.btn-danger  { color: var(--danger); border-color: rgba(255,107,107,0.4); }
.btn-ghost   { background: transparent; }

.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* ── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 20px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--muted);
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
  pointer-events: none;
  max-width: 90vw;
  text-overflow: ellipsis;
  overflow: hidden;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Confirm dialog ─────────────────────────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.confirm-overlay.show { display: flex; }
.confirm-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  max-width: 340px;
  width: 100%;
}
.confirm-box h3 { font-size: 16px; margin-bottom: 8px; }
.confirm-box p { font-size: 13px; color: var(--muted); margin-bottom: 18px; line-height: 1.5; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { flex: 1; }

/* ── Login ──────────────────────────────────────────────── */
#login-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 36px 28px;
}
.login-card h1 { font-size: 24px; margin-bottom: 4px; }
.login-card .subtitle { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.login-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.login-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  background: transparent;
}
.login-tab.active { color: var(--accent); border-color: var(--accent); background: rgba(240,192,64,0.08); }
.error-msg { color: var(--danger); font-size: 12px; margin: -6px 0 12px; min-height: 16px; }
