/* ============================================
   Prix Pascal — Formulaire de candidature
   Design system aligné sur prixpascal.fr
   ============================================ */

@font-face {
  font-family: 'Fraunces';
  src: url('/assets/fonts/fraunces.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('/assets/fonts/newsreader.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Hanken Grotesk';
  src: url('/assets/fonts/hankengrotesk.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --dark:    #0a0f2e;
  --accent:  #2f46a8;
  --nuance:  #ff9fb5;
  --light:   #f4f5fa;
  --white:   #ffffff;
  --soft:    rgba(10,15,46,0.55);
  --rule:    rgba(10,15,46,0.14);
  --tint:    #eef0f8;
  --success: #1a7f4b;
  --error:   #c0392b;
  --warning: #e67e22;

  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --text:    'Newsreader', Georgia, 'Times New Roman', serif;
  --ui:      'Hanken Grotesk', system-ui, -apple-system, sans-serif;

  /* compat avec ancien code */
  --black:       var(--dark);
  --white:       #ffffff;
  --grey:        var(--soft);
  --grey-light:  var(--tint);
  --grey-border: var(--rule);
  --font:        var(--text);
  --font-ui:     var(--ui);
  --radius:      6px;
  --max-w:       720px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--text);
  background: var(--light);
  color: var(--dark);
  line-height: 1.65;
  font-size: 1.05rem;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration: underline; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
  background: var(--dark);
  border-bottom: 2px solid var(--accent);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  display: flex;
  align-items: center;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.wordmark {
  font-family: var(--display);
  font-weight: 450;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--light);
}
.wordmark:hover { color: var(--nuance); text-decoration: none; }
.tagline {
  font-family: var(--ui);
  font-size: 0.8rem;
  color: rgba(244,245,250,0.45);
  letter-spacing: 0.01em;
}

/* Cartouche sociale */
.cartouche-mini {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 99999;
  display: flex;
  gap: 8px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.cartouche-mini:hover { opacity: 1; }
.cartouche-mini a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(244,245,250,0.1);
  border: 1px solid rgba(244,245,250,0.2);
  text-decoration: none;
  color: rgba(244,245,250,0.7);
  transition: all 0.15s;
  backdrop-filter: blur(4px);
}
.cartouche-mini a:hover {
  background: rgba(244,245,250,0.2);
  border-color: rgba(244,245,250,0.5);
  color: var(--light);
  transform: translateY(-1px);
}
.cartouche-mini svg { width: 15px; height: 15px; }

@media (max-width: 768px) {
  .cartouche-mini { top: 16px; right: 16px; }
}

/* ============================================
   LAYOUT
   ============================================ */
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 32px);
}

main.wrap {
  padding-top: 56px;
  padding-bottom: 80px;
}

/* ============================================
   FORM HEADER
   ============================================ */
.form-header {
  margin-bottom: 48px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--rule);
}

.form-header h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 350;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--dark);
  margin-bottom: 16px;
}

.intro {
  font-family: var(--text);
  font-size: 1rem;
  color: var(--soft);
  line-height: 1.7;
  max-width: 580px;
}
.intro strong { color: var(--dark); font-weight: 600; }

/* ============================================
   ERRORS
   ============================================ */
.errors {
  background: #fdf0ee;
  border: 1px solid rgba(192,57,43,0.25);
  border-left: 3px solid var(--error);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 32px;
  color: var(--error);
  font-family: var(--ui);
  font-size: 0.9rem;
}
.errors strong { display: block; margin-bottom: 8px; font-weight: 700; }
.errors ul { padding-left: 18px; }
.errors li { margin-bottom: 4px; }

/* ============================================
   FIELDSETS
   ============================================ */
fieldset {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 20px;
  background: var(--white);
  box-shadow: 0 1px 4px rgba(10,15,46,0.04);
}

legend {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0 10px;
  color: var(--accent);
  background: var(--white);
}

/* ============================================
   FIELDS
   ============================================ */
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }

label {
  display: block;
  font-family: var(--ui);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--dark);
  letter-spacing: -0.01em;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--text);
  font-size: 1rem;
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.5;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47,70,168,0.1);
}
textarea { resize: vertical; min-height: 180px; }

input::placeholder, textarea::placeholder {
  color: rgba(10,15,46,0.3);
  font-family: var(--ui);
  font-size: 0.9rem;
}

.hint {
  display: block;
  font-family: var(--ui);
  font-size: 0.78rem;
  color: var(--soft);
  margin-top: 6px;
  line-height: 1.5;
}
.char-counter {
  display: block;
  font-family: var(--ui);
  font-size: 0.72rem;
  color: var(--soft);
  text-align: right;
  margin-top: 4px;
}

/* ============================================
   UPLOAD ZONES
   ============================================ */
.upload-zone {
  border: 2px dashed var(--rule);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, background 0.2s;
  background: var(--light);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--tint);
}
.upload-zone.has-file {
  border-color: var(--success);
  border-style: solid;
  background: #f0faf4;
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.upload-icon { font-size: 1.8rem; }
.upload-label > span:nth-child(2) {
  font-family: var(--ui);
  font-size: 0.9rem;
  color: var(--dark);
  font-weight: 500;
}
.upload-hint {
  font-family: var(--ui);
  font-size: 0.75rem;
  color: var(--soft);
}

/* ============================================
   CHECKBOXES
   ============================================ */
.field--checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.field--checkbox input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}
.field--checkbox label {
  font-family: var(--ui);
  font-size: 0.875rem;
  color: var(--soft);
  cursor: pointer;
  font-weight: 400;
  letter-spacing: 0;
}
.field--checkbox label a { color: var(--accent); }

/* ============================================
   REQUIRED
   ============================================ */
.req { color: var(--error); margin-left: 2px; }
.req-note {
  font-family: var(--ui);
  font-size: 0.78rem;
  color: var(--soft);
  margin-bottom: 16px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-block;
  font-family: var(--ui);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 11px 24px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s, transform 0.15s;
  letter-spacing: -0.01em;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: #263d8f;
  border-color: #263d8f;
}
.btn-ghost {
  background: transparent;
  color: var(--dark);
  border-color: var(--rule);
}
.btn-ghost:hover { background: var(--tint); }
.btn-submit {
  width: 100%;
  padding: 15px;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.form-footer { margin-top: 32px; }

/* ============================================
   CONFIRMATION PAGE
   ============================================ */
.confirmation { text-align: center; padding: 48px 0; }
.confirmation-icon { font-size: 3rem; margin-bottom: 20px; }
.confirmation h1 {
  font-family: var(--display);
  font-size: 2.2rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.confirmation-lead {
  font-size: 1.05rem;
  color: var(--soft);
  margin-bottom: 36px;
}
.confirmation-card {
  text-align: left;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: 0 1px 4px rgba(10,15,46,0.05);
}
.confirmation-card h2 {
  font-family: var(--ui);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 16px;
}
.confirmation-card dl {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 8px 16px;
  font-size: 0.9rem;
}
.confirmation-card dt {
  font-family: var(--ui);
  font-weight: 600;
  color: var(--soft);
}
.confirmation-card code {
  font-size: 1rem;
  background: var(--tint);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--ui);
  color: var(--accent);
  font-weight: 700;
}
.confirmation-next { text-align: left; margin-bottom: 32px; }
.confirmation-next h2 {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 12px;
}
.confirmation-next ol {
  padding-left: 20px;
  font-size: 0.95rem;
  color: var(--soft);
}
.confirmation-next li { margin-bottom: 8px; }
.confirmation-footer {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   CLOSED BANNER
   ============================================ */
.closed-banner { text-align: center; padding: 64px 0; }
.closed-inner { max-width: 480px; margin: 0 auto; }
.closed-icon { font-size: 3rem; display: block; margin-bottom: 24px; }
.closed-banner h1 {
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.closed-banner p { color: var(--soft); margin-bottom: 12px; font-size: 0.95rem; }
.closed-cloture { font-size: 0.85rem; margin-bottom: 32px; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--dark);
  border-top: 1px solid rgba(244,245,250,0.1);
  padding: 24px 0;
  margin-top: 0;
}
.site-footer p {
  font-family: var(--ui);
  font-size: 0.78rem;
  color: rgba(244,245,250,0.4);
  text-align: center;
}
.site-footer a {
  color: rgba(244,245,250,0.6);
  text-decoration: none;
}
.site-footer a:hover { color: var(--nuance); }

/* ============================================
   ADMIN (préservé, non affiché sur le form)
   ============================================ */
.admin-body { background: var(--light); }
.admin-nav { margin-left: auto; display: flex; gap: 1rem; font-family: var(--ui); font-size: 0.85rem; }
.admin-main { max-width: 1200px; }
.admin-stats { display: flex; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.stat-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 24px;
  text-align: center;
  min-width: 120px;
}
.stat-n { display: block; font-size: 2rem; font-weight: 700; font-family: var(--display); }
.stat-label { font-family: var(--ui); font-size: 0.78rem; color: var(--soft); }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.85rem;
}
.admin-table th {
  font-family: var(--ui);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 12px;
  background: var(--tint);
  border-bottom: 1px solid var(--rule);
  text-align: left;
  color: var(--soft);
}
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.admin-table tr:last-child td { border-bottom: none; }
.graine-cell { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge {
  display: inline-block;
  font-family: var(--ui);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-soumis   { background: #e8f0fe; color: #1a56cc; }
.badge-en_revue { background: #fef9e7; color: #b7770d; }
.badge-nomme    { background: #e8f5e9; color: #2e7d32; }
.badge-laureat  { background: var(--dark); color: var(--light); }
.badge-rejete   { background: #fce8e6; color: #c62828; }
.statut-form { display: flex; gap: 6px; align-items: center; }
.statut-form select, .statut-form input[type="text"] {
  font-size: 0.78rem; padding: 4px 6px;
  border: 1px solid var(--rule); border-radius: 3px; font-family: var(--ui);
}
.statut-form input[type="text"] { width: 100px; }
.statut-form button {
  padding: 4px 10px; background: var(--accent); color: var(--white);
  border: none; border-radius: 3px; cursor: pointer; font-size: 0.78rem;
}
.admin-login { max-width: 360px; margin: 4rem auto; }
.row-statut-nomme  { background: #f0faf4; }
.row-statut-laureat { background: var(--tint); font-weight: 600; }
.row-statut-rejete { opacity: 0.5; }
.empty-state { text-align: center; padding: 48px; color: var(--soft); font-family: var(--ui); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 600px) {
  fieldset { padding: 20px 16px; }
  .form-header h1 { font-size: 1.8rem; }
  .confirmation-card dl { grid-template-columns: 1fr; }
  .confirmation-footer { flex-direction: column; }
}
