/* DiscovR — page de modération. Style « Patrimoine contemporain ». */

@font-face {
  font-family: 'Fraunces';
  src: url('fonts/Fraunces-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('fonts/Fraunces-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('fonts/Fraunces-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #14201f;
  --muted: #5e6f6b;
  --teal: #0e4d4a;
  --teal-dark: #083b39;
  --teal-soft: #d8ede9;
  --terracotta: #c0653a;
  --terracotta-soft: #f6e7de;
  --sand: #f7f5ef;
  --white: #ffffff;
  --line: #dde3df;
  --line-soft: #edf0ec;
  --shadow: 0 1px 2px rgba(20, 32, 31, 0.05), 0 8px 24px rgba(20, 32, 31, 0.06);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--sand);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.hidden { display: none !important; }

/* ── Barre du haut ─────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-family: 'Fraunces', Georgia, serif; font-weight: 700; font-size: 19px; }
.brand-sub {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--terracotta);
  border-left: 1px solid var(--line);
  padding-left: 10px;
}

.session { display: flex; align-items: center; gap: 14px; }
.who { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.role {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 999px;
  padding: 2px 9px;
}

/* ── Mise en page ──────────────────────────────────────────── */

.wrap {
  flex: 1;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 26px 22px 60px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 22px 26px;
  color: var(--muted);
  font-size: 12.5px;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── Connexion ─────────────────────────────────────────────── */

.login {
  max-width: 480px;
  margin: 7vh auto 0;
  padding: 34px 32px 28px;
}

.login h1 { font-size: 27px; margin-bottom: 10px; }
.lead { color: var(--muted); margin: 0 0 22px; }
.login .btn.google { width: 100%; justify-content: center; font-size: 15px; padding: 12px 16px; }
.fineprint { color: var(--muted); font-size: 12.5px; margin: 18px 0 0; }
.error { color: var(--terracotta); font-weight: 500; margin: 14px 0 0; }

/* ── Boutons ───────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 9px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: progress; }

.btn.primary { background: var(--teal); color: var(--white); }
.btn.primary:hover { background: var(--teal-dark); }

.btn.google {
  background: var(--white);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(20, 32, 31, 0.06);
}
.btn.google:hover { background: #fbfaf7; border-color: #c9d2cd; }

.btn.ghost { background: transparent; color: var(--teal); border-color: var(--line); }
.btn.ghost:hover { background: var(--teal-soft); border-color: var(--teal-soft); }

.btn.danger { background: var(--terracotta); color: var(--white); }
.btn.danger:hover { background: #a9552f; }

.btn.danger-outline { background: transparent; color: var(--terracotta); border-color: #e3c3b1; }
.btn.danger-outline:hover { background: var(--terracotta-soft); }

.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 9px; }

/* ── Onglets ───────────────────────────────────────────────── */

.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.tabs .spacer { flex: 1; }

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--teal); border-color: var(--teal); color: var(--white); }
.count {
  font-size: 12px;
  background: var(--teal-soft);
  color: var(--teal);
  border-radius: 999px;
  padding: 1px 8px;
  min-width: 22px;
  text-align: center;
}
.tab.active .count { background: rgba(255, 255, 255, 0.2); color: var(--white); }

.hint { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 10px;
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.list { display: flex; flex-direction: column; gap: 14px; }

/* ── Carte d'une proposition ───────────────────────────────── */

.suggestion { padding: 18px; }

.suggestion-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.suggestion-title { font-family: 'Fraunces', Georgia, serif; font-size: 20px; font-weight: 600; }
.suggestion-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}
.author { color: var(--ink); font-weight: 500; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.suggestion-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 16px;
  margin-top: 12px;
}
.suggestion-desc { margin: 0; color: #33413e; white-space: pre-line; }
.suggestion-desc.empty-desc { color: var(--muted); font-style: italic; }
.original { color: var(--muted); font-size: 12.5px; margin-top: 8px; }

.map { height: 150px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; z-index: 0; }
.map .leaflet-control-attribution { font-size: 9px; }

.suggestion-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.suggestion-actions .spacer { flex: 1; }

.edit-fields { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.edit-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.edit-fields input, .edit-fields select {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 10px;
}
.edit-fields input { min-width: 220px; }
.edit-fields .grow { flex: 1; }

/* ── Historique ────────────────────────────────────────────── */

.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13.5px;
}
.filters select {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 10px;
}

.history-note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  background: var(--sand);
  border-radius: 10px;
  padding: 8px 11px;
}
.history-note strong { color: var(--ink); font-weight: 600; }

/* ── Modale ────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(20, 32, 31, 0.45);
}
.modal-box {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(20, 32, 31, 0.25);
}
.modal-box h2 { font-size: 22px; margin-bottom: 6px; }
.modal-text { color: var(--muted); margin: 0 0 16px; }
.modal-box label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.modal-box textarea {
  width: 100%;
  resize: vertical;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.modal-box textarea:focus { outline: 2px solid var(--teal-soft); border-color: var(--teal); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ── Toast ─────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--ink);
  color: var(--white);
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(20, 32, 31, 0.3);
  max-width: calc(100vw - 32px);
}

/* ── Petit écran ───────────────────────────────────────────── */

@media (max-width: 640px) {
  .topbar { padding: 10px 14px; }
  .brand-sub { display: none; }
  .wrap { padding: 18px 14px 40px; }
  .suggestion-body { grid-template-columns: 1fr; }
  .map { height: 130px; }
  .suggestion-actions .btn { flex: 1 1 auto; justify-content: center; }
  .session .who #who-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
