/* ============================================================
   LA VRAC ATTITUDE — Styles formulaires
   ============================================================ */

/* ── Layout formulaire ──────────────────────────────────── */
.form-wrap {
  max-width: 760px;
  margin: 0 auto;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
}
.form-grid .full { grid-column: 1 / -1; }

/* ── Champs ─────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.field label .req {
  color: var(--accent);
  margin-left: 2px;
}
.field input,
.field textarea,
.field select {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--tr), box-shadow var(--tr);
  width: 100%;
  appearance: none;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(74,136,40,.1);
}
.field input.error,
.field textarea.error {
  border-color: #C0392B;
  box-shadow: 0 0 0 3px rgba(192,57,43,.08);
}
.field input::placeholder,
.field textarea::placeholder { color: #B8B6AF; }
.field textarea { resize: vertical; min-height: 100px; }
.field-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.4;
}
.field-error {
  font-size: var(--text-xs);
  color: #C0392B;
  display: none;
}
.field.has-error .field-error { display: block; }

/* ── Counter +/- ────────────────────────────────────────── */
.counter {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--white);
  transition: border-color var(--tr);
}
.counter:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(74,136,40,.1);
}
.counter__btn {
  width: 40px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 300;
  color: var(--text-muted);
  background: var(--bg);
  border: none;
  cursor: pointer;
  transition: all var(--tr);
  flex-shrink: 0;
  line-height: 1;
}
.counter__btn:hover {
  background: var(--green-light);
  color: var(--green);
}
.counter__input {
  width: 60px !important;
  border: none !important;
  border-radius: 0 !important;
  border-left: 1.5px solid var(--border) !important;
  border-right: 1.5px solid var(--border) !important;
  text-align: center !important;
  padding: 0 !important;
  height: 44px;
  box-shadow: none !important;
  font-family: var(--font-display) !important;
  font-size: var(--text-base) !important;
  font-weight: 600 !important;
  color: var(--green) !important;
}
.counter__input::-webkit-inner-spin-button,
.counter__input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ── Récapitulatif produits ──────────────────────────────── */
.recap-box {
  background: var(--green-light);
  border: 1.5px solid rgba(74,136,40,.2);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-lg);
}
.recap-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--green);
  margin-bottom: var(--sp-sm);
  display: flex;
  align-items: center;
  gap: 7px;
}
.recap-title::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
}
.recap-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  padding: 5px 0;
  border-bottom: 1px solid rgba(74,136,40,.15);
  color: var(--text);
}
.recap-line:last-child { border-bottom: none; }
.recap-line span { color: var(--text-muted); }
.recap-zero { color: var(--text-muted) !important; font-style: italic; }

/* ── Séparateur section ──────────────────────────────────── */
.form-section-title {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--green);
  padding-bottom: var(--sp-sm);
  border-bottom: 2px solid var(--green-light);
  margin-bottom: var(--sp-md);
  margin-top: var(--sp-xl);
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-section-title:first-child { margin-top: 0; }
.form-section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Checkbox ────────────────────────────────────────────── */
.field-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.field-check input[type=checkbox] {
  width: 18px; height: 18px;
  min-width: 18px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  appearance: none;
  cursor: pointer;
  position: relative;
  transition: all var(--tr);
  background: var(--white);
  margin-top: 1px;
}
.field-check input[type=checkbox]:checked {
  background: var(--green);
  border-color: var(--green);
}
.field-check input[type=checkbox]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.field-check span {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.5;
}
.field-check a { color: var(--green); text-decoration: underline; }

/* ── Submit ──────────────────────────────────────────────── */
.form-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-md);
  margin-top: var(--sp-xl);
  padding-top: var(--sp-xl);
  border-top: 1px solid var(--border);
}
.form-submit-note {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── États envoi ─────────────────────────────────────────── */
.form-status {
  display: none;
  padding: var(--sp-md) var(--sp-lg);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-top: var(--sp-md);
}
.form-status.success {
  background: var(--green-light);
  border: 1.5px solid rgba(74,136,40,.25);
  color: var(--green-dark);
}
.form-status.error {
  background: #FCF0EE;
  border: 1.5px solid rgba(192,57,43,.2);
  color: #8B2015;
}
.btn--loading {
  opacity: .7;
  pointer-events: none;
  position: relative;
}
.btn--loading::after {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: 1; }
  .form-submit { flex-direction: column; align-items: stretch; }
  .form-submit .btn { text-align: center; justify-content: center; }
}
