/* The forms, as Formsite drew them.
 *
 * Everything here is driven by the custom properties in forms/themes.css,
 * which are read out of the CSS Formsite built for each form. This file is
 * the shape those values hang on: a centred card on a coloured page, section
 * headings as a full-width bar, labels above their fields, and a solid
 * rectangular submit button. None of it applies until something asks for a
 * theme, so the admin side is untouched.
 *
 * Scoped to .form-page rather than body.form-page, so that the design system
 * page in the admin can put a working form inside a div and have it look like
 * the real thing — which is the whole point of having it.
 *
 * The shape is the same across all nineteen originals. What differs between
 * them is the font, the width, the corner radius and the colours — which is
 * exactly what the properties carry.
 */

:root {
  /* The style the largest number of the originals wore: eleven of nineteen.
     A form with no theme of its own looks like this. */
  --fs-page-bg: #eeeeee;
  --fs-page-font: Arial, 'Helvetica Neue', Helvetica, sans-serif;
  --fs-page-size: 12px;
  --fs-form-width: 820px;
  --fs-form-bg: #ffffff;
  --fs-form-border: 1px solid #666666;
  --fs-form-radius: 4px;
  --fs-ink: #333333;
  --fs-link: #0000ee;
  --fs-section-ink: #ffffff;
  --fs-section-bg: #014b7e;
  --fs-field-bg: #ffffff;
  --fs-field-border: 1px solid #999999;
  --fs-field-ink: #333333;
  --fs-field-font: 'Lato', sans-serif;
  --fs-button-bg: #014b7e;
  --fs-button-ink: #ffffff;
  --fs-button-font: 'Lato', sans-serif;
  --fs-button-hover: #3299df;
  --fs-error: #ff0000;
}

/* ---- the page and the card ------------------------------------------- */

body.form-page { margin: 0; }

.form-page {
  padding: 24px 12px 64px;
  background: var(--fs-page-bg);
  color: var(--fs-ink);
  font-family: var(--fs-page-font);
  font-size: var(--fs-page-size);
  line-height: 1.5;
}

.form-page .wrap {
  max-width: var(--fs-form-width);
  margin: 0 auto;
  padding: 24px 28px 28px;
  background: var(--fs-form-bg);
  border: var(--fs-form-border);
  border-radius: var(--fs-form-radius);
}

.form-page a { color: var(--fs-link); }

.form-page h1 {
  margin: 0 0 14px;
  font-size: 1.6em;
  font-weight: 700;
  color: var(--fs-ink);
}

.form-page p { color: var(--fs-ink); }

/* ---- the letterhead ---------------------------------------------------
   A picture across the top of the card, then the logo above the title. Both
   are set per form from the admin and both are optional. */

.form-page .form-hero {
  margin: -24px -28px 18px;
  line-height: 0;
}
.form-page .form-hero img {
  display: block;
  width: 100%;
  height: auto;
  /* The card's own corners, so the picture does not square off the top of a
     theme that is rounded. */
  border-radius: var(--fs-form-radius) var(--fs-form-radius) 0 0;
}

.form-page .form-logo { margin: 0 0 14px; }
.form-page .form-logo img {
  display: block;
  max-width: min(320px, 100%);
  height: auto;
}

/* A picture placed inside the form itself, rather than set as branding: the
   logo at the top of each OCF page, the bond banner, the Cayman diagram.
   Thirteen of the fifteen such images are wider than a phone and one of them
   is 6250px across, so without this they decide the width of the page and the
   form scrolls sideways under a logo sixteen times the screen. */
.form-page .form-image { margin: 0 0 14px; }
.form-page .form-image img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ---- the section heading bar ------------------------------------------
   The single most recognisable thing about these forms. Full width of the
   card, flat, the form's accent colour, white text. */

.form-page h2.section {
  margin: 22px 0 14px;
  padding: 7px 12px;
  font-size: 1.1em;
  font-weight: 700;
  color: var(--fs-section-ink);
  background: var(--fs-section-bg);
  border-radius: 0;
}

/* ---- questions --------------------------------------------------------- */

.form-page .field { margin: 0 0 14px; }

.form-page .field label,
.form-page .field .label {
  display: block;
  margin: 0 0 4px;
  font-weight: 700;
  color: var(--fs-ink);
}

.form-page .required { color: var(--fs-error); }

.form-page .help {
  margin: 0 0 5px;
  font-size: .92em;
  font-style: italic;
  color: var(--fs-ink);
  opacity: .75;
}

.form-page input[type=text],
.form-page input[type=email],
.form-page input[type=tel],
.form-page input[type=number],
.form-page input[type=password],
.form-page input[type=date],
.form-page select,
.form-page textarea {
  width: 100%;
  padding: 5px 7px;
  color: var(--fs-field-ink);
  background: var(--fs-field-bg);
  border: var(--fs-field-border);
  border-radius: 2px;
  font-family: var(--fs-field-font);
  font-size: 1em;
}

.form-page textarea { min-height: 88px; }

.form-page input:focus,
.form-page select:focus,
.form-page textarea:focus {
  outline: 2px solid var(--fs-section-bg);
  outline-offset: 1px;
}

/* A radio or a tick sits beside its words, not above them. */
.form-page .choice {
  display: block;
  margin: 0 0 3px;
  font-weight: 400;
}
.form-page .choice input { margin-right: 6px; }

/* ---- what the form says went wrong ------------------------------------- */

.form-page .error,
.form-page .error-summary {
  color: var(--fs-error);
  font-weight: 700;
}
.form-page .error-summary {
  margin: 0 0 14px;
  padding: 8px 12px;
  border: 1px solid var(--fs-error);
  background: #fff5f5;
}
.form-page .field.has-error input,
.form-page .field.has-error select,
.form-page .field.has-error textarea { border-color: var(--fs-error); }

/* ---- the buttons ------------------------------------------------------- */

.form-page .actions {
  margin: 22px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid rgba(0, 0, 0, .12);
}

.form-page button,
.form-page .button {
  padding: 8px 22px;
  color: var(--fs-button-ink);
  background: var(--fs-button-bg);
  border: 0;
  border-radius: 2px;
  font-family: var(--fs-button-font);
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
}
.form-page button:hover,
.form-page .button:hover { background: var(--fs-button-hover); }

.form-page button.secondary {
  color: var(--fs-ink);
  background: transparent;
  border: var(--fs-field-border);
}
.form-page button.secondary:hover { background: rgba(0, 0, 0, .05); }

.form-page .progress {
  margin: 0 0 12px;
  font-size: .95em;
  opacity: .8;
}
