/*
 * HydPoll · Formulaire de demande de devis
 * --------------------------------------------------------------
 * Tous les sélecteurs sont préfixés .hp-devis pour ne pas
 * interférer avec le reste du thème WordPress.
 */

:root {
  --hp-bg: #fefefe;
  --hp-surface: #ffffff;
  --hp-surface-alt: #fafaf8;
  --hp-border: #e5e5e2;
  --hp-border-strong: #c9c9c4;
  --hp-text: #0a1628;
  --hp-text-muted: #5a6378;
  --hp-text-soft: #8a8f9c;
  --hp-accent: #d4623a;          /* HydPoll warm orange-brown */
  --hp-accent-hover: #b54f2c;
  --hp-accent-soft: #fbe9e1;
  --hp-success: #16a34a;
  --hp-success-soft: #dcfce7;
  --hp-error: #dc2626;
  --hp-error-soft: #fef2f2;
  --hp-radius: 10px;
  --hp-radius-sm: 6px;
  --hp-shadow: 0 1px 2px rgb(10 22 40 / 4%), 0 1px 3px rgb(10 22 40 / 6%);
  --hp-shadow-hover: 0 2px 8px rgb(10 22 40 / 8%), 0 4px 16px rgb(10 22 40 / 6%);
  --hp-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --hp-font-serif: 'Source Serif Pro', 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

/* ------------- Conteneur ------------- */
.hp-devis {
  max-width: 860px;
  margin: 2.5rem auto 4rem;
  padding: 0 1.25rem;
  color: var(--hp-text);
  font-family: var(--hp-font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hp-devis *,
.hp-devis *::before,
.hp-devis *::after {
  box-sizing: border-box;
}

/* ------------- En-tête ------------- */
.hp-devis__header {
  margin-bottom: 2.5rem;
  text-align: center;
}

.hp-devis__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--hp-accent);
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.hp-devis__title {
  font-family: var(--hp-font-serif);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 1rem;
  color: var(--hp-text);
}

.hp-devis__title em {
  color: var(--hp-accent);
  font-style: italic;
  font-weight: 500;
}

.hp-devis__lede {
  font-size: 1.0625rem;
  color: var(--hp-text-muted);
  max-width: 620px;
  margin: 0 auto;
}

/* ------------- Fieldsets ------------- */
.hp-devis__fieldset {
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius);
  padding: 1.75rem;
  margin: 0 0 1.5rem;
  background: var(--hp-surface);
  box-shadow: var(--hp-shadow);
}

.hp-devis__fieldset legend {
  font-family: var(--hp-font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--hp-text);
  padding: 0.2rem 0.6rem;
  background: var(--hp-surface);
  border: 1px solid var(--hp-border);
  border-radius: 999px;
  margin-left: -0.6rem;
}

.hp-devis__fieldset--rgpd {
  background: var(--hp-surface-alt);
}

/* ------------- Hints & labels ------------- */
.hp-devis__hint {
  font-size: 0.85rem;
  color: var(--hp-text-soft);
  margin: 0.25rem 0 1rem;
}

.hp-devis__hint-inline {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--hp-text-soft);
  margin-left: 0.25rem;
}

.hp-devis__req {
  color: var(--hp-accent);
  font-weight: 600;
}

.hp-devis__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------- Radios "cartes" ------------- */
.hp-devis__radio-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.hp-devis__radio-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1rem 1rem 1rem 1.25rem;
  border: 1.5px solid var(--hp-border);
  border-radius: var(--hp-radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  background: var(--hp-surface);
}

.hp-devis__radio-card:hover {
  border-color: var(--hp-border-strong);
  background: var(--hp-surface-alt);
}

.hp-devis__radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.hp-devis__radio-card:has(input:checked) {
  border-color: var(--hp-accent);
  background: var(--hp-accent-soft);
  box-shadow: 0 0 0 3px rgb(212 98 58 / 12%);
}

.hp-devis__radio-title {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.hp-devis__radio-desc {
  font-size: 0.85rem;
  color: var(--hp-text-muted);
}

/* ------------- Domaines (accordéon) ------------- */
.hp-devis__domains {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hp-devis__domain {
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius-sm);
  background: var(--hp-surface);
  overflow: hidden;
  transition: border-color .15s;
}

.hp-devis__domain[open] {
  border-color: var(--hp-border-strong);
}

.hp-devis__domain summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  user-select: none;
  font-size: 0.95rem;
}

.hp-devis__domain summary::-webkit-details-marker {
  display: none;
}

.hp-devis__domain summary::after {
  content: "";
  margin-left: auto;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--hp-text-muted);
  border-bottom: 2px solid var(--hp-text-muted);
  transform: rotate(45deg);
  transition: transform .2s;
}

.hp-devis__domain[open] summary::after {
  transform: rotate(-135deg);
}

.hp-devis__subdomains {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.4rem 1rem;
  padding: 0.25rem 1rem 1.1rem 2.6rem;
}

.hp-devis__subdomains label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  color: var(--hp-text-muted);
  cursor: pointer;
}

.hp-devis__subdomains input[type="checkbox"] {
  accent-color: var(--hp-accent);
  width: 1rem;
  height: 1rem;
}

/* ------------- Grille de champs ------------- */
.hp-devis__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem 1.25rem;
}

.hp-devis__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  grid-column: span 12;
}

.hp-devis__field--quart { grid-column: span 3; }
.hp-devis__field--tiers { grid-column: span 4; }
.hp-devis__field--demi { grid-column: span 6; }
.hp-devis__field--deux-tiers { grid-column: span 8; }
.hp-devis__field--plein { grid-column: span 12; }

@media (max-width: 640px) {
  .hp-devis__field--quart,
  .hp-devis__field--tiers,
  .hp-devis__field--demi,
  .hp-devis__field--deux-tiers {
    grid-column: span 12;
  }
}

.hp-devis__field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--hp-text);
}

.hp-devis__field input,
.hp-devis__field select,
.hp-devis__field textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--hp-text);
  background: var(--hp-surface);
  border: 1.5px solid var(--hp-border);
  border-radius: var(--hp-radius-sm);
  transition: border-color .15s, box-shadow .15s;
}

.hp-devis__field textarea {
  resize: vertical;
  min-height: 8rem;
  line-height: 1.55;
}

.hp-devis__field input:focus,
.hp-devis__field select:focus,
.hp-devis__field textarea:focus {
  outline: none;
  border-color: var(--hp-accent);
  box-shadow: 0 0 0 3px rgb(212 98 58 / 18%);
}

.hp-devis__field input:invalid:not(:placeholder-shown):not(:focus),
.hp-devis__field select:invalid:not(:focus),
.hp-devis__field textarea:invalid:not(:placeholder-shown):not(:focus) {
  border-color: var(--hp-error);
}

/* ------------- Dropzone pièces jointes ------------- */
.hp-devis__dropzone {
  position: relative;
  border: 2px dashed var(--hp-border-strong);
  border-radius: var(--hp-radius);
  background: var(--hp-surface-alt);
  transition: border-color .15s, background .15s;
}

.hp-devis__dropzone.is-dragover {
  border-color: var(--hp-accent);
  background: var(--hp-accent-soft);
}

.hp-devis__dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.hp-devis__dropzone-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--hp-text-muted);
  pointer-events: none;
}

.hp-devis__dropzone-title {
  font-weight: 600;
  color: var(--hp-text);
}

.hp-devis__dropzone-meta {
  font-size: 0.85rem;
}

.hp-devis__file-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hp-devis__file-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.85rem;
  background: var(--hp-surface);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius-sm);
  font-size: 0.9rem;
}

.hp-devis__file-list .hp-devis__file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hp-devis__file-list .hp-devis__file-size {
  color: var(--hp-text-soft);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.hp-devis__file-list .hp-devis__file-remove {
  background: transparent;
  border: none;
  color: var(--hp-text-soft);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 4px;
}

.hp-devis__file-list .hp-devis__file-remove:hover {
  color: var(--hp-error);
  background: var(--hp-error-soft);
}

/* ------------- Checkboxes RGPD ------------- */
.hp-devis__checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  font-size: 0.9rem;
  color: var(--hp-text-muted);
  cursor: pointer;
}

.hp-devis__checkbox-card + .hp-devis__checkbox-card {
  border-top: 1px solid var(--hp-border);
  margin-top: 0.5rem;
}

.hp-devis__checkbox-card input[type="checkbox"] {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: var(--hp-accent);
  cursor: pointer;
}

.hp-devis__checkbox-card a {
  color: var(--hp-accent);
  font-weight: 500;
}

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

/* ------------- Bouton & actions ------------- */
.hp-devis__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  margin-top: 1.5rem;
}

.hp-devis__status {
  margin: 0;
  font-size: 0.9rem;
  min-height: 1.25rem;
  text-align: center;
}

.hp-devis__status.is-error {
  color: var(--hp-error);
}

.hp-devis__status.is-info {
  color: var(--hp-text-muted);
}

.hp-devis__submit {
  position: relative;
  appearance: none;
  border: none;
  cursor: pointer;
  background: var(--hp-text);
  color: white;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.95rem 2rem;
  border-radius: var(--hp-radius-sm);
  transition: background .15s, transform .05s;
  align-self: center;
  min-width: 240px;
}

.hp-devis__submit:hover:not(:disabled) {
  background: var(--hp-accent);
}

.hp-devis__submit:active:not(:disabled) {
  transform: translateY(1px);
}

.hp-devis__submit:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.hp-devis__submit-spinner {
  display: none;
  position: absolute;
  top: 50%;
  right: 1.1rem;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: -0.55rem;
  border: 2px solid rgb(255 255 255 / 30%);
  border-top-color: white;
  border-radius: 50%;
  animation: hp-spin .8s linear infinite;
}

.hp-devis__submit.is-loading .hp-devis__submit-spinner {
  display: block;
}

@keyframes hp-spin {
  to { transform: rotate(360deg); }
}

/* ------------- Légal ------------- */
.hp-devis__legal {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--hp-text-soft);
}

.hp-devis__legal a {
  color: var(--hp-accent);
}

/* ------------- Écran de succès ------------- */
.hp-devis__success {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--hp-success-soft);
  border-radius: var(--hp-radius);
  margin-bottom: 1.5rem;
  color: var(--hp-text);
}

.hp-devis__success-icon {
  width: 64px;
  height: 64px;
  color: var(--hp-success);
  margin: 0 auto 1rem;
  display: block;
}

.hp-devis__success h2 {
  font-family: var(--hp-font-serif);
  font-size: 1.75rem;
  margin: 0 0 0.75rem;
}

.hp-devis__success p {
  margin: 0 0 0.5rem;
  color: var(--hp-text-muted);
}

.hp-devis__success strong {
  color: var(--hp-text);
}

.hp-devis__success-meta {
  font-size: 0.9rem;
  margin-top: 1.25rem !important;
}

/* ------------- Responsive ------------- */
@media (max-width: 540px) {
  .hp-devis {
    padding: 0 0.75rem;
  }
  .hp-devis__fieldset {
    padding: 1.25rem 1rem;
  }
  .hp-devis__subdomains {
    padding-left: 1.75rem;
  }
}

/* =================================================================
 * HERO
 * ================================================================= */
.hp-devis-hero {
  position: relative;
  margin: -2.5rem -1.25rem 2.5rem;
  padding: clamp(3rem, 8vw, 5rem) 1.5rem clamp(2.5rem, 6vw, 4rem);
  border-radius: 0 0 var(--hp-radius) var(--hp-radius);
  background:
    radial-gradient(circle at 80% 0%, rgba(212, 98, 58, 0.18), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(212, 98, 58, 0.08), transparent 45%),
    linear-gradient(135deg, #0a1628 0%, #142035 55%, #1a2b4a 100%);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

/* Décor topographique en SVG (lignes de niveau stylisées) */
.hp-devis-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .25;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 400' preserveAspectRatio='xMidYMid slice'><g fill='none' stroke='%23ffffff' stroke-width='1' opacity='.45'><path d='M0,200 Q200,140 400,200 T800,200'/><path d='M0,240 Q200,180 400,240 T800,240'/><path d='M0,280 Q200,220 400,280 T800,280'/><path d='M0,160 Q200,100 400,160 T800,160'/><path d='M0,120 Q200,60 400,120 T800,120'/><path d='M0,320 Q200,260 400,320 T800,320'/></g></svg>");
  background-size: cover;
  background-position: center;
}

.hp-devis-hero__inner {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.hp-devis-hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .72rem;
  font-weight: 600;
  color: var(--hp-accent);
  margin: 0 0 1.25rem;
}

.hp-devis-hero__title {
  font-family: var(--hp-font-serif);
  font-size: clamp(2rem, 5.5vw, 3.25rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.01em;
  margin: 0 0 1.25rem;
  color: #fff;
}
.hp-devis-hero__title em {
  color: var(--hp-accent);
  font-style: italic;
  font-weight: 500;
}

.hp-devis-hero__lede {
  font-size: clamp(0.95rem, 1.5vw, 1.0625rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, .82);
  margin: 0 auto 2.5rem;
  max-width: 580px;
}

.hp-devis-hero__stats {
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
@media (max-width: 640px) {
  .hp-devis-hero__stats { grid-template-columns: repeat(2, 1fr); gap: 1.25rem .75rem; }
}

.hp-devis-hero__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: 0 .25rem;
  border-left: 1px solid rgba(255, 255, 255, .12);
}
.hp-devis-hero__stat:first-child { border-left: none; }
@media (max-width: 640px) {
  .hp-devis-hero__stat { border-left: none; }
  .hp-devis-hero__stat:nth-child(odd)::after {
    content: '';
    position: absolute;
  }
}

.hp-devis-hero__stat strong {
  font-family: var(--hp-font-serif);
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 600;
  color: #fff;
  line-height: 1;
  letter-spacing: -.01em;
}
.hp-devis-hero__stat strong sup {
  font-size: .55em;
  color: var(--hp-accent);
  margin-left: 1px;
}
.hp-devis-hero__stat span {
  font-size: .78rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, .65);
  text-transform: uppercase;
  letter-spacing: .06em;
  text-align: center;
}

.hp-devis-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  padding: .95rem 2rem;
  background: var(--hp-accent);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 999px;
  text-decoration: none;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 4px 12px rgba(212, 98, 58, .35);
}
.hp-devis-hero__cta:hover {
  background: var(--hp-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212, 98, 58, .5);
}
.hp-devis-hero__cta:active {
  transform: translateY(0);
}
.hp-devis-hero__cta svg {
  transition: transform .15s;
}
.hp-devis-hero__cta:hover svg {
  transform: translateY(2px);
}

/* Sur mobile, marges négatives ajustées */
@media (max-width: 540px) {
  .hp-devis-hero {
    margin-left: -.75rem;
    margin-right: -.75rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}
