/**
 * Webform Paragraph Component
 *
 * Template: templates/paragraph/paragraph--webform.html.twig
 * Library:  acm_bootstrap/paragraph-webform-section
 *
 * wf-* classes mirror the standalone prototype at
 * designs/webform-paragraph-mockup.html for pixel-to-pixel
 * cross-referencing during debugging.
 *
 * Light palette is the default.
 * Dark variant: .paragraph--type--webform--dark.wf-section--dark
 *
 * Form elements are targeted generically so the styles apply
 * regardless of which webform is selected.
 */

/* ==========================================================================
   All selectors scoped under .paragraph--type--webform to prevent
   conflicts with other components sharing wf-* class names.
   ========================================================================== */

/* ==========================================================================
   1. Design tokens — Light palette (default)
   ========================================================================== */

.paragraph--type--webform.wf-section {
  /* Brand accent */
  --wf-orange:              #ff5c00;
  --wf-orange-dim:          rgba(255, 92, 0, .06);

  /* Backgrounds */
  --wf-bg:                  #f4f7fb;
  --wf-bg-overlay-line:     rgba(13, 31, 53, .04);

  /* Text */
  --wf-title-color:         #0d1f35;
  --wf-subtitle-color:      rgba(13, 31, 53, .55);
  --wf-label-color:         rgba(13, 31, 53, .70);
  --wf-body-color:          #0d1f35;

  /* Eyebrow / section label */
  --wf-eyebrow-color:       #ff5c00;

  /* Form controls */
  --wf-input-bg:            #ffffff;
  --wf-input-border:        rgba(13, 31, 53, .15);
  --wf-input-border-focus:  #ff5c00;
  --wf-input-color:         #0d1f35;
  --wf-input-placeholder:   rgba(13, 31, 53, .35);
  --wf-input-shadow-focus:  0 0 0 3px rgba(255, 92, 0, .10);

  /* Submit button */
  --wf-btn-bg:              #00264d;
  --wf-btn-color:           #ffffff;
  --wf-btn-hover-bg:        #ff5c00;
  --wf-btn-hover-color:     #ffffff;

  /* Info panel */
  --wf-info-bg:             rgba(13, 31, 53, .03);
  --wf-info-border:         rgba(13, 31, 53, .08);
  --wf-info-icon-color:     #ff5c00;
  --wf-info-text-color:     rgba(13, 31, 53, .55);
  --wf-info-value-color:    #0d1f35;

  /* Card wrapper */
  --wf-card-bg:             #ffffff;
  --wf-card-border:         rgba(13, 31, 53, .08);
  --wf-card-shadow:         0 4px 24px rgba(13, 31, 53, .06);
}

/* ==========================================================================
   2. Dark palette overrides
   ========================================================================== */

.paragraph--type--webform--dark.wf-section--dark {
  --wf-orange-dim:          rgba(255, 92, 0, .10);

  --wf-bg:                  linear-gradient(160deg, #020c18 0%, #00264d 60%, #031a30 100%);
  --wf-bg-overlay-line:     rgba(255, 255, 255, .03);

  --wf-title-color:         #ffffff;
  --wf-subtitle-color:      rgba(255, 255, 255, .55);
  --wf-label-color:         rgba(255, 255, 255, .60);
  --wf-body-color:          rgba(255, 255, 255, .85);

  --wf-input-bg:            rgba(255, 255, 255, .06);
  --wf-input-border:        rgba(255, 255, 255, .12);
  --wf-input-border-focus:  #ff5c00;
  --wf-input-color:         #ffffff;
  --wf-input-placeholder:   rgba(255, 255, 255, .30);
  --wf-input-shadow-focus:  0 0 0 3px rgba(255, 92, 0, .15);

  --wf-btn-bg:              #ff5c00;
  --wf-btn-color:           #ffffff;
  --wf-btn-hover-bg:        #e65200;
  --wf-btn-hover-color:     #ffffff;

  --wf-info-bg:             rgba(255, 255, 255, .04);
  --wf-info-border:         rgba(255, 255, 255, .08);
  --wf-info-icon-color:     #ff5c00;
  --wf-info-text-color:     rgba(255, 255, 255, .45);
  --wf-info-value-color:    #ffffff;

  --wf-card-bg:             rgba(255, 255, 255, .04);
  --wf-card-border:         rgba(255, 255, 255, .08);
  --wf-card-shadow:         none;
}

/* ==========================================================================
   3. Section wrapper — mobile base
   ========================================================================== */

.paragraph--type--webform.wf-section {
  background: var(--wf-bg);
  padding: 56px 0 64px;
  position: relative;
  overflow: hidden;
}

/* Subtle grid overlay */
.paragraph--type--webform.wf-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--wf-bg-overlay-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--wf-bg-overlay-line) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.paragraph--type--webform .wf-container {
  /*max-width: 1200px;*/
  /*margin: 0 auto;*/
  /*padding: 0 20px;*/
  /*position: relative;*/
}

/* ==========================================================================
   4. Section header — mobile base
   ========================================================================== */

.paragraph--type--webform .wf-header {
  text-align: center;
  margin-bottom: 32px;
}

.paragraph--type--webform .wf-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--wf-eyebrow-color);
  margin-bottom: 14px;
}

.paragraph--type--webform .wf-eyebrow::before,
.paragraph--type--webform .wf-eyebrow::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 2px;
  background: var(--wf-eyebrow-color);
}

.paragraph--type--webform .wf-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--wf-title-color);
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.paragraph--type--webform .wf-title span {
  color: var(--wf-orange);
}

.paragraph--type--webform .wf-subtitle {
  margin-top: 12px;
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--wf-subtitle-color);
  line-height: 1.7;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0;
}

/* ==========================================================================
   5. Layout — mobile: stacked
   ========================================================================== */

.paragraph--type--webform .wf-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ==========================================================================
   6. Form card
   ========================================================================== */

.paragraph--type--webform .wf-form-card {
  background: var(--wf-card-bg);
  border: 1px solid var(--wf-card-border);
  box-shadow: var(--wf-card-shadow);
  padding: 28px 24px;
  position: relative;
}

/* Orange top accent bar */
.paragraph--type--webform .wf-form-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--wf-orange);
}

/* ==========================================================================
   7. Generic webform element styling
   Targets Drupal's webform markup: .form-item, input, textarea, select,
   .button--primary, etc. These apply regardless of which webform is used.
   ========================================================================== */

/* Form item containers */
.paragraph--type--webform .wf-form-card .form-item {
  margin-bottom: 20px;
}

/* Labels */
.paragraph--type--webform .wf-form-card label {
  display: block;
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #0d1f35;
  margin-bottom: 6px;
}

/* Required marker */
.paragraph--type--webform .wf-form-card .form-required::after,
.paragraph--type--webform .wf-form-card .js-form-required::after {
  color: var(--wf-orange);
}

/* Text inputs, email, tel, url, number, password */
.paragraph--type--webform .wf-form-card input[type="text"],
.paragraph--type--webform .wf-form-card input[type="email"],
.paragraph--type--webform .wf-form-card input[type="tel"],
.paragraph--type--webform .wf-form-card input[type="url"],
.paragraph--type--webform .wf-form-card input[type="number"],
.paragraph--type--webform .wf-form-card input[type="password"],
.paragraph--type--webform .wf-form-card input[type="search"],
.paragraph--type--webform .wf-form-card textarea,
.paragraph--type--webform .wf-form-card select {
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--wf-input-color);
  background: var(--wf-input-bg);
  border: 1px solid var(--wf-input-border);
  border-radius: 0;
  padding: 14px 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.paragraph--type--webform .wf-form-card input::placeholder,
.paragraph--type--webform .wf-form-card textarea::placeholder {
  color: var(--wf-input-placeholder);
}

.paragraph--type--webform .wf-form-card input:focus,
.paragraph--type--webform .wf-form-card textarea:focus,
.paragraph--type--webform .wf-form-card select:focus {
  border-color: var(--wf-input-border-focus);
  box-shadow: var(--wf-input-shadow-focus);
}

.paragraph--type--webform .wf-form-card textarea {
  min-height: 120px;
  resize: vertical;
}

/* Select arrow */
.paragraph--type--webform .wf-form-card select {
  cursor: pointer;
}

/* Checkboxes & radios — keep functional, tint accent */
.paragraph--type--webform .wf-form-card input[type="checkbox"],
.paragraph--type--webform .wf-form-card input[type="radio"] {
  width: auto;
  accent-color: var(--wf-orange);
}

/* Submit button */
.paragraph--type--webform .wf-form-card input[type="submit"],
.paragraph--type--webform .wf-form-card .button--primary,
.paragraph--type--webform .wf-form-card .webform-button--submit {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wf-btn-color);
  background: var(--wf-btn-bg);
  border: none;
  border-radius: 0;
  padding: 16px 40px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease;
  -webkit-appearance: none;
}

.paragraph--type--webform .wf-form-card input[type="submit"]:hover,
.paragraph--type--webform .wf-form-card .button--primary:hover,
.paragraph--type--webform .wf-form-card .webform-button--submit:hover {
  background: var(--wf-btn-hover-bg);
  color: var(--wf-btn-hover-color);
  transform: translateY(-2px);
}

/* Webform actions container — centre the button */
.paragraph--type--webform .wf-form-card .form-actions {
  padding-top: 8px;
  text-align: center;
}

/* Description / help text below fields */
.paragraph--type--webform .wf-form-card .description,
.paragraph--type--webform .wf-form-card .form-item--error-message {
  font-size: 12px;
  margin-top: 4px;
  color: var(--wf-subtitle-color);
}

/* Error state */
.paragraph--type--webform .wf-form-card input.error,
.paragraph--type--webform .wf-form-card textarea.error,
.paragraph--type--webform .wf-form-card select.error {
  border-color: #dc3545;
}

/* Hide redundant field wrappers that Drupal adds */
.paragraph--type--webform .wf-form-card > .field--name-field-webform > .field__item {
  padding: 0;
  margin: 0;
}

/* ==========================================================================
   8. Info sidebar
   ========================================================================== */

.paragraph--type--webform .wf-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.paragraph--type--webform .wf-info-card {
  background: var(--wf-info-bg);
  border: 1px solid var(--wf-info-border);
  padding: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.paragraph--type--webform .wf-info-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wf-info-icon-color);
}

.paragraph--type--webform .wf-info-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.paragraph--type--webform .wf-info-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wf-info-text-color);
}

.paragraph--type--webform .wf-info-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--wf-info-value-color);
  text-decoration: none;
}

.paragraph--type--webform .wf-info-value a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.paragraph--type--webform .wf-info-value a:hover {
  color: var(--wf-orange);
}

.paragraph--type--webform .wf-info-note {
  font-size: 0.95rem;
  font-weight: 300;
  color: #0d1f35;
  line-height: 1.6;
  padding: 16px 20px;
  background: var(--wf-info-bg);
  border: 1px solid var(--wf-info-border);
  border-left: 2px solid var(--wf-orange);
}

/* ==========================================================================
   9. Privacy note (project_inquiry only)
   ========================================================================== */

.paragraph--type--webform .wf-form-privacy {
  font-size: 11px;
  color: var(--wf-subtitle-color);
  margin-top: 13px;
  line-height: 1.6;
}

.paragraph--type--webform .wf-form-privacy a {
  color: var(--wf-orange);
  text-decoration: none;
}

.paragraph--type--webform .wf-form-privacy a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   10. Responsive — mobile-first breakpoints
   ========================================================================== */

/* ==========================================================================
   Project Inquiry form overrides
   Scoped to .webform-submission-project-inquiry-form only.
   ========================================================================== */

/* Remove card wrapper styling — flatten into page */
.paragraph--type--webform .wf-form-card:has(.webform-submission-project-inquiry-form) {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* Remove orange top accent bar */
.paragraph--type--webform .wf-form-card:has(.webform-submission-project-inquiry-form)::before {
  display: none;
}

/* Wider sidebar */
.paragraph--type--webform:has(.webform-submission-project-inquiry-form) .wf-info {
  width: 360px;
}

/* Hide centred section header — form has its own heading */
.paragraph--type--webform:has(.webform-submission-project-inquiry-form) .wf-header {
  /*display: none;*/
}

.paragraph--type--webform:has(.webform-submission-project-inquiry-form) .wf-header h2{
  font-family: "Oswald", sans-serif;
  text-align: left;
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0d1f35;
  margin-bottom: 6px;
}

.paragraph--type--webform:has(.webform-submission-project-inquiry-form) .wf-header p{
  font-size: 1rem;
  color: #6b7280;
  margin-bottom: 28px;
  line-height: 1.6;
  text-align: left;
  margin-left: 0;
  margin-right: 0;
  width: 100%;
  max-width: 850px;
}

/* White background, less vertical padding */
.paragraph--type--webform.wf-section:has(.webform-submission-project-inquiry-form) {
  background: #fff;
  padding: 64px 0 72px;
}

/* Kill the grid overlay on white bg */
.paragraph--type--webform.wf-section:has(.webform-submission-project-inquiry-form)::before {
  display: none;
}

/* Submit button — orange instead of navy */
.webform-submission-project-inquiry-form .webform-button--submit,
.webform-submission-project-inquiry-form input[type="submit"] {
  background: #ff5c00 !important;
  color: #fff !important;
}

.webform-submission-project-inquiry-form .webform-button--submit:hover,
.webform-submission-project-inquiry-form input[type="submit"]:hover {
  background: #e65200 !important;
}

/* Left-align form actions */
.webform-submission-project-inquiry-form .form-actions {
  text-align: left !important;
}

section.wf-section--project-inquiry .wf-info {
  border-top: 3px solid #ff5c00;
}

/* ≥ 600px — Tablet */
@media (min-width: 600px) {
  .paragraph--type--webform.wf-section {
    padding: 72px 0 80px;
  }

  .paragraph--type--webform .wf-container {
    /*padding: 0 24px;*/
  }

  .paragraph--type--webform .wf-header {
    margin-bottom: 40px;
  }

  .paragraph--type--webform .wf-title {
    font-size: 2.125rem;
  }

  .paragraph--type--webform .wf-subtitle {
    font-size: 1.125rem;
  }

  .paragraph--type--webform .wf-form-card {
    padding: 36px 32px;
  }
}

/* ≥ 992px — Desktop: side-by-side layout */
@media (min-width: 992px) {
  .paragraph--type--webform.wf-section {
    padding: 90px 0 100px;
  }

  .paragraph--type--webform .wf-header {
    margin-bottom: 25px;
  }

  .paragraph--type--webform .wf-title {
    font-size: clamp(1.75rem, 4vw, 2.625rem);
  }

  .paragraph--type--webform .wf-layout {
    flex-direction: row;
    gap: 32px;
  }

  .paragraph--type--webform .wf-form-card {
    flex: 1;
    padding: 40px 36px;
  }

  .paragraph--type--webform .wf-info {
    width: 280px;
    flex-shrink: 0;
  }
}
