/*
 * VeryWood B2B — front styles
 * Charte : fond noir, accent orange #f07818, typo Inter/system,
 *           uppercase + letter-spacing pour titres.
 * Sobre, éditorial, dans la lignée du menu principal.
 */

:root {
  --vwb2b-accent: #f07818;
  --vwb2b-accent-soft: rgba(240, 120, 24, 0.10);
  --vwb2b-accent-mid: rgba(240, 120, 24, 0.35);
  --vwb2b-text: #f2eee7;
  --vwb2b-text-mute: rgba(242, 238, 231, 0.55);
  --vwb2b-line: rgba(242, 238, 231, 0.16);
  --vwb2b-line-strong: rgba(242, 238, 231, 0.35);
  --vwb2b-danger: #c73a2f;
  --vwb2b-success: #6bb884;
  --vwb2b-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== TOGGLE SEGMENTÉ ========== */
.vwb2b-toggle {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0 0 2.5rem 0;
  padding: 0 0 1.5rem 0;
  border-bottom: 1px solid var(--vwb2b-line);
}

.vwb2b-toggle__opt {
  flex: 1 1 50%;
  background: transparent;
  border: 0;
  padding: 0.85rem 0.5rem 0.55rem;
  color: var(--vwb2b-text-mute);
  cursor: pointer;
  text-align: center;
  transition: color 260ms var(--vwb2b-ease);
  outline: none;
  border-radius: 0;
}

.vwb2b-toggle__opt:hover { color: var(--vwb2b-text); }

.vwb2b-toggle__opt.is-active { color: var(--vwb2b-text); }

.vwb2b-toggle__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.2;
}

.vwb2b-toggle__hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--vwb2b-text-mute);
  font-weight: 400;
  text-transform: none;
  opacity: 0.85;
}

.vwb2b-toggle__opt.is-active .vwb2b-toggle__hint { color: var(--vwb2b-accent); }

.vwb2b-toggle__indicator {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 50%;
  height: 2px;
  background: var(--vwb2b-accent);
  transition: transform 340ms var(--vwb2b-ease);
  transform: translateX(0);
  border-radius: 2px;
  box-shadow: 0 0 12px 0 rgba(240, 120, 24, 0.45);
}

.vwb2b-toggle.is-b2b .vwb2b-toggle__indicator { transform: translateX(100%); }

.vwb2b-toggle__opt:focus-visible {
  outline: 2px solid var(--vwb2b-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ========== CHAMPS PRO (cascade slideDown) ========== */
.vwb2b-pro-fields {
  overflow: hidden;
  margin-top: 0;
  padding: 1.75rem 0 0 0;
  border-top: 1px dashed var(--vwb2b-line);
  animation: vwb2b-slidedown 420ms var(--vwb2b-ease) both;
}

.vwb2b-pro-fields[hidden] { display: none !important; }

@keyframes vwb2b-slidedown {
  from { opacity: 0; transform: translateY(-8px); max-height: 0; padding-top: 0; }
  to   { opacity: 1; transform: translateY(0);    max-height: 1200px; padding-top: 1.75rem; }
}

/* Aligné sur .vwm-section__lede du theme (chapô descriptif) */
.vwb2b-pro-fields__intro {
  max-width: 680px;
  margin: 0 auto 1.75rem;
  color: #9ca3af;
  font-size: 1.05rem;
  line-height: 1.7;
  text-align: left;
  padding: 0;
  border: 0;
}

.vwb2b-field { margin-bottom: 1.35rem; }

.vwb2b-field label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--vwb2b-accent);
}

.vwb2b-field input,
.vwb2b-field select {
  width: 100%;
  padding: 0.85rem 1rem;
  background: transparent;
  border: 1px solid var(--vwb2b-line);
  color: var(--vwb2b-text);
  font-size: 0.95rem;
  font-family: inherit;
  border-radius: 4px;
  transition: border-color 200ms var(--vwb2b-ease), background 200ms var(--vwb2b-ease);
}

.vwb2b-field input:hover,
.vwb2b-field select:hover { border-color: var(--vwb2b-line-strong); }

.vwb2b-field input:focus,
.vwb2b-field select:focus {
  outline: none;
  border-color: var(--vwb2b-accent);
  background: rgba(240, 120, 24, 0.04);
}

.vwb2b-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23f07818' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.vwb2b-field-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .vwb2b-field-row { grid-template-columns: 1fr; }
}

.vwb2b-req { color: var(--vwb2b-accent); }

/* ========== INPUT TVA avec préfixe pays + statut ========== */
.vwb2b-vat-input {
  position: relative;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--vwb2b-line);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 200ms var(--vwb2b-ease);
}

.vwb2b-vat-input:hover { border-color: var(--vwb2b-line-strong); }
.vwb2b-vat-input:focus-within {
  border-color: var(--vwb2b-accent);
  background: rgba(240, 120, 24, 0.04);
}

.vwb2b-vat-input__prefix {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--vwb2b-accent);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  border-right: 1px solid var(--vwb2b-line);
  min-width: 3rem;
  justify-content: center;
}

.vwb2b-vat-input input {
  flex: 1;
  border: 0 !important;
  background: transparent !important;
  padding: 0.85rem 3rem 0.85rem 1rem !important;
}

.vwb2b-vat-input input:focus { background: transparent !important; }

.vwb2b-vat-input__status {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.vwb2b-vat-input__status.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(240, 120, 24, 0.25);
  border-top-color: var(--vwb2b-accent);
  border-radius: 50%;
  animation: vwb2b-spin 700ms linear infinite;
}

.vwb2b-vat-input__status.is-valid::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--vwb2b-success);
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%23000' d='M6.5 10.6L3.9 8l-1.1 1.1 3.7 3.7 8-8L13.4 3.7z'/></svg>") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%23000' d='M6.5 10.6L3.9 8l-1.1 1.1 3.7 3.7 8-8L13.4 3.7z'/></svg>") center/contain no-repeat;
}

.vwb2b-vat-input__status.is-invalid::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--vwb2b-danger);
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%23000' d='M12.7 4.4L11.6 3.3 8 6.9 4.4 3.3 3.3 4.4 6.9 8l-3.6 3.6 1.1 1.1L8 9.1l3.6 3.6 1.1-1.1L9.1 8z'/></svg>") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%23000' d='M12.7 4.4L11.6 3.3 8 6.9 4.4 3.3 3.3 4.4 6.9 8l-3.6 3.6 1.1 1.1L8 9.1l3.6 3.6 1.1-1.1L9.1 8z'/></svg>") center/contain no-repeat;
}

.vwb2b-vat-input__status.is-warn::before {
  content: "!";
  color: #e3a834;
  font-weight: 700;
  font-size: 14px;
}

@keyframes vwb2b-spin { to { transform: translateY(-50%) rotate(360deg); } }
.vwb2b-vat-input__status.is-loading { transform: translateY(-50%); }

/* Aligné sur .vw-section__desc (theme "Section lede") */
.vwb2b-vat-hint {
  margin-top: 0.6rem;
  color: #9ca3af;
  font-size: 1.05rem;
  line-height: 1.7;
  letter-spacing: 0;
}
.vwb2b-vat-hint strong {
  color: #f0ece4;
  font-weight: 500;
}

.vwb2b-vat-feedback {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  line-height: 1.45;
  min-height: 1.2em;
  transition: color 200ms var(--vwb2b-ease);
}

.vwb2b-vat-feedback.is-valid   { color: var(--vwb2b-success); }
.vwb2b-vat-feedback.is-invalid { color: var(--vwb2b-danger); }
.vwb2b-vat-feedback.is-warn    { color: #e3a834; }

.vwb2b-vat-feedback strong {
  color: inherit;
  font-weight: 600;
}

/* Auto-fill visuel du champ société */
input.vwb2b-autofilled {
  animation: vwb2b-flash 900ms var(--vwb2b-ease);
}

@keyframes vwb2b-flash {
  0%   { background: rgba(107, 184, 132, 0.20); }
  100% { background: transparent; }
}

/* ========== ENCART "PERK" (remise/intracom) ========== */
.vwb2b-pro-fields__perk {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-top: 1.5rem;
  padding: 1rem 1.15rem;
  background: var(--vwb2b-accent-soft);
  border-left: 2px solid var(--vwb2b-accent);
  border-radius: 3px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--vwb2b-text);
  animation: vwb2b-fadein 400ms var(--vwb2b-ease);
}

.vwb2b-perk__icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--vwb2b-accent);
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%23000' d='M8 1L2 4v4c0 3.5 2.5 6.5 6 7 3.5-.5 6-3.5 6-7V4L8 1zm-.6 9.2L5.2 8l1.1-1.1 1.1 1.1 3.3-3.3L11.8 6l-4.4 4.2z'/></svg>") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%23000' d='M8 1L2 4v4c0 3.5 2.5 6.5 6 7 3.5-.5 6-3.5 6-7V4L8 1zm-.6 9.2L5.2 8l1.1-1.1 1.1 1.1 3.3-3.3L11.8 6l-4.4 4.2z'/></svg>") center/contain no-repeat;
  margin-top: 2px;
}

@keyframes vwb2b-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== TOGGLE HTVA/TVAC HEADER ========== */
.vwb2b-tax-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.vwb2b-tax-toggle__opt {
  background: transparent;
  border: 0;
  padding: 0.15rem 0.35rem;
  color: var(--vwb2b-text-mute);
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  transition: color 200ms var(--vwb2b-ease);
}

.vwb2b-tax-toggle__opt:hover { color: var(--vwb2b-text); }
.vwb2b-tax-toggle__opt.is-active { color: var(--vwb2b-accent); }
.vwb2b-tax-toggle__sep { color: var(--vwb2b-text-mute); opacity: 0.5; }
