/* Additions to the mirrored WIN Study Hub site.
   Brand colours are Astra's own globals: #e55b5c primary, #d22123 hover. */

/* ---- Footer credit ---------------------------------------------------- */

.sb-credit {
  margin: 6px 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  opacity: 0.7;
}

.sb-credit a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

.sb-credit a:hover,
.sb-credit a:focus-visible {
  color: #e55b5c;
}

/* ---- Contact form ------------------------------------------------------
   The Spectra block stacks every field full width with no spacing rhythm.
   This lays the short fields out two-up on desktop, gives the inputs a real
   focus state, and makes the submit button match the site's buttons. */

.uagb-forms__outer-wrap {
  --wsh-accent: #e55b5c;
  --wsh-accent-dark: #d22123;
  --wsh-border: #e3e5e8;
}

.uagb-forms-main-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
  align-items: start;
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
}

/* Name and Email pair up on the first row; Subject, Message and the button
   each take the full width, so no half-row gap is left hanging. */
.uagb-forms-main-form .uagb-block-2096979b,
.uagb-forms-main-form .uagb-forms-textarea-wrap,
.uagb-forms-main-form .uagb-forms-main-submit-button-wrap,
.uagb-forms-main-form .uagb-forms-form-hidden-data,
.uagb-forms-main-form > div[class*="uagb-form-reacaptcha-error"] {
  grid-column: 1 / -1;
}

.uagb-forms-main-form .uagb-forms-field-set {
  margin: 0;
  min-width: 0;
}

/* The block hides its labels and the stored label text is wrong anyway
   ("Last Name" is really the Subject field), so the placeholders stay the
   visible labels — but screen readers still need a name for each input. */
.uagb-forms-input-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.uagb-forms-main-form .uagb-forms-input,
.uagb-forms-main-form textarea.uagb-forms-input,
.uagb-forms__outer-wrap .uagb-forms-main-form input.uagb-forms-input,
.uagb-forms__outer-wrap .uagb-forms-main-form textarea.uagb-forms-input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 15px !important;
  border: 1px solid var(--wsh-border) !important;
  border-radius: 8px !important;
  background: #fff !important;
  font-size: 1rem;
  line-height: 1.5;
  color: #262626;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.uagb-forms-main-form textarea.uagb-forms-input {
  min-height: 150px !important;
  resize: vertical;
}

.uagb-forms-main-form .uagb-forms-input::placeholder {
  color: #9aa0a6;
}

.uagb-forms-main-form .uagb-forms-input:hover {
  border-color: #c9ccd1 !important;
}

.uagb-forms-main-form .uagb-forms-input:focus {
  outline: none;
  border-color: var(--wsh-accent) !important;
  box-shadow: 0 0 0 3px rgba(229, 91, 92, 0.18) !important;
}

.uagb-forms-main-form .uagb-forms-input:user-invalid {
  border-color: #d93025 !important;
}

.uagb-forms-main-submit-button-wrap {
  margin-top: 2px;
}

.uagb-forms-main-form .uagb-forms-main-submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 190px;
  padding: 14px 34px;
  border: 0;
  border-radius: 8px;
  background: var(--wsh-accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

.uagb-forms-main-form .uagb-forms-main-submit-button:hover {
  background: var(--wsh-accent-dark);
}

.uagb-forms-main-form .uagb-forms-main-submit-button:active {
  transform: translateY(1px);
}

.uagb-forms-main-form .uagb-forms-main-submit-button:focus-visible {
  outline: 3px solid rgba(229, 91, 92, 0.45);
  outline-offset: 2px;
}

.uagb-forms-main-form .uagb-forms-main-submit-button[disabled] {
  opacity: 0.65;
  cursor: default;
}

/* The block's own result messages, styled to match instead of bare text. */
[class*="uagb-forms-success-message-"],
[class*="uagb-forms-failed-message-"] {
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: 8px;
  border: 1px solid;
  font-size: 0.9375rem;
}

[class*="uagb-forms-success-message-"] {
  border-color: #b7e0c2;
  background: #eefaf1;
  color: #1c6b34;
}

[class*="uagb-forms-failed-message-"] {
  border-color: #f0bdb8;
  background: #fdeeec;
  color: #a3271f;
}

.uagb-forms-submit-message-hide {
  display: none;
}

@media (max-width: 600px) {
  .uagb-forms-main-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .uagb-forms-main-form .uagb-forms-main-submit-button {
    width: 100%;
  }
}
