/* ============================================================
 * Herbeth-Immobilier — formulaire candidature
 * Palette alignée sur le site principal herbeth-immobilier.com
 * ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --dark: #070707;            /* noir profond du site principal */
  --dark-alt: #252525;        /* gris très sombre */
  --text: #1F1A14;            /* couleur du logo (anthracite chaud) */
  --muted: #6c6c6c;
  --muted-2: #999;
  --bg: #f6f3ee;              /* crème très clair, complément de #d3c8be */
  --beige: #d3c8be;           /* accent beige sable du site principal */
  --beige-soft: #ebe4dc;
  --card: #ffffff;
  --border: #e0d9cf;
  --border-light: #efeae3;
  --danger: #b03030;
  --ok: #3a6b3a;

  --radius: 16px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(7,7,7,0.04);
  --shadow-md: 0 8px 32px rgba(7,7,7,0.06);
  --shadow-lg: 0 20px 60px rgba(7,7,7,0.1);
  --t: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  font-size: 16px;
  font-weight: 400;
}
a { color: inherit; }
img { display: block; max-width: 100%; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--dark);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar .wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #fff;
}
.brand-logo { height: 38px; width: auto; }

.back-link {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color 0.2s var(--t);
}
.back-link:hover { color: var(--beige); }

/* ---------- Page layout ---------- */
.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 56px 24px 72px;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  margin-bottom: 48px;
  animation: fade-up 0.6s var(--t) both;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 16px;
}
.eyebrow::after {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--text);
  margin: 14px auto 0;
}
.hero h1 {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.15;
  color: var(--dark);
  margin: 0 0 20px;
  letter-spacing: -1px;
}
.hero .lede {
  font-size: 16px;
  color: var(--muted);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.7;
  font-weight: 400;
}

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 44px 48px 36px;
  animation: fade-up 0.8s 0.1s var(--t) both;
  border: 1px solid var(--border-light);
}
@media (max-width: 640px) {
  .card { padding: 28px 22px; border-radius: 12px; }
  .page { padding: 36px 16px 56px; }
}

/* ---------- Progress ---------- */
.progress { margin-bottom: 32px; }
.progress-track {
  height: 3px;
  background: var(--beige-soft);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 20px;
}
.progress-fill {
  height: 100%;
  width: 20%;
  background: var(--dark);
  border-radius: 99px;
  transition: width 0.5s var(--t);
}
.progress-steps {
  display: flex;
  justify-content: space-between;
  max-width: 100%;
}
.step-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 600;
  display: grid;
  place-items: center;
  transition: all 0.4s var(--t);
  font-family: 'Sora', sans-serif;
}
.step-dot.is-active {
  background: var(--dark);
  color: var(--beige);
  border-color: var(--dark);
  transform: scale(1.08);
}
.step-dot.is-done {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.step-dot.is-done::before {
  content: '✓';
  font-size: 13px;
}
.step-dot.is-done > * { display: none; }

/* ---------- Steps ---------- */
.step {
  border: none;
  padding: 0;
  margin: 0;
  display: none;
  animation: fade-slide 0.5s var(--t);
}
.step.is-active { display: block; }
.step legend {
  width: 100%;
  margin-bottom: 28px;
  padding: 0;
}
.step-num {
  display: block;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.step-title {
  display: block;
  font-family: 'Sora', sans-serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.25;
  letter-spacing: -0.3px;
}

/* ---------- Fields ---------- */
.field { margin-bottom: 24px; }
.field label,
.block-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}
.req { color: var(--muted); font-weight: 500; margin-left: 2px; }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="date"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: 'Sora', sans-serif;
  font-weight: 400;
  color: var(--text);
  background: #fff;
  transition: all 0.2s var(--t);
  outline: none;
}
.field textarea { resize: vertical; min-height: 92px; line-height: 1.55; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--dark);
  box-shadow: 0 0 0 4px rgba(211,200,190,0.4);
}
.field input.is-invalid,
.field select.is-invalid,
.field textarea.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(176,48,48,0.08);
}
.field .hint {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.5;
}
.field .hint-top {
  margin: -2px 0 12px;
}
.field .err {
  font-size: 13px;
  color: var(--danger);
  margin: 8px 0 0;
  font-weight: 500;
  display: none;
}
.field.has-error .err { display: block; }

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 580px) { .row { grid-template-columns: 1fr; gap: 0; } }

.input-suffix { position: relative; }
.input-suffix input { padding-right: 42px; }
.input-suffix .suffix {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 500;
  pointer-events: none;
  font-size: 15px;
}

/* ---------- Select arrow ---------- */
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23070707' d='M5 6 0 0h10z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 42px;
  cursor: pointer;
}

/* ---------- Checkboxes multi-select ---------- */
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #fff;
  transition: all 0.2s var(--t);
  user-select: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
}
.check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--dark);
  cursor: pointer;
}
.check:hover { border-color: var(--text); background: var(--bg); }
.check:has(input:checked) {
  border-color: var(--dark);
  background: var(--beige-soft);
}
.check span { flex: 1; }
.field .err-grid {
  font-size: 13px;
  color: var(--danger);
  margin: 10px 0 0;
  font-weight: 500;
  display: none;
}
.field.has-error .err-grid { display: block; }

/* Champ texte conditionnel pour l'option "Autre" */
.other-input {
  width: 100%;
  padding: 12px 16px;
  margin-top: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: 'Sora', sans-serif;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: all 0.25s var(--t);
  animation: fade-up 0.3s var(--t);
}
.other-input:focus {
  border-color: var(--dark);
  box-shadow: 0 0 0 4px rgba(211,200,190,0.4);
}
.other-input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(176,48,48,0.08);
}
.check.is-other:has(input:checked) {
  border-color: var(--dark);
  background: var(--beige-soft);
}

/* ---------- Honeypot ---------- */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Consent ---------- */
.consent {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--muted);
  background: var(--beige-soft);
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  margin-top: 24px;
  line-height: 1.55;
}
.consent input {
  margin-top: 3px;
  accent-color: var(--dark);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ---------- Recap ---------- */
.recap {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 22px 24px;
  margin: 22px 0 0;
  border: 1px solid var(--border);
}
.recap h3 {
  margin: 0 0 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  font-weight: 600;
}
.recap-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 14px;
}
.recap-row:last-child { border-bottom: none; }
.recap-row span:first-child {
  font-size: 13px;
  color: var(--muted);
}
.recap-row span:last-child {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}
@media (max-width: 580px) {
  .recap-row { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- Buttons ---------- */
.nav {
  display: flex;
  gap: 12px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border-light);
  justify-content: space-between;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: var(--radius-sm);
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.2s var(--t);
  text-decoration: none;
  letter-spacing: 0.4px;
  min-width: 150px;
  text-transform: uppercase;
}
.btn.primary {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}
.btn.primary:hover:not(:disabled) {
  background: var(--text);
  border-color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(7,7,7,0.18);
}
.btn.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}
.btn.ghost:hover:not(:disabled) {
  color: var(--dark);
  border-color: var(--dark);
  background: #fff;
}
.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* L'attribut HTML hidden doit l'emporter sur display:inline-flex de .btn */
.btn[hidden] { display: none !important; }

.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn.is-loading .btn-label { opacity: 0.6; }
.btn.is-loading .btn-spinner { display: inline-block; }

/* ---------- Success ---------- */
.success {
  text-align: center;
  padding: 32px 0;
  animation: fade-up 0.6s var(--t);
}
.success h2 {
  font-family: 'Sora', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--dark);
  margin: 20px 0 14px;
  letter-spacing: -0.5px;
}
.success p {
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 8px;
  font-size: 16px;
  line-height: 1.6;
}
.success .small { font-size: 14px; margin-top: 12px; }
.success-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
  flex-wrap: wrap;
}

.success-icon { width: 88px; height: 88px; margin: 0 auto; }
.success-icon svg { width: 100%; height: 100%; }
.sc-circle {
  stroke: var(--ok);
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: stroke 0.7s var(--t) forwards;
}
.sc-check {
  stroke: var(--ok);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.4s 0.5s var(--t) forwards;
}

/* ---------- Error screen ---------- */
.error-screen {
  text-align: center;
  padding: 32px 0;
}
.error-screen h2 {
  font-family: 'Sora', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: 14px;
}
.error-screen p { color: var(--muted); margin-bottom: 24px; }
.error-screen .small { margin-top: 18px; font-size: 14px; }
.error-screen a { color: var(--dark); font-weight: 500; }

/* ---------- Footer ---------- */
.foot {
  background: var(--dark);
  color: rgba(255,255,255,0.55);
  padding: 36px 0;
  font-size: 13px;
}
.foot .wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.foot-brand { display: flex; align-items: center; gap: 16px; }
.foot-logo { height: 34px; width: auto; opacity: 0.95; }
.foot-tagline {
  font-size: 13px;
  color: var(--beige);
  margin: 0;
  font-style: italic;
  letter-spacing: 0.3px;
}
.foot-links { text-align: right; }
.foot-links p { margin: 0 0 4px; line-height: 1.6; }
.foot-links a { color: var(--beige); text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .foot .wrap { flex-direction: column; text-align: center; }
  .foot-links { text-align: center; }
}

/* ---------- Animations ---------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-slide {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes stroke { to { stroke-dashoffset: 0; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
