/**
 * Funnel de qualification vendeur (composant reutilisable).
 *
 * Extrait de templates/page-estimer.php pour etre partage entre /estimer/ et les
 * landings vendeurs. Charge conditionnellement par inc/enqueue.php, uniquement
 * sur les gabarits qui affichent le funnel : mis en cache une fois, au lieu
 * d etre renvoye en inline a chaque page vue.
 *
 * Les regles propres a la page /estimer/ (fond de page, masquage du page-header)
 * restent dans son template.
 */

.estimer-page *,
.estimer-page *::before,
.estimer-page *::after { margin: 0; padding: 0; box-sizing: border-box; }

.estimer-page {
  --black: #111;
  --white: #fff;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e8e8e8;
  --gray-300: #d4d4d4;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --green-bg: #f0faf0;
  --green-dark: #166534;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --shadow: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.07);
  --transition: all .25s cubic-bezier(.4,0,.2,1);
  font-family: var(--font);
  color: var(--black);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.estimer-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
@media (min-width: 640px) { .estimer-container { padding: 40px 24px 64px; } }
@media (min-width: 768px) { .estimer-container { padding: 48px 32px 80px; } }

/* Fond image derriere tout le funnel : ombres renforcees pour faire flotter les cartes */
.estimer-intro, .estimer-confirm-card { box-shadow: 0 14px 38px rgba(40,30,18,.16); }
.estimer-header { padding-top: 12px; }

/* Header */
.estimer-header { text-align: center; margin-bottom: 32px; }
.estimer-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .75rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--black); margin-bottom: 16px;
}
.estimer-tag::before {
  content: ''; width: 8px; height: 8px;
  background: var(--black); flex-shrink: 0;
}
.estimer-title {
  font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em;
  line-height: 1.15; color: var(--black); margin-bottom: 12px;
}
@media (min-width: 640px) { .estimer-title { font-size: 2.25rem; } }
.estimer-subtitle {
  font-size: 1rem; color: var(--gray-600);
  max-width: 540px; margin: 0 auto; line-height: 1.55;
}

/* Intro card */
.estimer-intro {
  background: var(--white); border: 1px solid var(--gray-200);
  box-shadow: var(--shadow); padding: 32px 24px; text-align: center;
  margin-bottom: 24px;
}
@media (min-width: 640px) { .estimer-intro { padding: 40px 32px; } }
.estimer-intro__title {
  font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em;
  margin-bottom: 12px;
}
.estimer-intro__text {
  font-size: .92rem; color: var(--gray-600); line-height: 1.6;
  max-width: 480px; margin: 0 auto 24px;
}
.estimer-intro__features {
  display: flex; flex-direction: column; gap: 10px;
  max-width: 360px; margin: 0 auto 28px; text-align: left;
}
.estimer-intro__feature {
  display: flex; align-items: center; gap: 10px;
  font-size: .85rem; color: var(--gray-700); font-weight: 500;
}
.estimer-intro__feature svg {
  flex-shrink: 0; width: 18px; height: 18px; color: var(--black);
}

.estimer-btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 220px; padding: 14px 28px;
  background: var(--black); color: var(--white); border: none;
  font-family: var(--font); font-size: .95rem; font-weight: 600;
  cursor: pointer; transition: var(--transition); letter-spacing: -.01em;
}
.estimer-btn-primary:hover {
  background: var(--gray-700); transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.estimer-btn-primary:active { transform: translateY(0); }
.estimer-btn-primary:disabled { opacity: .35; cursor: not-allowed; transform: none; box-shadow: none; }
.estimer-btn-primary svg { width: 18px; height: 18px; flex-shrink: 0; }

.estimer-intro__note {
  font-size: .75rem; color: var(--gray-500); margin-top: 16px; line-height: 1.5;
}

/* Quiz container */
.estimer-quiz { display: none; }
.estimer-quiz.active { display: block; }

.estimer-progress-text {
  text-align: right; font-size: .72rem; font-weight: 600;
  color: var(--gray-500); margin-bottom: 6px;
}
.estimer-progress-bar {
  position: relative; height: 4px; background: var(--gray-200);
  margin-bottom: 28px; overflow: hidden;
}
.estimer-progress-fill {
  position: absolute; left: 0; top: 0; height: 100%;
  background: var(--black); transition: width .4s cubic-bezier(.4,0,.2,1);
}

.estimer-screen { display: none; animation: estimerFadeIn .4s ease; }
.estimer-screen.active { display: block; }
@keyframes estimerFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.estimer-q-number {
  font-size: .72rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--black); margin-bottom: 8px;
}
.estimer-q-text {
  font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em;
  line-height: 1.35; margin-bottom: 24px;
}
@media (min-width: 640px) { .estimer-q-text { font-size: 1.4rem; } }
.estimer-q-help {
  font-size: .82rem; color: var(--gray-500); margin-top: -16px;
  margin-bottom: 20px; line-height: 1.5;
}

/* Option list */
.estimer-option-list { display: flex; flex-direction: column; gap: 10px; }
.estimer-option-btn {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 16px 18px; background: var(--white);
  border: 1.5px solid var(--gray-300);
  cursor: pointer; transition: var(--transition); text-align: left;
  font-family: var(--font); font-size: .92rem; font-weight: 500; color: var(--black);
}
.estimer-option-btn:hover {
  border-color: var(--black); background: var(--gray-50); transform: translateX(4px);
}
.estimer-option-btn.selected {
  border-color: var(--black); background: var(--black); color: var(--white);
}
.estimer-option-btn .radio {
  width: 20px; height: 20px; border: 2px solid var(--gray-300);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: var(--transition);
}
.estimer-option-btn.selected .radio { border-color: var(--white); background: var(--white); }
.estimer-option-btn.selected .radio::after {
  content: ''; width: 8px; height: 8px; background: var(--black);
}

/* Inputs */
.estimer-form-group { margin-bottom: 20px; }
.estimer-label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--gray-700); margin-bottom: 6px; letter-spacing: .01em;
}
.estimer-page input[type="text"],
.estimer-page input[type="email"],
.estimer-page input[type="tel"] {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1.5px solid var(--gray-300);
  font-family: var(--font); font-size: .95rem; font-weight: 500;
  color: var(--black); background: var(--white);
  transition: var(--transition); outline: none;
}
.estimer-page input:focus {
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(17,17,17,.08);
}
.estimer-page input.error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}
.estimer-error-msg {
  font-size: .72rem; color: #dc2626; margin-top: 4px; display: none;
}
.estimer-error-msg.visible { display: block; }

/* Honeypot : hidden anti-bot field */
.estimer-honeypot {
  position: absolute !important; left: -9999px !important; opacity: 0 !important;
  pointer-events: none !important; height: 0 !important; width: 0 !important;
}

/* Navigation */
.estimer-nav-row {
  display: flex; justify-content: space-between;
  align-items: center; margin-top: 28px; gap: 12px;
}
.estimer-btn-back {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 20px; background: transparent;
  border: 1.5px solid var(--gray-300);
  font-family: var(--font); font-size: .88rem; font-weight: 600;
  color: var(--gray-600); cursor: pointer; transition: var(--transition);
}
.estimer-btn-back:hover { border-color: var(--black); color: var(--black); }
.estimer-btn-back svg { width: 16px; height: 16px; }
.estimer-btn-next {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 24px; background: var(--black); color: var(--white);
  border: none; font-family: var(--font); font-size: .88rem;
  font-weight: 600; cursor: pointer; transition: var(--transition); margin-left: auto;
}
.estimer-btn-next:hover {
  background: var(--gray-700); transform: translateY(-1px); box-shadow: var(--shadow-md);
}
.estimer-btn-next:disabled { opacity: .35; cursor: not-allowed; transform: none; box-shadow: none; }
.estimer-btn-next svg { width: 16px; height: 16px; }

/* Confirmation */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;600&display=swap');

.estimer-confirm { display: none; animation: estimerFadeIn .5s ease; }
.estimer-confirm.active { display: block; }
.estimer-confirm-card {
  background: var(--green-bg); border: 1.5px solid #22c55e;
  padding: 40px 24px; text-align: center;
}
@media (min-width: 640px) { .estimer-confirm-card { padding: 48px 32px; } }
.estimer-confirm-portrait {
  width: 120px; height: 120px; margin: 0 auto 20px;
  position: relative;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  border: 4px solid var(--white);
}
.estimer-confirm-portrait img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  display: block;
}
.estimer-confirm-portrait .checkmark-badge {
  position: absolute; bottom: -2px; right: -2px;
  width: 36px; height: 36px;
  background: #22c55e; color: var(--white);
  border: 3px solid var(--green-bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.estimer-confirm-portrait .checkmark-badge svg { width: 18px; height: 18px; }
.estimer-confirm-title {
  font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em;
  color: var(--green-dark); margin-bottom: 12px;
}
.estimer-confirm-text {
  font-size: .95rem; color: var(--gray-700); line-height: 1.6;
  max-width: 480px; margin: 0 auto 24px;
}
.estimer-confirm-handwritten {
  font-family: 'Caveat', 'Brush Script MT', 'Bradley Hand', cursive;
  font-size: 2rem; font-weight: 600;
  color: var(--green-dark);
  margin-top: 32px; line-height: 1;
  letter-spacing: 0.02em;
}
.estimer-confirm-signature {
  font-size: .82rem; color: var(--gray-600);
  margin-top: 6px; padding-top: 0; border-top: none;
  font-style: normal;
}

/* Submission error */
.estimer-submit-error {
  display: none; margin-top: 16px; padding: 14px 18px;
  background: #fff5f5; border: 1px solid #fecaca;
  color: #991b1b; font-size: .85rem; line-height: 1.5;
}
.estimer-submit-error.visible { display: block; }

/* Footer note */
.estimer-footer-note {
  text-align: center; padding: 24px 16px;
  font-size: .72rem; color: var(--gray-500);
  line-height: 1.6; max-width: 520px; margin: 24px auto 0;
}
.estimer-footer-note strong { font-weight: 600; color: var(--gray-600); }
