:root {
  --bg: #f4f1ea;
  --bg-deep: #e6d7bc;
  --ink: #1f1c16;
  --ink-soft: #5f574a;
  --accent: #b33a3a;
  --accent-2: #1f7a6f;
  --card: rgba(255, 252, 245, 0.82);
  --line: rgba(31, 28, 22, 0.12);
  --shadow: 0 18px 50px rgba(58, 45, 27, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 10%, #f8f4eb 0%, var(--bg) 45%, #dfcda9 100%);
  position: relative;
}

.bg-shape {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.35;
}

.bg-shape-1 {
  width: 320px;
  height: 320px;
  background: #d97c3f;
  top: -70px;
  left: -60px;
}

.bg-shape-2 {
  width: 300px;
  height: 300px;
  background: #2f8a7f;
  right: -70px;
  bottom: 40px;
}

.container {
  width: min(1100px, 92vw);
  margin: 40px auto 24px;
}

.hero {
  background: linear-gradient(128deg, rgba(255, 251, 241, 0.9), rgba(231, 218, 191, 0.82));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 20px;
  padding: clamp(20px, 3vw, 36px);
  animation: rise 0.7s ease forwards;
}

.badge {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  background: rgba(179, 58, 58, 0.14);
  color: #7f1b1b;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: "Oswald", sans-serif;
  letter-spacing: 0.02em;
  margin-top: 0;
}

h1 {
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  margin-bottom: 12px;
}

.hero p {
  margin-bottom: 0;
  line-height: 1.6;
  color: var(--ink-soft);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 18px;
  padding: 22px;
  animation: rise 0.8s ease forwards;
}

.petition-form {
  display: grid;
  gap: 12px;
}

label,
legend {
  font-size: 0.94rem;
  font-weight: 700;
}

.optional {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

input,
textarea {
  width: 100%;
  margin-top: 7px;
  padding: 12px 13px;
  border: 1px solid rgba(31, 28, 22, 0.2);
  border-radius: 10px;
  background: #fffefb;
  font: inherit;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #aa6523;
  box-shadow: 0 0 0 3px rgba(170, 101, 35, 0.18);
}

fieldset {
  border: 1px solid rgba(31, 28, 22, 0.15);
  border-radius: 12px;
  padding: 12px;
}

.radio {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 500;
  margin-top: 8px;
}

.radio input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}

button {
  border: 0;
  border-radius: 11px;
  padding: 13px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #8f2323);
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.form-message {
  margin: 0;
  min-height: 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.form-message.success { color: var(--accent-2); }
.form-message.error   { color: #8f2323; }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(31, 28, 22, 0.12);
  background: #fffdf6;
}

.stat-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.5rem;
  color: var(--ink);
}

.stat-card.ancien strong { color: var(--accent-2); }
.stat-card.nouveau strong { color: var(--accent); }

/* Réponse officielle */
.direction-response {
  margin-top: 18px;
  padding: clamp(18px, 2.5vw, 28px);
  border-radius: 18px;
  border: 1px solid rgba(31, 122, 111, 0.3);
  background: linear-gradient(128deg, rgba(31, 122, 111, 0.07), rgba(31, 122, 111, 0.03));
  box-shadow: var(--shadow);
  animation: rise 0.8s ease forwards;
}

.response-header {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.response-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(31, 122, 111, 0.14);
  color: var(--accent-2);
}

.response-badge.dynafit {
  background: rgba(179, 58, 58, 0.12);
  color: var(--accent);
}

#response-text {
  margin: 0 0 10px;
  line-height: 1.65;
  font-size: 0.97rem;
  white-space: pre-wrap;
  padding-left: 16px;
  border-left: 3px solid var(--accent-2);
}

.response-date {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* Barres de progression */
.vote-bars {
  margin: 18px 0 4px;
  display: grid;
  gap: 14px;
}

.vote-bar-item {
  display: grid;
  gap: 6px;
}

.vote-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  font-weight: 700;
}

.vote-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(31, 28, 22, 0.1);
  overflow: hidden;
}

.vote-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}

.vote-bar-fill.ancien { background: var(--accent-2); }
.vote-bar-fill.nouveau { background: var(--accent); }

/* Commentaires */
.comments-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.comment {
  padding: 12px;
  border-radius: 11px;
  border: 1px solid rgba(31, 28, 22, 0.12);
  background: #fffefb;
}

.comment header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.86rem;
  flex-wrap: wrap;
}

.comment header strong {
  color: var(--ink);
}

.comment header span {
  color: var(--ink-soft);
}

.vote-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.vote-badge.ancien {
  background: rgba(31, 122, 111, 0.12);
  color: var(--accent-2);
}

.vote-badge.nouveau {
  background: rgba(179, 58, 58, 0.12);
  color: var(--accent);
}

.comment p {
  margin-bottom: 0;
  margin-top: 8px;
  line-height: 1.5;
}

.empty {
  color: var(--ink-soft);
}

/* Footer */
.footer {
  width: min(1100px, 92vw);
  margin: 10px auto 30px;
}

.footer-inner {
  background: rgba(31, 28, 22, 0.05);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 24px;
  text-align: center;
}

.footer-main {
  margin: 0 0 4px;
  font-size: 0.95rem;
  color: var(--ink);
}

.footer-sub {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.footer-links {
  margin: 0;
  font-size: 0.82rem;
}

.footer-links a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover { text-decoration: underline; }

.footer-sep {
  margin: 0 6px;
  color: var(--ink-soft);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
