/*
 * Styles du formulaire /devis/ (page Next : app/devis/page.js).
 * Repris à l'identique de l'ancien devis/index.html. Le rendu du stepper est
 * piloté par schéma côté client (assets/js/devis-form.js) ; ce fichier ne fait
 * que la mise en forme.
 */

:root {
  --green: #00c100;
  --green-rgb: 0, 193, 0;
  --light-green: #4bde5a;
  --white: #fff;
  --black: #000;
  --gray: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);
  --radius: 18px;
}

@font-face {
  font-family: "Roboto Variable";
  src: url("/assets/font/Roboto-VariableFont_wdth,wght-subset.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Trivia Sans Book";
  src: url("/assets/font/TriviaSansBook-subset.woff2") format("woff2");
  font-weight: normal;
  font-display: swap;
}

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

html, body {
  height: 100%;
  background: var(--black);
  color: var(--white);
  font-family: "Trivia Sans Book", serif;
  overflow-x: hidden;
}

/* ── Custom cursor ── */
@media (pointer: fine) and (hover: hover) {
  html.has-custom-cursor, html.has-custom-cursor body { cursor: none !important; }
  html.has-custom-cursor * { cursor: none !important; }
  .cursor-dot {
    position: fixed; top: 0; left: 0;
    width: 8px; height: 8px; border-radius: 999px;
    background: var(--white); pointer-events: none;
    z-index: 999999; opacity: 0;
    transform: translate(-50%, -50%);
    will-change: top, left, width, height, background, box-shadow;
    transition: background 140ms ease, width 140ms ease, height 140ms ease,
                box-shadow 220ms ease, opacity 180ms ease;
  }
  .cursor-dot.is-hover { background: var(--green); width: 10px; height: 10px; }
  .cursor-dot.pulse { animation: cursor-vibe 420ms ease-out; }
  @keyframes cursor-vibe {
    0%   { transform: translate(-50%,-50%) scale(0.85); box-shadow: 0 0 0 0 rgba(var(--green-rgb),0), 0 0 0 0 rgba(var(--green-rgb),0); }
    35%  { transform: translate(-50%,-50%) scale(1.7);  box-shadow: 0 0 0 10px rgba(var(--green-rgb),.18), 0 0 18px 6px rgba(var(--green-rgb),.35); }
    100% { transform: translate(-50%,-50%) scale(1);    box-shadow: 0 0 0 0 rgba(var(--green-rgb),0), 0 0 0 0 rgba(var(--green-rgb),0); }
  }
}

/* ── Navbar ── */
.site-navbar {
  position: fixed; top: 0; left: 0; width: 100%;
  height: 72px; display: flex; align-items: center;
  justify-content: space-between; padding: 0 28px;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(12px);
  z-index: 1000; border-bottom: 1px solid var(--border);
}
.navbar-brand img { height: 24px; width: auto; display: block; }
.navbar-back {
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.55); text-decoration: none;
  font-size: 0.88rem; transition: color 0.2s;
}
.navbar-back:hover { color: var(--white); }
.navbar-back svg { width: 16px; height: 16px; }

/* ── Progress bar ── */
.progress-bar-track {
  position: fixed; top: 72px; left: 0; right: 0;
  height: 3px; background: rgba(255,255,255,0.08); z-index: 999;
}
.progress-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--green), var(--light-green));
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(var(--green-rgb), 0.6);
}

/* ── Step dots ── */
.step-dots {
  position: fixed; top: 88px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; z-index: 998;
}
.step-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.18);
  transition: all 0.3s ease;
}
.step-dot.active {
  background: var(--green);
  box-shadow: 0 0 8px rgba(var(--green-rgb), 0.7);
  width: 24px; border-radius: 4px;
}
.step-dot.done { background: rgba(var(--green-rgb), 0.45); }

/* ── Main layout ── */
.stepper-wrapper {
  min-height: 100vh; padding-top: 130px; padding-bottom: 60px;
  display: flex; align-items: flex-start; justify-content: center;
}
.stepper-inner {
  width: 100%; max-width: 660px; padding: 0 20px;
  position: relative; overflow: hidden;
}

/* ── Step panels ── */
.step-panel {
  position: absolute; width: calc(100% - 40px);
  top: 0; left: 20px;
  opacity: 0; pointer-events: none;
  transform: translateX(60px);
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.step-panel.active {
  opacity: 1; pointer-events: auto;
  transform: translateX(0);
  position: relative; left: 0; width: 100%;
}
.step-panel.exit-left {
  opacity: 0;
  transform: translateX(-60px);
}
.step-panel.exit-right {
  opacity: 0;
  transform: translateX(60px);
}

.step-label {
  font-size: 0.78rem; color: var(--green);
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 12px; font-family: "Roboto Variable", sans-serif;
  font-weight: 600;
}
.step-question {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  line-height: 1.2; font-weight: 700;
  margin-bottom: 8px; color: var(--white);
}
.step-hint {
  font-size: 0.9rem; color: rgba(255,255,255,0.45);
  margin-bottom: 28px; line-height: 1.5;
}

/* ── Option cards ── */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}
.options-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.options-grid.cols-1 { grid-template-columns: 1fr; }

.option-card {
  position: relative; display: flex; flex-direction: column;
  align-items: flex-start; gap: 8px;
  padding: 16px 16px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--gray);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
  user-select: none;
}
.option-card:hover {
  border-color: rgba(var(--green-rgb), 0.4);
  background: rgba(var(--green-rgb), 0.05);
  transform: translateY(-1px);
}
.option-card.selected {
  border-color: var(--green);
  background: rgba(var(--green-rgb), 0.1);
  box-shadow: 0 0 0 1px rgba(var(--green-rgb), 0.3), 0 4px 20px rgba(var(--green-rgb), 0.12);
}
.option-card.selected .option-check { opacity: 1; transform: scale(1); }

.option-icon {
  font-size: 1.6rem; line-height: 1;
  filter: grayscale(0.2);
}
.option-label {
  font-size: 0.95rem; font-weight: 700; color: var(--white); line-height: 1.3;
}
.option-sub {
  font-size: 0.78rem; color: rgba(255,255,255,0.42); line-height: 1.4;
}
.option-check {
  position: absolute; top: 12px; right: 12px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0.6);
  transition: opacity 0.2s, transform 0.2s;
}
.option-check svg { width: 11px; height: 11px; stroke: #000; stroke-width: 2.5; }

/* ── Budget slider style ── */
.budget-options {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 32px;
}
.budget-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--gray);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.budget-card:hover { border-color: rgba(var(--green-rgb), 0.4); background: rgba(var(--green-rgb), 0.05); }
.budget-card.selected {
  border-color: var(--green);
  background: rgba(var(--green-rgb), 0.1);
  box-shadow: 0 0 0 1px rgba(var(--green-rgb), 0.3);
}
.budget-range { font-weight: 700; font-size: 1rem; }
.budget-desc { font-size: 0.8rem; color: rgba(255,255,255,0.42); }
.budget-check {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0.6);
  transition: opacity 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.budget-card.selected .budget-check { opacity: 1; transform: scale(1); }
.budget-check svg { width: 11px; height: 11px; stroke: #000; stroke-width: 2.5; }

/* ── Text inputs ── */
.contact-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-bottom: 32px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label {
  font-size: 0.8rem; color: rgba(255,255,255,0.55);
  letter-spacing: 0.05em; text-transform: uppercase;
  font-family: "Roboto Variable", sans-serif; font-weight: 600;
}
.form-field label span.req { color: var(--green); }
.form-field input, .form-field textarea {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--white);
  font-family: "Trivia Sans Book", serif;
  font-size: 0.98rem;
  padding: 13px 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.form-field textarea { resize: none; height: 100px; }
.form-field input:focus, .form-field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.15);
}
.form-field input.error { border-color: #ff4d4d; }
.form-field .err-msg { font-size: 0.78rem; color: #ff7070; display: none; }
.form-field.has-error .err-msg { display: block; }
.form-field.has-error input { border-color: #ff4d4d; }

/* ── Buttons ── */
.step-actions {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 14px 28px;
  border-radius: 999px; border: none; cursor: pointer;
  font-family: "Trivia Sans Book", serif; font-size: 1rem;
  font-weight: 700; text-decoration: none;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--green); color: #000;
  box-shadow: 0 0 20px rgba(var(--green-rgb), 0.25);
}
.btn-primary:hover {
  background: var(--light-green);
  box-shadow: 0 0 28px rgba(var(--green-rgb), 0.45);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent; color: rgba(255,255,255,0.5);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--white); border-color: rgba(255,255,255,0.35); }
.btn svg { width: 18px; height: 18px; transition: transform 0.2s; }
.btn-primary:hover svg { transform: translateX(3px); }

/* ── Summary ── */
.summary-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.summary-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 16px;
  background: var(--gray); border: 1px solid var(--border);
  border-radius: 14px;
}
.summary-row-icon {
  font-size: 1.1rem; min-width: 24px; text-align: center;
  margin-top: 1px;
}
.summary-row-content { flex: 1; }
.summary-row-label { font-size: 0.75rem; color: rgba(255,255,255,0.4); margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.08em; }
.summary-row-value { font-size: 0.95rem; font-weight: 700; color: var(--white); }
.summary-edit {
  font-size: 0.78rem; color: rgba(var(--green-rgb), 0.8);
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: "Trivia Sans Book", serif;
  text-decoration: underline; text-underline-offset: 3px;
  transition: color 0.2s;
}
.summary-edit:hover { color: var(--green); }

/* ── Success ── */
.success-panel {
  text-align: center; padding: 48px 20px;
}
.success-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(var(--green-rgb), 0.12);
  border: 2px solid rgba(var(--green-rgb), 0.4);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  animation: pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.success-icon svg { width: 36px; height: 36px; stroke: var(--green); stroke-width: 2; }
@keyframes pop-in {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.success-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 12px; }
.success-sub { color: rgba(255,255,255,0.55); line-height: 1.6; max-width: 400px; margin: 0 auto 28px; }

/* ── Responsive ── */
@media (max-width: 520px) {
  .contact-form { grid-template-columns: 1fr; }
  .options-grid { grid-template-columns: 1fr 1fr; }
  .options-grid.cols-2 { grid-template-columns: 1fr; }
  .step-question { font-size: 1.45rem; }
}
@media (max-width: 360px) {
  .options-grid { grid-template-columns: 1fr; }
}
