/* Prix Pascal — Formulaire de candidatures */

:root {
  --black: #111111;
  --white: #ffffff;
  --grey: #6b6b6b;
  --grey-light: #f5f5f3;
  --grey-border: #ddddd8;
  --accent: #111111;
  --error: #c0392b;
  --success: #27ae60;
  --warning: #e67e22;
  --font: 'Georgia', 'Times New Roman', serif;
  --font-ui: system-ui, -apple-system, sans-serif;
  --radius: 4px;
  --max-w: 720px;
}

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

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  line-height: 1.6;
}

a { color: var(--black); }
a:hover { text-decoration: underline; }

/* ---- Header ---- */
.site-header {
  border-bottom: 1px solid var(--grey-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.wordmark {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--black);
}
.tagline {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--grey);
}

/* ---- Layout ---- */
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}
main.wrap { padding-top: 3rem; padding-bottom: 4rem; }

/* ---- Formulaire fermé ---- */
.closed-banner {
  text-align: center;
  padding: 4rem 0;
}
.closed-inner {
  max-width: 500px;
  margin: 0 auto;
}
.closed-icon { font-size: 3rem; display: block; margin-bottom: 1.5rem; }
.closed-banner h1 {
  font-size: 1.8rem;
  line-height: 1.2;
  margin-bottom: 1.25rem;
}
.closed-banner p {
  color: var(--grey);
  margin-bottom: 1rem;
  font-size: 1rem;
}
.closed-cloture {
  font-size: 0.9rem;
  color: var(--grey);
  margin-bottom: 2rem;
}

/* ---- Bandeau test ---- */
.test-banner {
  background: #fff3cd;
  border: 1px solid #ffecb5;
  color: #856404;
  padding: 0.75rem 1rem;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
}

/* ---- Formulaire header ---- */
.form-header { margin-bottom: 2.5rem; border-bottom: 1px solid var(--grey-border); padding-bottom: 1.5rem; }
.form-header h1 { font-size: 2rem; margin-bottom: 0.75rem; }
.intro { color: var(--grey); font-size: 0.95rem; }

/* ---- Errors ---- */
.errors {
  background: #fdf0ee;
  border: 1px solid #f1c2bb;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  color: var(--error);
}
.errors ul { margin-top: 0.5rem; padding-left: 1.25rem; }
.errors li { margin-bottom: 0.25rem; font-size: 0.9rem; }

/* ---- Fieldsets ---- */
fieldset {
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
legend {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 0.5rem;
  color: var(--grey);
}

/* ---- Fields ---- */
.field { margin-bottom: 1.25rem; }
.field:last-child { margin-bottom: 0; }

label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  display: block;
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  color: var(--black);
  background: var(--white);
  transition: border-color 0.15s;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--black);
}
textarea { resize: vertical; min-height: 160px; }

.hint {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--grey);
  margin-top: 0.35rem;
}
.char-counter {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--grey);
  text-align: right;
  margin-top: 0.25rem;
}

/* ---- Upload zones ---- */
.upload-zone {
  border: 2px dashed var(--grey-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--black);
  background: var(--grey-light);
}
.upload-zone.has-file {
  border-color: var(--success);
  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: 0.4rem; pointer-events: none; }
.upload-icon { font-size: 2rem; }
.upload-hint { font-family: var(--font-ui); font-size: 0.78rem; color: var(--grey); }

/* ---- Checkbox fields ---- */
.field--checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.field--checkbox input[type="checkbox"] {
  margin-top: 0.25rem;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}
.field--checkbox label { font-size: 0.88rem; color: var(--grey); cursor: pointer; }

/* ---- Required ---- */
.req { color: var(--error); }
.req-note { font-family: var(--font-ui); font-size: 0.8rem; color: var(--grey); margin-bottom: 1rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.8; text-decoration: none; }
.btn-primary { background: var(--black); color: var(--white); }
.btn-ghost { background: transparent; color: var(--black); border-color: var(--grey-border); }
.btn-submit { width: 100%; padding: 0.85rem; font-size: 1rem; letter-spacing: 0.01em; }

.form-footer { margin-top: 2rem; }

/* ---- Confirmation ---- */
.confirmation { text-align: center; padding: 3rem 0; }
.confirmation-icon { font-size: 3rem; margin-bottom: 1.25rem; }
.confirmation h1 { font-size: 2rem; margin-bottom: 0.75rem; }
.confirmation-lead { font-size: 1.1rem; color: var(--grey); margin-bottom: 2rem; }
.confirmation-card {
  text-align: left;
  background: var(--grey-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.confirmation-card h2 { font-size: 1rem; margin-bottom: 1rem; font-family: var(--font-ui); }
.confirmation-card dl { display: grid; grid-template-columns: 8rem 1fr; gap: 0.5rem 1rem; font-size: 0.9rem; }
.confirmation-card dt { font-family: var(--font-ui); font-weight: 600; color: var(--grey); }
.confirmation-card code { font-size: 1rem; background: #e8e8e6; padding: 0.1rem 0.4rem; border-radius: 3px; }
.confirmation-next { text-align: left; margin-bottom: 2rem; }
.confirmation-next h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.confirmation-next ol { padding-left: 1.25rem; font-size: 0.95rem; color: var(--grey); }
.confirmation-next li { margin-bottom: 0.5rem; }
.confirmation-footer { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---- Admin ---- */
.admin-body { background: #fafaf8; }
.admin-nav { margin-left: auto; display: flex; gap: 1rem; font-family: var(--font-ui); font-size: 0.85rem; }
.admin-main { max-width: 1200px; }
.admin-stats { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.stat-card {
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  text-align: center;
  min-width: 120px;
}
.stat-n { display: block; font-size: 2rem; font-weight: 700; }
.stat-label { font-family: var(--font-ui); font-size: 0.8rem; color: var(--grey); }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.85rem;
}
.admin-table th {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.65rem 0.75rem;
  background: var(--grey-light);
  border-bottom: 1px solid var(--grey-border);
  text-align: left;
}
.admin-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--grey-border);
  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(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-soumis { background: #e8f0fe; color: #1a56cc; }
.badge-en_revue { background: #fef9e7; color: #b7770d; }
.badge-nomme { background: #e8f5e9; color: #2e7d32; }
.badge-laureat { background: #111; color: #fff; }
.badge-rejete { background: #fce8e6; color: #c62828; }

.statut-form { display: flex; gap: 0.4rem; align-items: center; }
.statut-form select, .statut-form input[type="text"] {
  font-size: 0.78rem; padding: 0.25rem 0.4rem; border: 1px solid var(--grey-border);
  border-radius: 3px; font-family: var(--font-ui);
}
.statut-form input[type="text"] { width: 100px; }
.statut-form button {
  padding: 0.25rem 0.5rem; background: var(--black); color: var(--white);
  border: none; border-radius: 3px; cursor: pointer; font-size: 0.78rem;
}
.admin-login { max-width: 360px; margin: 4rem auto; }
.admin-login h1 { margin-bottom: 1.5rem; }

.row-statut-nomme { background: #f0faf4; }
.row-statut-laureat { background: #f5f5f3; font-weight: 600; }
.row-statut-rejete { opacity: 0.5; }

.empty-state { text-align: center; padding: 3rem; color: var(--grey); font-family: var(--font-ui); }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--grey-border);
  padding: 1.5rem 0;
  margin-top: 2rem;
}
.site-footer p {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--grey);
  text-align: center;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .confirmation-card dl { grid-template-columns: 1fr; }
  .confirmation-footer { flex-direction: column; }
  .admin-table { font-size: 0.78rem; }
}
