/**
 * @file
 * Institutional styling for the contact webform (rbuf_contact_form) and its
 * confirmation panel. Plain CSS (no Tailwind scan dependency); scoped to
 * .inst-rbuf-webform. Palette: deep navy #0B2C4A, action blue #1F6AE1.
 *
 * Loaded only on the contact variant via library seeds_tailwind/rbuf_contact_webform.
 */

.inst-rbuf-webform {
  --inst-navy: #0b2c4a;
  --inst-action: #1f6ae1;
  --inst-border: #d8e0ea;
  --inst-text: #334155;
  --inst-muted: #64748b;
}

/* Vertical rhythm between fields (clean, no per-field boxes). */
.inst-rbuf-webform .form-item,
.inst-rbuf-webform .js-form-item,
.inst-rbuf-webform .webform-element {
  margin: 0 0 1.5rem;
  padding: 0;
  border: 0;
  background: none;
}

/* Labels. */
.inst-rbuf-webform label,
.inst-rbuf-webform .fieldset-legend {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--inst-navy);
}

/* Required asterisk in action blue. */
.inst-rbuf-webform .form-required::after,
.inst-rbuf-webform label.js-form-required::after {
  content: " *";
  color: var(--inst-action);
  font-weight: 700;
}

/* Help / description text. */
.inst-rbuf-webform .description,
.inst-rbuf-webform .webform-element-description,
.inst-rbuf-webform .form-item__description {
  margin-top: 0.45rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--inst-muted);
}

/* Inputs, selects, textarea — shared base. */
.inst-rbuf-webform input[type="text"],
.inst-rbuf-webform input[type="email"],
.inst-rbuf-webform input[type="tel"],
.inst-rbuf-webform input[type="url"],
.inst-rbuf-webform input[type="number"],
.inst-rbuf-webform select,
.inst-rbuf-webform textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  line-height: 1.5;
  font-family: inherit;
  color: #0f172a;
  background-color: #fff;
  border: 1px solid var(--inst-border);
  border-radius: 0.6rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.inst-rbuf-webform input::placeholder,
.inst-rbuf-webform textarea::placeholder {
  color: #94a3b8;
}

.inst-rbuf-webform input:hover,
.inst-rbuf-webform select:hover,
.inst-rbuf-webform textarea:hover {
  border-color: #b6c2d3;
}

.inst-rbuf-webform input:focus,
.inst-rbuf-webform select:focus,
.inst-rbuf-webform textarea:focus,
.inst-rbuf-webform input:focus-visible,
.inst-rbuf-webform select:focus-visible,
.inst-rbuf-webform textarea:focus-visible {
  border-color: var(--inst-action);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(31, 106, 225, 0.18);
}

/* Custom select chevron. */
.inst-rbuf-webform select {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 16px 16px;
  cursor: pointer;
}

.inst-rbuf-webform textarea {
  min-height: 150px;
  resize: vertical;
}

/* Inline validation errors. */
.inst-rbuf-webform input.error,
.inst-rbuf-webform select.error,
.inst-rbuf-webform textarea.error,
.inst-rbuf-webform .form-item--error-message + input {
  border-color: #dc2626;
}

.inst-rbuf-webform input.error:focus,
.inst-rbuf-webform textarea.error:focus,
.inst-rbuf-webform select.error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

.inst-rbuf-webform .form-item--error-message,
.inst-rbuf-webform .error-message {
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  color: #dc2626;
}

/* Actions / submit. */
.inst-rbuf-webform .form-actions,
.inst-rbuf-webform .webform-actions {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--inst-border);
  background: transparent;
}

.inst-rbuf-webform .webform-button--submit,
.inst-rbuf-webform .form-actions .button--primary,
.inst-rbuf-webform .form-actions input[type="submit"].button--primary,
.inst-rbuf-webform button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff !important;
  background: var(--inst-action) !important;
  border: none !important;
  border-radius: 0.6rem;
  box-shadow: 0 6px 16px rgba(31, 106, 225, 0.28);
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.inst-rbuf-webform .webform-button--submit:hover,
.inst-rbuf-webform .form-actions .button--primary:hover,
.inst-rbuf-webform button[type="submit"]:hover {
  background: #195ac0 !important;
  box-shadow: 0 8px 20px rgba(31, 106, 225, 0.34);
}

.inst-rbuf-webform .webform-button--submit:active,
.inst-rbuf-webform button[type="submit"]:active {
  transform: translateY(1px);
}

.inst-rbuf-webform .webform-button--submit:focus-visible,
.inst-rbuf-webform .form-actions .button--primary:focus-visible,
.inst-rbuf-webform button[type="submit"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 106, 225, 0.4);
}

@media (max-width: 640px) {
  .inst-rbuf-webform .webform-button--submit,
  .inst-rbuf-webform button[type="submit"] {
    width: 100%;
  }
}

/* Confirmation panel (shown after a successful submit, type = page). */
.webform-confirmation {
  margin: 0;
  padding: 1.75rem;
  background: #ffffff;
  border: 1px solid #d8e0ea;
  border-left: 4px solid #1f6ae1;
  border-radius: 0.9rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.webform-confirmation__title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: #0b2c4a;
}

.webform-confirmation__message {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #334155;
}

.webform-confirmation__message p {
  margin: 0 0 0.75rem;
}

.webform-confirmation__message p:last-child {
  margin-bottom: 0;
}

.webform-confirmation__back .button,
.webform-confirmation__back a {
  display: inline-flex;
  align-items: center;
  margin-top: 1.25rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0b2c4a;
  text-decoration: none;
  background: #fff;
  border: 1px solid #d8e0ea;
  border-radius: 0.55rem;
  transition: background-color 0.15s ease;
}

.webform-confirmation__back .button:hover,
.webform-confirmation__back a:hover {
  background: #eef2f7;
}
