:root {
  --va-bois: #8a5a34;
  --va-bois-fonce: #5c3a20;
  --va-vert: #4a7c3c;
  --va-vert-clair: #eef4ea;
  --va-fond: #faf7f2;
  --va-texte: #2c2620;
  --va-texte-doux: #6b6155;
  --va-bordure: #e3dbcc;
  --va-erreur: #b3261e;
  --va-erreur-fond: #fbeae9;
}

.va-form,
.va-form *,
.va-form *::before,
.va-form *::after {
  box-sizing: border-box;
}

.va-form * {
  min-width: 0;
}

.va-form {
  --va-bois: #8a5a34;
  --va-bois-fonce: #5c3a20;
  --va-vert: #4a7c3c;
  --va-vert-clair: #eef4ea;
  --va-fond: #faf7f2;
  --va-texte: #2c2620;
  --va-texte-doux: #6b6155;
  --va-bordure: #e3dbcc;
  --va-erreur: #b3261e;
  --va-erreur-fond: #fbeae9;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--va-texte);
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  overflow-x: hidden;
}

.va-section {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--va-bordure);
  border-radius: 12px;
  background: var(--va-fond);
  padding: 1.5rem 1.5rem 1.75rem;
  margin: 0 0 1.75rem;
}

.va-section__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--va-bois-fonce);
  padding: 0 0.4rem;
}

.va-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.va-field--grow { flex: 1 1 auto; }

.va-row {
  display: flex;
  gap: 1rem;
}
.va-row .va-field { flex: 1; }

.va-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--va-texte);
}

.va-field__hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--va-texte-doux);
}

.va-form input[type="text"],
.va-form input[type="tel"],
.va-form input[type="email"],
.va-form input[type="time"],
.va-form input[type="number"],
.va-form select,
.va-form textarea {
  width: 100%;
  max-width: 100%;
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--va-bordure);
  border-radius: 8px;
  background: #fff;
  color: var(--va-texte);
}

.va-form input[type="file"]:not([hidden]) {
  display: block;
  width: 100%;
  max-width: 100%;
  font: inherit;
  font-size: 0.82rem;
  padding: 0.6rem 0.5rem;
  border: 1px solid var(--va-bordure);
  border-radius: 8px;
  background: #fff;
  color: var(--va-texte);
}

.va-form input[hidden] {
  display: none !important;
}

.va-form input:focus,
.va-form select:focus,
.va-form textarea:focus {
  outline: 2px solid var(--va-vert);
  outline-offset: 1px;
}

.va-form input.va-invalid,
.va-form select.va-invalid {
  border-color: var(--va-erreur);
  background: var(--va-erreur-fond);
}

.va-photo-buttons {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.va-photo-buttons .va-btn {
  flex: 1 1 auto;
  white-space: nowrap;
}

.va-photos-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.va-photo-thumb {
  position: relative;
  width: 64px;
  height: 64px;
}
.va-photo-thumb img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--va-bordure);
  display: block;
}
.va-photo-thumb__remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--va-erreur);
  color: #fff;
  border: 2px solid #fff;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.va-product-picker {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.va-btn {
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.25rem;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.va-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.va-btn--secondary {
  background: var(--va-vert-clair) !important;
  color: var(--va-vert) !important;
}
.va-btn--secondary:hover:not(:disabled) { opacity: 0.85; }
.va-btn--primary {
  background: var(--va-bois-fonce) !important;
  color: #fff !important;
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
}
.va-btn--primary:hover:not(:disabled) { opacity: 0.9; }

.va-lines-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}
.va-lines-table thead th {
  text-align: left;
  color: var(--va-texte-doux);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--va-bordure);
}
.va-lines-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--va-bordure);
  vertical-align: middle;
  overflow-wrap: break-word;
  word-break: break-word;
}
.va-lines-empty td {
  color: var(--va-texte-doux);
  font-style: italic;
  border-bottom: none;
}
.va-line-remove {
  background: none;
  border: none;
  color: var(--va-erreur);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
}
.va-line-remove:hover { text-decoration: underline; }

.va-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.9rem;
  margin: 0.75rem 0;
  cursor: pointer;
}
.va-checkbox input { margin-top: 0.2rem; }
.va-checkbox--accept {
  background: var(--va-vert-clair);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-weight: 500;
}

.va-invoice {
  background: #fff;
  border: 1px solid var(--va-bordure);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.va-invoice__title {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  color: var(--va-bois-fonce);
}
.va-invoice__lines {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.88rem;
  color: var(--va-texte);
}
.va-invoice__line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.va-invoice__line--pending { color: var(--va-texte-doux); font-style: italic; }
.va-invoice__empty { color: var(--va-texte-doux); font-style: italic; margin: 0; }
.va-invoice__total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--va-bois-fonce);
  border-top: 1px solid var(--va-bordure);
  margin-top: 0.6rem;
  padding-top: 0.6rem;
}

.va-form-errors {
  color: var(--va-erreur);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.va-form-errors:empty { display: none; }

.va-form-success {
  margin-top: 1rem;
  background: var(--va-vert-clair);
  color: var(--va-vert);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-weight: 600;
  text-align: center;
}

@media (max-width: 560px) {
  .va-row { flex-direction: column; gap: 0; }
  .va-product-picker { flex-direction: column; align-items: stretch; }
  .va-product-picker .va-field { max-width: 100% !important; }
  .va-lines-table { font-size: 0.82rem; word-break: break-word; }
  .va-lines-table td, .va-lines-table th { padding: 0.45rem 0.35rem; }
}

/* ═══════════════ Espace client ═══════════════ */

.va-portal {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--va-texte, #2c2620);
}

.va-portal__title { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--va-bois-fonce, #5c3a20); }
.va-portal__hint { color: var(--va-texte-doux, #6b6155); line-height: 1.5; margin-bottom: 1.25rem; }
.va-portal__hint a { color: var(--va-vert, #4a7c3c); font-weight: 600; }
.va-portal__lost { margin-top: 0.75rem; font-size: 0.9rem; }
.va-portal__lost a { color: var(--va-texte-doux, #6b6155); }

.va-portal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.va-portal__logout {
  font-size: 0.85rem;
  color: var(--va-erreur, #b3261e);
  text-decoration: none;
  font-weight: 600;
}
.va-portal__logout:hover { text-decoration: underline; }

.va-portal__section {
  background: var(--va-fond, #faf7f2);
  border: 1px solid var(--va-bordure, #e3dbcc);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.va-portal__section h3 {
  font-size: 1.05rem;
  color: var(--va-bois-fonce, #5c3a20);
  margin-bottom: 1rem;
}

.va-portal__loading, .va-portal__empty { color: var(--va-texte-doux, #6b6155); font-style: italic; }
.va-portal__error { color: var(--va-erreur, #b3261e); }

.va-portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.va-portal-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--va-texte-doux, #6b6155);
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--va-bordure, #e3dbcc);
}
.va-portal-table td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--va-bordure, #e3dbcc);
}

.va-status {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--va-vert-clair, #eef4ea);
  color: var(--va-vert, #4a7c3c);
}

.va-portal__save-msg { margin-left: 0.75rem; font-size: 0.85rem; color: var(--va-texte-doux, #6b6155); }
.va-portal__save-msg--ok { color: var(--va-vert, #4a7c3c); font-weight: 600; }
.va-portal__save-msg--error { color: var(--va-erreur, #b3261e); font-weight: 600; }

.va-portal input:disabled { background: #f0ede6; color: var(--va-texte-doux, #6b6155); }

/* Formulaire de connexion natif WordPress (wp_login_form) — classes différentes du reste du plugin */
.va-portal, .va-portal *, .va-portal *::before, .va-portal *::after {
  box-sizing: border-box;
}

.va-portal p.login-username,
.va-portal p.login-password {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.va-portal p.login-username label,
.va-portal p.login-password label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--va-texte, #2c2620);
}
.va-portal input.input {
  width: 100%;
  max-width: 100%;
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--va-bordure, #e3dbcc);
  border-radius: 8px;
  background: #fff;
  color: var(--va-texte, #2c2620);
}
.va-portal p.login-remember {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.va-portal p.login-remember label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.va-portal p.login-submit {
  margin-top: 0.5rem;
}
.va-portal input[type="submit"] {
  width: 100%;
  background: var(--va-bois-fonce, #5c3a20) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 0.7rem 1.25rem !important;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}
.va-portal input[type="submit"]:hover {
  opacity: 0.9;
}

/* Bloc information de paiement (formulaire + espace client) */
.va-payment-info {
  background: var(--va-vert-clair, #eef4ea);
  border: 1px solid var(--va-vert, #4a7c3c);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin: 0.5rem 0 1rem;
  font-size: 0.9rem;
}
.va-payment-info strong { color: var(--va-vert, #4a7c3c); display: block; margin-bottom: 0.3rem; }
.va-payment-info p { margin: 0; }
.va-payment-info a { color: var(--va-bois-fonce, #5c3a20); font-weight: 600; }

/* Logo en en-tête (formulaire + espace client) */
.va-logo-header {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
  background: transparent;
}
.va-logo {
  max-width: 64px !important;
  width: 64px !important;
  height: auto !important;
  background: transparent;
  opacity: 0.85;
}

.va-calendar-link-wrap {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0 2rem;
}
.va-calendar-link {
  display: inline-block;
  text-decoration: none;
  text-align: center;
}


.va-edit-banner {
  background: var(--va-vert-clair);
  color: var(--va-vert);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* En-tête uniforme : logo à gauche, bouton d'action à sa droite, nav à droite */
.va-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.va-page-header__left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}
.va-logo--lg {
  max-width: 72px !important;
  width: 72px !important;
  height: auto !important;
  opacity: 0.9;
  flex-shrink: 0;
}
.va-page-header__action {
  white-space: nowrap;
  font-size: 0.85rem;
  padding: 0.6rem 1.1rem !important;
  display: inline-block;
  margin-top: 0.5rem;
}
.va-page-header__nav {
  flex-shrink: 0;
  display: block !important;
  visibility: visible !important;
}
.va-nav-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6rem 2.2rem 0.6rem 1rem;
  border: 1px solid var(--va-bois-fonce);
  border-radius: 8px;
  background-color: var(--va-vert-clair);
  color: var(--va-bois-fonce);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235c3a20' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  transition: width 0.15s ease;
}

@media (max-width: 560px) {
  .va-logo--lg {
    max-width: 48px !important;
    width: 48px !important;
  }
  .va-nav-select {
    font-size: 0.75rem;
    padding: 0.5rem 1.8rem 0.5rem 0.7rem;
    min-width: 0;
    max-width: 45vw;
    background-position: right 0.6rem center;
  }
  .va-nav-select:focus,
  .va-nav-select:active {
    max-width: 100%;
    width: 100%;
  }
}

/* Titre de page uniforme (même style que Tarification) */
.va-page-title-wrap {
  margin-bottom: 1.5rem;
}
.va-page-title {
  font-size: 2.3rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #000;
}
.va-page-subtitle {
  color: var(--va-texte-doux);
  margin: 0;
  max-width: 60ch;
  line-height: 1.55;
}

.va-portal__greeting {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--va-bois-fonce);
  margin: 0;
}
