/*
 * cms-form: the site's form look (the Influent contact form's), for any form on a CMS page.
 *
 *   <h2 class="cms-form__heading">Title</h2><div class="cms-form__underline"></div>
 *   <div class="cms-form">
 *     <p class="cms-form__note">fields marked * are required.</p>
 *     <div class="cms-form__fields">
 *       <div class="cms-form__grid">                       two columns; one on phones
 *         <div class="cms-form__field cms-form__field--full">  --full: across both columns
 *           <label class="cms-form__label" for="x">Name *</label>
 *           <input class="cms-form__input" id="x">            also <select class="cms-form__input">
 *         </div>
 *       </div>
 *     </div>
 *     <fieldset class="cms-form__options">
 *       <legend class="cms-form__legend">*Choose:</legend>
 *       <ul class="cms-form__list">
 *         <li><input type="checkbox" id="a"><label for="a">Option <small>detail</small></label></li>
 *         (or type="radio" with a shared name, for one choice only)
 *       </ul>
 *     </fieldset>
 *     <div class="cms-form__actions">
 *       <button type="button" class="cms-form__btn">Send</button>
 *       <a class="cms-form__link" href="privacy-policy">Privacy Policy</a>
 *     </div>
 *     <p class="cms-form__status" role="status"></p>        cms-form__status--error for errors
 *   </div>
 *
 * A field shows as invalid when its input has aria-invalid="true". Every rule is scoped to
 * .cms-form and sets what it needs, so the site's own input and button styles do not leak in.
 *
 * Text sizes are the site's own, on every screen: the system font, 1rem (16px) with a 1.5 line
 * height (UIkit's html), 1.1rem for paragraphs (amada.css p), and 1rem uppercase buttons
 * (.uk-button). Sizes are in rem, so they follow the site if its base ever changes.
 */

.cms-form {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 72px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 36px;
  background: #fff;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: #1f1f22;
  text-align: left;
}

.cms-form *,
.cms-form *::before,
.cms-form *::after {
  box-sizing: border-box;
}

.cms-form [hidden] {
  display: none !important;
}

/* heading above the form (outside .cms-form) */
.cms-form__heading {
  margin: 0;
  padding-top: 8px;
  font-size: 2.5rem;
  color: #3e3e3e;
  text-align: center;
}

.cms-form__underline {
  width: 200px;
  height: 2.5px;
  margin: 0 auto;
  background: #ef413d;
}

/* the site's paragraph size (amada.css p) */
.cms-form__note,
.cms-form p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.5;
}

.cms-form__note {
  color: #3e3e44;
}

/* fields */
.cms-form__fields {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.cms-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 32px;
}

.cms-form__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.cms-form__field--full {
  grid-column: 1 / -1;
}

.cms-form__label {
  display: block;
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none;
  color: #3e3e44;
  transition: color .15s ease;
}

.cms-form__field:focus-within .cms-form__label {
  color: #1f1f22;
}

.cms-form .cms-form__input {
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid #b9b9be;
  border-radius: 4px;
  background: #fff;
  box-shadow: none;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 400;
  line-height: normal;
  color: #1f1f22;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.cms-form input.cms-form__input {
  -webkit-appearance: none;
  appearance: none;
}

.cms-form select.cms-form__input {
  -webkit-appearance: auto;
  appearance: auto;
  padding-right: 6px;
}

.cms-form .cms-form__input:hover {
  border-color: #1f1f22;
}

.cms-form .cms-form__input:focus {
  border-color: #000;
  outline: 0;
}

.cms-form .cms-form__input:focus-visible {
  box-shadow: 0 1px 0 0 #1f1f22;
}

/* invalid */
.cms-form__field:has([aria-invalid="true"]) .cms-form__label {
  color: #b8322a;
}

.cms-form .cms-form__input[aria-invalid="true"] {
  border-bottom-color: #b8322a;
  box-shadow: 0 1px 0 0 #b8322a;
}

/* check-box list */
.cms-form__options {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.cms-form__legend {
  display: block;
  padding: 0;
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none;
  color: #3e3e44;
}

.cms-form ul.cms-form__list {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #d4d4d8;
  border-radius: 8px;
  overflow: hidden;
}

.cms-form__options:has([aria-invalid="true"]) .cms-form__list {
  border-color: #b8322a;
}

.cms-form .cms-form__list li {
  position: relative;
  margin: 0;
  padding: 0;
  line-height: 1.5;
  list-style: none;
  transition: background-color .15s ease;
}

.cms-form .cms-form__list li::before {
  content: none;
}

.cms-form .cms-form__list li + li {
  border-top: 1px solid #d4d4d8;
}

.cms-form .cms-form__list li:hover {
  background: #e0e0e0;
}

.cms-form .cms-form__list li:has(input:checked) {
  background: #ef413d;
  color: #fff;
}

.cms-form .cms-form__list li label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 60px;
  margin: 0;
  padding: 10px 56px 10px 18px;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: normal;
  color: inherit;
  cursor: pointer;
}

.cms-form .cms-form__list li label small {
  display: block;
  margin-top: 2px;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #5a5a60;
}

.cms-form .cms-form__list li:has(input:checked) label small {
  color: #fff;
}

.cms-form .cms-form__list li input[type="checkbox"],
.cms-form .cms-form__list li input[type="radio"] {
  position: absolute;
  right: 18px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0;
  accent-color: #000;
  cursor: pointer;
}

.cms-form .cms-form__list li input[type="checkbox"]:focus-visible,
.cms-form .cms-form__list li input[type="radio"]:focus-visible {
  outline: 2px solid #1f1f22;
  outline-offset: 3px;
}

/* button, link, status */
.cms-form__actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.cms-form .cms-form__btn {
  display: inline-block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid #000;
  border-radius: 4px;
  background: #f0413d;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 42px;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.cms-form .cms-form__btn:hover {
  background: #000;
  border-color: #f0413d;
  color: #fff;
}

.cms-form .cms-form__btn:focus {
  outline: 0;
}

.cms-form .cms-form__btn:focus-visible {
  outline: 2px solid #1f1f22;
  outline-offset: 3px;
}

.cms-form .cms-form__btn:disabled {
  opacity: .6;
  cursor: default;
}

.cms-form a.cms-form__link,
.cms-form button.cms-form__link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 1rem;
  color: #b8322a;
  text-decoration: underline;
  cursor: pointer;
}

.cms-form a.cms-form__link:hover,
.cms-form button.cms-form__link:hover {
  color: #8e241e;
}

.cms-form .cms-form__status {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  color: #ef413d;
}

.cms-form__status:empty {
  display: none;
}

.cms-form .cms-form__status--error,
.cms-form .cms-form__status.is-error {
  font-size: 1rem;
  font-weight: 700;
  color: #b8322a;
}

@media (max-width: 600px) {
  .cms-form {
    padding: 40px 20px;
    gap: 28px;
  }

  .cms-form__grid {
    grid-template-columns: 1fr;
  }

  .cms-form .cms-form__btn {
    width: calc(100% - 6px);
  }
}

@media (max-width: 370px) {
  .cms-form__field {
    max-width: 84vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cms-form * {
    transition: none !important;
  }
}

/*
 * Page layout: the form beside its title and picture.
 *
 *   <div class="cms-form-page">
 *     <aside class="cms-form-page__aside">
 *       <img class="cms-form-page__image" src="..." width="650" height="307" alt="...">
 *       <h1 class="cms-form-page__title">Title</h1>
 *     </aside>
 *     <div class="cms-form-page__main"><div class="cms-form">...</div></div>
 *     <div class="cms-form-page__panel">             optional: a dark box of reasons
 *       <h2 class="cms-form-page__panel-title">Title</h2>
 *       <ul class="cms-form-page__list"><li>...</li></ul>
 *       <p class="cms-form-page__cta">Closing line.</p>
 *     </div>
 *   </div>
 *
 * Wide screens: the form on the left, the picture and title on the right. Narrow screens: a
 * short strip (title, small picture) above the form, so the form starts near the top; the panel
 * goes under the title on wide screens and after the form on narrow ones. Pages
 * that use it hide the master's banner in their header code.
 */
.cms-form-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "aside" "main" "panel";
  gap: 20px;
  max-width: 1140px;
  margin: 0 auto;
}

.cms-form-page__main {
  grid-area: main;
  min-width: 0;
}

/* The strip above already spaces it from the header. */
.cms-form-page .cms-form-page__main .cms-form {
  padding-top: 0;
}

.cms-form-page .cms-form-page__aside {
  grid-area: aside;
  display: flex;
  align-items: stretch;
  margin: 0;
  background: #d53636;
  overflow: hidden;
}

.cms-form-page .cms-form-page__image {
  order: 2;
  display: block;
  flex: 0 0 38%;
  min-width: 0;
  max-width: 180px;
  height: auto;
  object-fit: cover;
  background: #fff;
}

.cms-form-page .cms-form-page__title {
  flex: 1;
  align-self: center;
  margin: 0;
  padding: 12px 16px;
  font-family: stratum2-bold, Arial, sans-serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: normal;
  text-transform: uppercase;
  color: #fff;
}

.cms-form-page .cms-form-page__panel {
  grid-area: panel;
  align-self: start;
  margin: 0;
  padding: 26px 26px 28px;
  border-top: 4px solid #d53636;
  background: linear-gradient(160deg, #3a3a3f 0%, #1c1c1f 55%, #111113 100%);
  color: #f2f2f2;
}

.cms-form-page .cms-form-page__panel-title {
  margin: 0 0 18px;
  font-family: Copperplate, "Copperplate Gothic Light", "Copperplate Gothic", stratum2-bold, Arial, sans-serif;
  font-size: 24px;
  font-weight: 400;
  font-variant: small-caps;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: none;
  color: #ef413d;
}

.cms-form-page .cms-form-page__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cms-form-page .cms-form-page__list li {
  position: relative;
  margin: 0 0 14px;
  padding: 0 0 0 22px;
  font-size: 1.1rem;
  line-height: 1.5;
  color: #f2f2f2;
}

.cms-form-page .cms-form-page__list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.6em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef413d;
}

.cms-form-page .cms-form-page__cta {
  margin: 24px 0 0;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  color: #fff;
}

/* Tablets: the same strip, with a bigger picture and title. */
@media (min-width: 600px) and (max-width: 959px) {
  .cms-form-page .cms-form-page__image {
    flex-basis: 50%;
    max-width: 400px;
  }

  .cms-form-page .cms-form-page__title {
    padding: 18px 24px;
    font-size: 28px;
  }
}

@media (min-width: 960px) {
  .cms-form-page {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
    grid-template-rows: auto 1fr;
    grid-template-areas: "main aside" "main panel";
    gap: 28px 56px;
    align-items: start;
  }

  .cms-form-page .cms-form-page__aside {
    display: block;
    background: none;
    overflow: visible;
  }

  .cms-form-page .cms-form-page__image {
    width: 100%;
    max-width: none;
  }

  .cms-form-page .cms-form-page__title {
    position: relative;
    margin: -24px 0 0 20px;
    padding: 18px 22px;
    font-size: 30px;
    background: #d53636;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  }
}
