/* ═══════════════════════════════════════════════════════════════
   ARS Devis — Formulaire public
   Version 1.0.0
   ═══════════════════════════════════════════════════════════════ */

.ars-devis {
  --brand:        #E94E1B;
  --brand-dark:   #B83A0F;
  --brand-light:  #FFF1EB;
  --accent:       #1E3A5F;
  --bg:           #FAFAF7;
  --surface:      #FFFFFF;
  --surface-alt:  #F5F5F0;
  --text:         #1A1A1A;
  --text-muted:   #6B7280;
  --border:       #E5E5E0;
  --border-focus: var(--brand);
  --success:      #059669;
  --error:        #DC2626;
  --radius:       8px;
  --radius-lg:    14px;
  --font-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --font-body:    'Figtree', ui-sans-serif, system-ui, sans-serif;
  --shadow-md:    0 4px 12px rgba(0,0,0,0.06);
  --transition:   200ms cubic-bezier(0.4, 0, 0.2, 1);

  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px;
  position: relative;
}
.ars-devis *, .ars-devis *::before, .ars-devis *::after { box-sizing: border-box; }

.ars-devis__header { text-align: center; margin-bottom: 40px; padding-top: 12px; }
.ars-devis__kicker {
  display: inline-block; font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--brand); background: var(--brand-light);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 16px;
}
.ars-devis__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(28px, 5vw, 42px); line-height: 1.1;
  letter-spacing: -0.02em; margin: 0 0 12px; color: var(--accent);
}
.ars-devis__title em { font-style: normal; color: var(--brand); }
.ars-devis__subtitle { color: var(--text-muted); font-size: 17px; max-width: 520px; margin: 0 auto; }

.ars-devis__form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px;
  box-shadow: var(--shadow-md);
}

.ars-devis__section {
  margin-bottom: 36px; padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
  animation: ars-fade-in 400ms ease-out;
}
.ars-devis__section:last-of-type { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.ars-devis__section[hidden] { display: none !important; }
/* Fix : l'attribut [hidden] doit écraser display:flex des champs conditionnels */
.ars-devis__field[hidden],
.ars-devis [hidden] { display: none !important; }
@keyframes ars-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.ars-devis__section-title {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-weight: 600; font-size: 20px;
  color: var(--accent); margin: 0 0 8px; letter-spacing: -0.01em;
}
.ars-devis__section-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; background: var(--accent); color: white;
  border-radius: 50%; font-size: 13px; font-weight: 600; font-family: var(--font-body);
}
.ars-devis__section-desc { color: var(--text-muted); font-size: 14px; margin: 0 0 20px; padding-left: 40px; }

.ars-devis__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.ars-devis__field { display: flex; flex-direction: column; gap: 6px; }
.ars-devis__field--full { grid-column: 1 / -1; }

.ars-devis__label { font-size: 14px; font-weight: 500; color: var(--text); }
.ars-devis__label .ars-devis__required { color: var(--brand); margin-left: 2px; }
.ars-devis__hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.ars-devis__input, .ars-devis__select, .ars-devis__textarea {
  width: 100%; padding: 11px 14px; font-family: inherit;
  font-size: 15px; color: var(--text); background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}
.ars-devis__input:focus, .ars-devis__select:focus, .ars-devis__textarea:focus {
  outline: none; border-color: var(--border-focus);
  box-shadow: 0 0 0 4px rgba(233, 78, 27, 0.12);
}
.ars-devis__input:invalid:not(:placeholder-shown) { border-color: var(--error); }

.ars-devis__select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%231A1A1A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px;
}

.ars-devis__textarea { resize: vertical; min-height: 110px; font-family: inherit; }

.ars-devis__cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ars-devis__card {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 18px 18px 52px; background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: all var(--transition);
}
.ars-devis__card:hover { border-color: var(--brand); background: var(--brand-light); }
.ars-devis__card input {
  position: absolute; top: 19px; left: 19px; width: 18px; height: 18px;
  margin: 0; accent-color: var(--brand); cursor: pointer;
}
.ars-devis__card-title { font-weight: 600; color: var(--text); font-size: 15px; }
.ars-devis__card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.ars-devis__card:has(input:checked) { border-color: var(--brand); background: var(--brand-light); box-shadow: 0 0 0 1px var(--brand); }

.ars-devis__submit-row { margin-top: 32px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ars-devis__submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 260px; padding: 14px 32px; font-family: var(--font-display);
  font-size: 16px; font-weight: 600; letter-spacing: 0.01em;
  color: white; background: var(--brand); border: none;
  border-radius: var(--radius); cursor: pointer;
  transition: all var(--transition); box-shadow: 0 4px 14px rgba(233, 78, 27, 0.25);
}
.ars-devis__submit:hover:not(:disabled) { background: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(233, 78, 27, 0.35); }
.ars-devis__submit:active:not(:disabled) { transform: translateY(0); }
.ars-devis__submit:disabled { opacity: 0.6; cursor: not-allowed; }
.ars-devis__submit-arrow { transition: transform var(--transition); }
.ars-devis__submit:hover .ars-devis__submit-arrow { transform: translateX(3px); }

.ars-devis__spinner {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white; border-radius: 50%;
  animation: ars-spin 600ms linear infinite; display: none;
}
.ars-devis--loading .ars-devis__spinner { display: inline-block; }
.ars-devis--loading .ars-devis__submit-arrow, .ars-devis--loading .ars-devis__submit-text { display: none; }
@keyframes ars-spin { to { transform: rotate(360deg); } }

.ars-devis__rgpd {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--text-muted); line-height: 1.5;
}
.ars-devis__rgpd input { margin-top: 2px; accent-color: var(--brand); cursor: pointer; }
.ars-devis__rgpd a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

.ars-devis__trust {
  display: flex; justify-content: center; gap: 24px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-muted); margin-top: 8px;
}
.ars-devis__trust span { display: inline-flex; align-items: center; gap: 6px; }
.ars-devis__trust svg { width: 14px; height: 14px; color: var(--success); }

.ars-devis__status {
  padding: 14px 18px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; text-align: center; display: none;
}
.ars-devis__status--success { background: #ECFDF5; color: var(--success); border: 1px solid #A7F3D0; }
.ars-devis__status--error { background: #FEF2F2; color: var(--error); border: 1px solid #FECACA; }
.ars-devis__status[data-visible="true"] { display: block; }

.ars-devis__honeypot {
  position: absolute !important; left: -9999px !important;
  width: 1px !important; height: 1px !important;
  opacity: 0 !important; pointer-events: none !important;
}

@media (max-width: 600px) {
  .ars-devis { padding: 20px 12px; }
  .ars-devis__form { padding: 24px 20px; }
  .ars-devis__grid, .ars-devis__cards { grid-template-columns: 1fr; }
  .ars-devis__submit { width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════
   ARS Stats — Bloc compteurs dynamiques Dolibarr
   Utilisation : [ars_stats]
   ═══════════════════════════════════════════════════════════════ */

.ars-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: 25px auto 0;
  padding: 22px 28px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(30, 64, 175, 0.06);
  border: 1px solid rgba(30, 58, 95, 0.08);
}

.ars-stats--dark {
  background: linear-gradient(135deg, #1E3A5F, #2a4a70);
  color: white;
  border: none;
  box-shadow: 0 10px 40px rgba(30, 58, 95, 0.3);
}

.ars-stats__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 4px;
}

.ars-stats__icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.ars-stats__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ars-stats__value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.ars-stats--dark .ars-stats__value {
  color: white !important;
}

.ars-stats__label {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
}

.ars-stats--dark .ars-stats__label {
  color: rgba(255, 255, 255, 0.75);
}

/* Séparateurs verticaux discrets entre items (desktop) */
@media (min-width: 640px) {
  .ars-stats__item:not(:last-child) {
    border-right: 1px solid rgba(30, 58, 95, 0.08);
    padding-right: 20px;
  }
  .ars-stats--dark .ars-stats__item:not(:last-child) {
    border-right-color: rgba(255, 255, 255, 0.15);
  }
}

/* Animation d'entrée */
.ars-stats__item {
  opacity: 0;
  transform: translateY(10px);
  animation: ars-stats-fadein 0.6s ease-out forwards;
}
.ars-stats__item:nth-child(1) { animation-delay: 0.0s; }
.ars-stats__item:nth-child(2) { animation-delay: 0.15s; }
.ars-stats__item:nth-child(3) { animation-delay: 0.3s; }
.ars-stats__item:nth-child(4) { animation-delay: 0.45s; }

@keyframes ars-stats-fadein {
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive mobile : 2 colonnes par défaut, 1 en très petit */
@media (max-width: 600px) {
  .ars-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 18px;
  }
  .ars-stats__value { font-size: 1.4rem; }
  .ars-stats__icon  { font-size: 1.6rem; }
}

@media (max-width: 380px) {
  .ars-stats { grid-template-columns: 1fr; }
}
