/* ================================================================
   THDC – Whistle Blower Complaint Form
   Pure CSS override — no Twig/HTML changes required.
   Drop into your theme's css/ folder and attach via libraries.yml
   ================================================================ */

/* ── Page / form wrapper ──────────────────────────────────────── */


#webform-submission-whistle-blower-complaint-add-form {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 8px 40px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: #222;
}

/* ── Section containers ───────────────────────────────────────── */
#webform-submission-whistle-blower-complaint-add-form .webform-section {
  background: #fff;
  border: 1.5px solid #dde5ee;
  border-radius: 10px;
  padding: 24px 26px 18px;
  margin-bottom: 22px;
  box-shadow: 0 1px 4px rgba(26,58,92,.06);
}

/* ── Section headings ─────────────────────────────────────────── */
#webform-submission-whistle-blower-complaint-add-form .webform-section-title {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .11em !important;
  text-transform: uppercase !important;
  color: #fff !important;
  background: #1a3a5c !important;
  margin: -24px -26px 20px !important; /* bleed to card edge */
  padding: 11px 20px !important;
  border-radius: 8px 8px 0 0 !important;
}

/* ── Field item wrappers ──────────────────────────────────────── */
#webform-submission-whistle-blower-complaint-add-form .js-form-item {
  margin-bottom: 14px;
}

/* ── Labels ───────────────────────────────────────────────────── */
#webform-submission-whistle-blower-complaint-add-form label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
}

/* Required asterisk */
#webform-submission-whistle-blower-complaint-add-form label.js-form-required::after,
#webform-submission-whistle-blower-complaint-add-form label.form-required::after {
  content: ' *';
  color: #dc2626;
}

/* ── All text inputs, selects, textareas ──────────────────────── */
#webform-submission-whistle-blower-complaint-add-form input[type="text"],
#webform-submission-whistle-blower-complaint-add-form input[type="email"],
#webform-submission-whistle-blower-complaint-add-form input[type="tel"],
#webform-submission-whistle-blower-complaint-add-form input[type="date"],
#webform-submission-whistle-blower-complaint-add-form textarea,
#webform-submission-whistle-blower-complaint-add-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13.5px;
  color: #111;
  background: #fff;
  transition: border-color .18s, box-shadow .18s;
  outline: none;
  /* remove browser default sizing */
  -webkit-appearance: none;
  appearance: none;
}

#webform-submission-whistle-blower-complaint-add-form input[type="text"]:focus,
#webform-submission-whistle-blower-complaint-add-form input[type="email"]:focus,
#webform-submission-whistle-blower-complaint-add-form input[type="tel"]:focus,
#webform-submission-whistle-blower-complaint-add-form input[type="date"]:focus,
#webform-submission-whistle-blower-complaint-add-form textarea:focus,
#webform-submission-whistle-blower-complaint-add-form select:focus {
  border-color: #1a3a5c;
  box-shadow: 0 0 0 3px rgba(26,58,92,.12);
}

#webform-submission-whistle-blower-complaint-add-form textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.55;
}

/* Select: custom chevron */
#webform-submission-whistle-blower-complaint-add-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 4.5L11 1' stroke='%231a3a5c' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 34px;
  cursor: pointer;
}

/* Date input: keep native calendar icon but fix styling */
#webform-submission-whistle-blower-complaint-add-form input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
}

/* ── Two-column row: Date + Place ─────────────────────────────── */
/* Wrap both .js-form-item divs in the section-wrapper with CSS grid
   by targeting both siblings together */
#webform-submission-whistle-blower-complaint-add-form
  #edit-b-complaint-details .webform-section-wrapper {
  display: grid;
  grid-template-columns: 1fr;  /* default, single col */
  gap: 0;
}

/* Subject spans full width */
#webform-submission-whistle-blower-complaint-add-form
  .form-item-subject {
  grid-column: 1 / -1;
}

/* Description spans full width */
#webform-submission-whistle-blower-complaint-add-form
  .form-item-description-of-improper-activity-issue {
  grid-column: 1 / -1;
}

/* Date and Place side-by-side */
#webform-submission-whistle-blower-complaint-add-form
  #edit-b-complaint-details .webform-section-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* Force Subject + Description back to full width */
#webform-submission-whistle-blower-complaint-add-form
  #edit-b-complaint-details .form-item-subject,
#webform-submission-whistle-blower-complaint-add-form
  #edit-b-complaint-details .form-item-description-of-improper-activity-issue,
#webform-submission-whistle-blower-complaint-add-form
  #edit-b-complaint-details .form-item-names-of-persons-involved-if-any {
  grid-column: 1 / -1;
}

/* ── Two-column row: Language + How-did-you-know ──────────────── */
#webform-submission-whistle-blower-complaint-add-form
  #edit-c-additional-information .webform-section-wrapper {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  align-items: start;
}

/* Submit Complaint To spans full width in Section C */
#webform-submission-whistle-blower-complaint-add-form
  #edit-c-additional-information .form-item-submit-complaint-to {
  grid-column: 1 / -1;
}

/* ── File upload section ──────────────────────────────────────── */
#webform-submission-whistle-blower-complaint-add-form
  #edit-d-attach-documents .webform-section-wrapper {
  display: block;
}

/* The managed file wrapper */
#webform-submission-whistle-blower-complaint-add-form
  .js-webform-type-managed-file {
  margin-bottom: 0;
}

/* Style the file input area as a drop zone card */
#webform-submission-whistle-blower-complaint-add-form
  .js-form-managed-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed #93adc8;
  border-radius: 8px;
  padding: 28px 20px;
  background: #f7fafd;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  min-height: 110px;
}
#webform-submission-whistle-blower-complaint-add-form
  .js-form-managed-file:hover {
  border-color: #1a3a5c;
  background: #edf2f8;
}

/* The actual file input */
#webform-submission-whistle-blower-complaint-add-form
  input[type="file"] {
  font-size: 13px;
  color: #555;
  /* can't fully hide — just polish it */
  border: none;
  background: none;
  padding: 4px 0;
  width: auto;
  cursor: pointer;
}

/* Upload button (hidden by default in Drupal, but style if shown) */
#webform-submission-whistle-blower-complaint-add-form
  #edit-attach-documents-upload-button {
  display: inline-block !important;
  background: #1a3a5c;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 7px 18px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  letter-spacing: .02em;
  transition: background .18s;
}
#webform-submission-whistle-blower-complaint-add-form
  #edit-attach-documents-upload-button:hover {
  background: #122b45;
}

/* File description text */
#webform-submission-whistle-blower-complaint-add-form
  .webform-element-description,
#webform-submission-whistle-blower-complaint-add-form
  #edit-attach-documents--description {
  font-size: 11.5px;
  color: #888;
  margin-top: 8px;
  line-height: 1.6;
}

/* ── Declaration checkbox ─────────────────────────────────────── */
#webform-submission-whistle-blower-complaint-add-form
  .webform-type-checkbox,
#webform-submission-whistle-blower-complaint-add-form
  .js-webform-type-checkbox {
  background: #f0f5fb;
  border: 1.5px solid #dde5ee;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 20px 0 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

#webform-submission-whistle-blower-complaint-add-form
  .js-webform-type-checkbox input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: #1a3a5c;
  cursor: pointer;
}

#webform-submission-whistle-blower-complaint-add-form
  .js-webform-type-checkbox label.option {
  font-size: 13px;
  font-weight: 400;
  color: #333;
  margin-bottom: 0;
  cursor: pointer;
  line-height: 1.5;
}

/* ── Submit button ────────────────────────────────────────────── */
#webform-submission-whistle-blower-complaint-add-form
  .form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 4px;
}

#webform-submission-whistle-blower-complaint-add-form
  input[type="submit"],
#webform-submission-whistle-blower-complaint-add-form
  .webform-button--submit {
  background: #1a3a5c !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 11px 30px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  transition: background .18s !important;
  box-shadow: 0 2px 6px rgba(26,58,92,.25) !important;
  font-family: inherit !important;
}
#webform-submission-whistle-blower-complaint-add-form
  input[type="submit"]:hover {
  background: #12294a !important;
}

/* ── Responsive: stack columns on narrow screens ──────────────── */
@media (max-width: 640px) {
  #webform-submission-whistle-blower-complaint-add-form
    #edit-b-complaint-details .webform-section-wrapper,
  #webform-submission-whistle-blower-complaint-add-form
    #edit-c-additional-information .webform-section-wrapper {
    grid-template-columns: 1fr;
  }
  #webform-submission-whistle-blower-complaint-add-form
    #edit-b-complaint-details .form-item-subject,
  #webform-submission-whistle-blower-complaint-add-form
    #edit-b-complaint-details .form-item-description-of-improper-activity-issue,
  #webform-submission-whistle-blower-complaint-add-form
    #edit-b-complaint-details .form-item-names-of-persons-involved-if-any {
    grid-column: 1;
  }
  #webform-submission-whistle-blower-complaint-add-form .webform-section {
    padding: 18px 16px 14px;
  }
  #webform-submission-whistle-blower-complaint-add-form .webform-section-title {
    margin: -18px -16px 16px !important;
  }
}

/* ================================================================
   HOW TO USE
   ================================================================
   1. Copy this file to <your-theme>/css/whistle-blower-form.css

   2. In <your-theme>/<theme-name>.libraries.yml add:

      whistle-blower-form:
        version: 1.0
        css:
          theme:
            css/whistle-blower-form.css: {}

   3. In your theme's <theme-name>.info.yml add under libraries:

        libraries:
          - your_theme_name/whistle-blower-form

      OR attach only on the webform page via a hook in <theme>.theme:

        function mytheme_preprocess_webform_submission_form(&$vars) {
          $vars['#attached']['library'][] = 'your_theme_name/whistle-blower-form';
        }

   4. drush cr
   ================================================================ */