/* ==========================================================================
   BeyondPFAS Brochure Download Form
   Based on previous Veolia Drupal Webform style
   Scope: only brochure download form
   ========================================================================== */

/* ==========================================================================
   0. Scope
   ========================================================================== */

form[id^="webform-submission-beyondpfas-brochure-download"],
.bpfas-brochure-form {
  --veolia-red: #EE0000;
  --veolia-blue: #0072CE;
  --veolia-text: #333333;
  --veolia-muted: #555555;
  --veolia-field-bg: #F2F1F9;
  --veolia-field-border: #D5D3E3;

  font-family: "Noto Sans", Arial, sans-serif !important;
}

/* ==========================================================================
   1. Form container
   Same spirit as your previous form
   ========================================================================== */

.webform-ajax-form-wrapper:has(form[id^="webform-submission-beyondpfas-brochure-download"]),
form[id^="webform-submission-beyondpfas-brochure-download"],
.bpfas-brochure-form {
  background-color: #FFFFFF !important;
  padding: 32px !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 760px !important;
  margin: 0 auto !important;
}

/* If the form is already inside AJAX wrapper, avoid double padding */
.webform-ajax-form-wrapper form[id^="webform-submission-beyondpfas-brochure-download"] {
  padding: 0 !important;
  border-radius: 0 !important;
  max-width: 100% !important;
}

/* Hide duplicated Drupal title if present */
form[id^="webform-submission-beyondpfas-brochure-download"] #edit-title-page-1,
form[id^="webform-submission-beyondpfas-brochure-download"] .webform-page-title,
.bpfas-brochure-form #edit-title-page-1,
.bpfas-brochure-form .webform-page-title {
  display: none !important;
}

/* ==========================================================================
   2. Form layout + labels
   ========================================================================== */

form[id^="webform-submission-beyondpfas-brochure-download"] .form-item,
form[id^="webform-submission-beyondpfas-brochure-download"] .js-form-item,
.bpfas-brochure-form .form-item,
.bpfas-brochure-form .js-form-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 4px !important;
  margin-bottom: 20px !important;
  padding: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

body form[id^="webform-submission-beyondpfas-brochure-download"] label,
body .bpfas-brochure-form label {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: max-content !important;
  max-width: 100% !important;

  font-family: "Noto Sans", Arial, sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #333333 !important;

  margin-bottom: 4px !important;
  text-align: left !important;
  background-image: none !important;
}

/* Required marker */
body form[id^="webform-submission-beyondpfas-brochure-download"] label .form-required,
body form[id^="webform-submission-beyondpfas-brochure-download"] label .js-form-required,
body form[id^="webform-submission-beyondpfas-brochure-download"] label abbr,
body .bpfas-brochure-form label .form-required,
body .bpfas-brochure-form label .js-form-required,
body .bpfas-brochure-form label abbr {
  display: inline-block !important;
  position: static !important;
  margin-left: 4px !important;
  color: #333333 !important;
  text-decoration: none !important;
  border: none !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Prevent duplicated required pseudo marker */
body form[id^="webform-submission-beyondpfas-brochure-download"] label.form-required::after,
body form[id^="webform-submission-beyondpfas-brochure-download"] label.js-form-required::after,
body .bpfas-brochure-form label.form-required::after,
body .bpfas-brochure-form label.js-form-required::after {
  content: none !important;
  display: none !important;
}

/* ==========================================================================
   3. Text fields
   ========================================================================== */

form[id^="webform-submission-beyondpfas-brochure-download"] input.form-text,
form[id^="webform-submission-beyondpfas-brochure-download"] input.form-email,
form[id^="webform-submission-beyondpfas-brochure-download"] input.form-tel,
form[id^="webform-submission-beyondpfas-brochure-download"] input.form-number,
form[id^="webform-submission-beyondpfas-brochure-download"] textarea.form-textarea,
.bpfas-brochure-form input.form-text,
.bpfas-brochure-form input.form-email,
.bpfas-brochure-form input.form-tel,
.bpfas-brochure-form input.form-number,
.bpfas-brochure-form textarea.form-textarea {
  background-color: #F2F1F9 !important;
  border: 1px solid #D5D3E3 !important;
  color: #333333 !important;
  border-radius: 4px !important;

  padding: 14px 16px !important;
  width: 100% !important;
  height: 50px !important;
  box-sizing: border-box !important;

  font-family: "Noto Sans", Arial, sans-serif !important;
  font-size: 16px !important;
  line-height: 22px !important;

  box-shadow: none !important;
  outline: none !important;

  transition: border-color 0.2s ease, background-color 0.2s ease !important;
}

form[id^="webform-submission-beyondpfas-brochure-download"] textarea.form-textarea,
.bpfas-brochure-form textarea.form-textarea {
  min-height: 120px !important;
  height: auto !important;
  resize: vertical !important;
}

form[id^="webform-submission-beyondpfas-brochure-download"] input.form-text:focus,
form[id^="webform-submission-beyondpfas-brochure-download"] input.form-email:focus,
form[id^="webform-submission-beyondpfas-brochure-download"] input.form-tel:focus,
form[id^="webform-submission-beyondpfas-brochure-download"] input.form-number:focus,
form[id^="webform-submission-beyondpfas-brochure-download"] textarea.form-textarea:focus,
.bpfas-brochure-form input.form-text:focus,
.bpfas-brochure-form input.form-email:focus,
.bpfas-brochure-form input.form-tel:focus,
.bpfas-brochure-form input.form-number:focus,
.bpfas-brochure-form textarea.form-textarea:focus {
  background-color: #FFFFFF !important;
  border-color: #0072CE !important;
  outline: none !important;
}

/* ==========================================================================
   4. Checkbox
   ========================================================================== */

form[id^="webform-submission-beyondpfas-brochure-download"] .form-type-checkbox,
form[id^="webform-submission-beyondpfas-brochure-download"] .js-form-type-checkbox,
.bpfas-brochure-form .form-type-checkbox,
.bpfas-brochure-form .js-form-type-checkbox {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 10px !important;
  margin-bottom: 20px !important;
}

form[id^="webform-submission-beyondpfas-brochure-download"] input[type="checkbox"],
.bpfas-brochure-form input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  margin: 3px 0 0 !important;
  accent-color: #EE0000 !important;
}

body form[id^="webform-submission-beyondpfas-brochure-download"] .form-type-checkbox label,
body form[id^="webform-submission-beyondpfas-brochure-download"] .js-form-type-checkbox label,
body .bpfas-brochure-form .form-type-checkbox label,
body .bpfas-brochure-form .js-form-type-checkbox label {
  width: auto !important;
  margin: 0 !important;
  font-weight: 400 !important;
  line-height: 20px !important;
}

/* ==========================================================================
   5. Legal text
   ========================================================================== */

form[id^="webform-submission-beyondpfas-brochure-download"] p,
.bpfas-brochure-form p {
  font-family: "Noto Sans", Arial, sans-serif !important;
  font-size: 13px !important;
  line-height: 19px !important;
  color: #555555 !important;
  margin: 8px 0 0 !important;
}

form[id^="webform-submission-beyondpfas-brochure-download"] a,
.bpfas-brochure-form a {
  color: #333333 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
}

/* ==========================================================================
   6. Form actions + buttons
   Same as previous form style
   ========================================================================== */

body form[id^="webform-submission-beyondpfas-brochure-download"] .form-actions,
body .bpfas-brochure-form .form-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: wrap !important;
  gap: 16px !important;
  margin-top: 28px !important;
  clear: both !important;
}

/* Primary action button */
form[id^="webform-submission-beyondpfas-brochure-download"] .form-actions input[type="submit"],
form[id^="webform-submission-beyondpfas-brochure-download"] .form-actions button,
form[id^="webform-submission-beyondpfas-brochure-download"] .form-actions .button,
.bpfas-brochure-form .form-actions input[type="submit"],
.bpfas-brochure-form .form-actions button,
.bpfas-brochure-form .form-actions .button {
  border-radius: 999px !important;
  border: none !important;

  padding: 12px 42px !important;
  background-color: #EE0000 !important;
  background-image: none !important;
  color: #FFFFFF !important;

  font-family: "Noto Sans", Arial, sans-serif !important;
  font-size: 16px !important;
  font-weight: 700 !important;

  cursor: pointer !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  min-width: 180px !important;
  min-height: 48px !important;
  width: auto !important;

  box-sizing: border-box !important;
  line-height: 24px !important;
  text-decoration: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;

  transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out !important;
}

/* Remove duplicated icons/pseudo elements */
form[id^="webform-submission-beyondpfas-brochure-download"] .form-actions input::before,
form[id^="webform-submission-beyondpfas-brochure-download"] .form-actions input::after,
form[id^="webform-submission-beyondpfas-brochure-download"] .form-actions button::before,
form[id^="webform-submission-beyondpfas-brochure-download"] .form-actions button::after,
.bpfas-brochure-form .form-actions input::before,
.bpfas-brochure-form .form-actions input::after,
.bpfas-brochure-form .form-actions button::before,
.bpfas-brochure-form .form-actions button::after {
  content: none !important;
  display: none !important;
}

form[id^="webform-submission-beyondpfas-brochure-download"] .form-actions input[type="submit"]:hover,
form[id^="webform-submission-beyondpfas-brochure-download"] .form-actions button:hover,
.bpfas-brochure-form .form-actions input[type="submit"]:hover,
.bpfas-brochure-form .form-actions button:hover {
  opacity: 0.85 !important;
}

form[id^="webform-submission-beyondpfas-brochure-download"] .form-actions input[type="submit"]:focus,
form[id^="webform-submission-beyondpfas-brochure-download"] .form-actions button:focus,
.bpfas-brochure-form .form-actions input[type="submit"]:focus,
.bpfas-brochure-form .form-actions button:focus {
  outline: 2px solid #0072CE !important;
  outline-offset: 3px !important;
}

/* ==========================================================================
   7. Errors
   ========================================================================== */

form[id^="webform-submission-beyondpfas-brochure-download"] .form-item--error-message,
form[id^="webform-submission-beyondpfas-brochure-download"] .form-error,
.bpfas-brochure-form .form-item--error-message,
.bpfas-brochure-form .form-error {
  margin-top: 6px !important;
  color: #B00020 !important;
  font-family: "Noto Sans", Arial, sans-serif !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

form[id^="webform-submission-beyondpfas-brochure-download"] input.error,
.bpfas-brochure-form input.error {
  border-color: #B00020 !important;
}

/* ==========================================================================
   8. Responsive
   ========================================================================== */

@media (max-width: 768px) {
  form[id^="webform-submission-beyondpfas-brochure-download"],
  .bpfas-brochure-form {
    padding: 24px !important;
    max-width: 100% !important;
  }

  body form[id^="webform-submission-beyondpfas-brochure-download"] .form-actions,
  body .bpfas-brochure-form .form-actions {
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 20px !important;
  }

  form[id^="webform-submission-beyondpfas-brochure-download"] .form-actions input[type="submit"],
  form[id^="webform-submission-beyondpfas-brochure-download"] .form-actions button,
  .bpfas-brochure-form .form-actions input[type="submit"],
  .bpfas-brochure-form .form-actions button {
    width: 100% !important;
  }
}