@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f5f3ee;
  --bg-card: #ffffff;
  --text: #0a0a0a;
  --text-dim: #5a5a5a;
  --text-mute: #9a9a9a;
  --border: #e0ddd5;
  --red: #e63946;
  --red-deep: #c1121f;
  --red-soft: #fef2f2;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(230,57,70,0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(10,10,10,0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER ===== */
.header {
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid var(--text);
  background: var(--bg);
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
}
.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-image: url('/static/logo.png');
  background-size: cover;
  background-position: center;
  box-shadow: 2px 2px 0 var(--text);
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-text .name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.brand-text .role {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ep-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--text);
  color: var(--bg);
  padding: 6px 12px 6px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ep-tag.red { background: var(--red); }
.ep-tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px rgba(230,57,70,0.3);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

/* ===== FORM PAGE ===== */
.form-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 32px 80px;
}
.form-wrap {
  width: 100%;
  max-width: 540px;
  position: relative;
}
.sticker {
  position: absolute;
  top: -12px;
  right: -8px;
  background: var(--red);
  color: white;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 3px;
  transform: rotate(4deg);
  box-shadow: 3px 3px 0 var(--text);
  z-index: 2;
}
.sticker::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: white;
  border-radius: 50%;
  border: 2px solid var(--red);
}
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: '◆ ';
  font-size: 8px;
  vertical-align: middle;
  margin-right: 4px;
}
h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 56px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
h1 em { font-style: italic; color: var(--red); }
h1 .underline { position: relative; display: inline-block; }
h1 .underline::after {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: 4px;
  height: 8px;
  background: var(--red);
  z-index: -1;
  opacity: 0.25;
}
.intro {
  color: var(--text-dim);
  margin-bottom: 44px;
  font-size: 16px;
  max-width: 460px;
}
.intro strong {
  color: var(--text);
  font-weight: 600;
  background: rgba(230,57,70,0.08);
  padding: 0 4px;
}
.form-card {
  background: var(--bg-card);
  border: 1.5px solid var(--text);
  border-radius: 4px;
  padding: 36px 32px;
  box-shadow: 6px 6px 0 var(--text);
  position: relative;
}
.field { margin-bottom: 26px; }
.field:last-of-type { margin-bottom: 0; }
.field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.field label .required { color: var(--red); font-size: 14px; line-height: 0; }
.field label .opt {
  color: var(--text-mute);
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-style: italic;
}
.field textarea, .field input, .field select {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 4px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: all 0.15s;
}
.field textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
  font-family: 'Inter', sans-serif;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--text);
  background: white;
}
.field textarea::placeholder, .field input::placeholder {
  color: var(--text-mute);
  font-style: italic;
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3e%3cpath fill='%230a0a0a' d='M6 8L0 0h12z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}
.submit-row {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px dashed var(--border);
}
.submit {
  flex: 1;
  background: var(--text);
  color: white;
  border: 1.5px solid var(--text);
  border-radius: 4px;
  padding: 16px 24px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.submit:hover:not(:disabled) {
  background: var(--red);
  border-color: var(--red);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--text);
}
.submit:disabled { opacity: 0.5; cursor: not-allowed; }
.submit .arrow { transition: transform 0.15s; }
.submit:hover:not(:disabled) .arrow { transform: translateX(3px); }
.counter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  white-space: nowrap;
}
.counter-pill strong { color: var(--red); font-weight: 700; }

.error-msg {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--red-soft);
  border: 1px solid var(--red);
  border-radius: 4px;
  color: var(--red-deep);
  font-size: 13px;
  font-weight: 500;
}

/* ===== CONFIRMATION ===== */
.thanks-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 32px;
  text-align: center;
}
.thanks-content { max-width: 520px; }
.thanks-stamp {
  display: inline-block;
  border: 2.5px solid var(--red);
  color: var(--red);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 8px 18px;
  border-radius: 4px;
  transform: rotate(-3deg);
  margin-bottom: 36px;
  background: var(--bg);
}
.thanks-content h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 56px;
  font-weight: 400;
  line-height: 1;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}
.thanks-content h2 em { font-style: italic; color: var(--red); }
.thanks-content p {
  color: var(--text-dim);
  margin-bottom: 36px;
  font-size: 17px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  color: var(--text);
  border: 1.5px solid var(--text);
  border-radius: 4px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  font-family: inherit;
}
.btn-link:hover { background: var(--text); color: white; }

/* ===== ADMIN ===== */
.admin-main {
  flex: 1;
  padding: 40px 32px 60px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1.5px solid var(--text);
}
.admin-head .title-block h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 36px;
  font-weight: 400;
  line-height: 1;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.admin-head .title-block h2 em { font-style: italic; color: var(--red); }
.admin-head .meta {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.admin-head .meta strong { color: var(--text); }
.admin-actions { display: flex; gap: 8px; }
.btn-action {
  background: white;
  border: 1.5px solid var(--text);
  border-radius: 4px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-action:hover { background: var(--text); color: white; }
.btn-action.primary { background: var(--red); color: white; border-color: var(--red); }
.btn-action.primary:hover { background: var(--red-deep); border-color: var(--red-deep); }
.filters {
  display: flex;
  gap: 6px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.filter {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-dim);
  transition: all 0.15s;
}
.filter:hover { border-color: var(--text); color: var(--text); }
.filter.active { background: var(--text); color: white; border-color: var(--text); }
.filter .count { margin-left: 6px; opacity: 0.6; font-size: 12px; font-weight: 600; }
.questions {
  background: white;
  border: 1.5px solid var(--text);
  border-radius: 4px;
  overflow: hidden;
}
.questions-empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-mute);
  font-style: italic;
}
.q {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  align-items: start;
  transition: background 0.15s;
  position: relative;
}
.q:last-child { border-bottom: none; }
.q:hover { background: #fafaf6; }
.q.kept { background: linear-gradient(to right, var(--red-soft) 0%, white 30%); }
.q.kept::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--red);
}
.q-body .cat-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.cat-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.q.kept .cat-pill { background: var(--red); color: white; border-color: var(--red); }
.kept-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.q-body .text {
  font-size: 15.5px;
  line-height: 1.45;
  margin-bottom: 8px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.q-body .meta { font-size: 12px; color: var(--text-mute); }
.q-body .meta .author { color: var(--text-dim); font-weight: 500; }
.q.rejected { opacity: 0.45; }
.q.rejected .text { text-decoration: line-through; color: var(--text-dim); }
.q-actions { display: flex; gap: 4px; }
.act {
  width: 32px;
  height: 32px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.act:hover { border-color: var(--text); color: var(--text); }
.act.keep.on { background: var(--red); color: white; border-color: var(--red); }
.act.reject.on { background: var(--text); color: white; border-color: var(--text); }

/* ===== LOGIN ===== */
.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.login-wrap {
  width: 100%;
  max-width: 380px;
}
.login-wrap h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 40px;
  font-weight: 400;
  line-height: 1;
  margin-bottom: 8px;
}
.login-wrap h2 em { font-style: italic; color: var(--red); }
.login-wrap .sub {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 28px;
}

/* ===== FORM LAYOUT (form + side prize) ===== */
.form-layout {
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: minmax(0, 540px) 280px;
  gap: 40px;
  align-items: start;
}
.form-layout .form-wrap {
  max-width: none;
  width: 100%;
}

/* ===== PRIZE CARD (modern, sticky side card) ===== */
.prize-card {
  position: sticky;
  top: 28px;
  background: var(--text);
  color: #fff;
  border-radius: 18px;
  padding: 26px 24px 22px;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 30px 60px -20px rgba(10,10,10,0.45),
    0 10px 20px -10px rgba(10,10,10,0.25);
}
.prize-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(230,57,70,0.18), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(255,255,255,0.04), transparent 50%);
  z-index: -1;
  pointer-events: none;
}
.prize-accent {
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red) 30%, var(--red) 70%, transparent);
  opacity: 0.7;
}
.prize-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.62);
  margin-bottom: 18px;
}
.prize-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px rgba(230,57,70,0.7);
  animation: prizePulse 2.4s ease-in-out infinite;
}
@keyframes prizePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}
.prize-title {
  font-family: 'Instrument Serif', serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: #fff;
  margin-bottom: 22px;
}
.prize-title em {
  font-style: italic;
  color: #fff;
  background: linear-gradient(180deg, transparent 70%, rgba(230,57,70,0.55) 70%);
  padding: 0 2px;
}
.prize-value {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 16px;
}
.prize-value-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.prize-value-amount {
  font-family: 'Instrument Serif', serif;
  font-size: 38px;
  line-height: 1;
  color: #fff;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.prize-value-currency {
  font-size: 22px;
  color: var(--red);
  margin-left: 2px;
  font-style: italic;
}
.prize-footnote {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255,255,255,0.62);
}

/* Tablette : on garde le layout en grille mais on réduit un peu */
@media (max-width: 980px) {
  .form-layout {
    grid-template-columns: minmax(0, 540px) 240px;
    gap: 28px;
  }
}

/* Mobile : la prize-card passe AU-DESSUS du form, devient horizontale */
@media (max-width: 760px) {
  .form-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 540px;
  }
  .prize-card {
    position: static;
    order: -1;
    padding: 20px 22px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "label  value"
      "title  value"
      "foot   foot";
    column-gap: 16px;
    row-gap: 8px;
    align-items: center;
  }
  .prize-label { grid-area: label; margin-bottom: 0; }
  .prize-title {
    grid-area: title;
    font-size: 24px;
    margin-bottom: 0;
  }
  .prize-title br { display: none; }
  .prize-value {
    grid-area: value;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 10px;
  }
  .prize-value-amount { font-size: 28px; }
  .prize-value-currency { font-size: 16px; }
  .prize-footnote {
    grid-area: foot;
    font-size: 12px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  .header { padding: 16px 18px; }
  .brand-logo { width: 40px; height: 40px; }
  h1 { font-size: 42px; }
  .form-main { padding: 32px 20px; }
  .form-card { padding: 28px 22px; box-shadow: 4px 4px 0 var(--text); }
  .admin-main { padding: 24px 16px 40px; }
  .admin-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .admin-head .title-block h2 { font-size: 28px; }
  .q { grid-template-columns: 1fr; gap: 12px; }
  .thanks-content h2 { font-size: 42px; }
  .submit-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .counter-pill { justify-content: center; }
}
