/* THE BLUE PENCIL · the contact page's form and its side cards
   Loaded only by contact.html, after tokens.css and styles.css.
   Errors are words, not colour: red is only ever the 1.5px margin line, never words and never a control's only edge.
   The form's markup is fixed (js/main.js and the lead function read it), so every look here hangs on its existing classes. */

/* ── the form ── */
.lead-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* the bot trap: kept off the page exactly as before */
.lead-form .honey {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* the hidden attribute always wins: a hidden group, error or banner never shows */
.form-group[hidden],
.field-error[hidden],
.banner-success[hidden],
.banner-error[hidden] {
  display: none;
}

/* labels: DM Sans 500, ink */
.form-group label {
  font-family: var(--fb);
  font-size: var(--read);
  font-weight: var(--w-label);
  color: var(--ink);
}

.form-group label .optional {
  font-weight: var(--w-read);
  color: var(--ink-soft);
}

/* the required mark: the coach's ultramarine, Libre Baskerville italic, never red */
.form-group:has(> input[required]) > label::after,
.form-group:has(> select[required]) > label::after,
.form-group:has(> textarea[required]) > label::after {
  content: " *";
  font-family: var(--fd);
  font-style: italic;
  font-weight: var(--w-read);
  color: var(--ultra);
}

/* the signed field: a 2px ink edge, square, the page ground, a 4px inset well in the ruling grey.
   Native select arrows stay (accessibility over ornament). */
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: var(--w-field) solid var(--ink);
  background: var(--page);
  box-shadow: inset var(--s1) var(--s1) 0 var(--rule);
  color: var(--ink);
  font: var(--w-read) 16px/1.3 var(--fb);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--ink-soft);
  opacity: 1;
}

.form-group textarea {
  resize: vertical;
}

/* focus: a 3px ultramarine edge plus the 2px ring outside it, on every focus (mouse too).
   The padding gives back the extra 1px of edge, so nothing shifts. */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-width: var(--w-frame);
  border-color: var(--ultra);
  padding: 11px 13px;
  outline: var(--ring-w) solid var(--ultra);
  outline-offset: var(--ring-gap);
}

/* an error: the field's edge goes to 3px ink, and the red margin line is drawn in the gutter to its left.
   The line is decoration only; the words below the field carry the meaning. */
.form-group.has-error::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(-1 * var(--s3));
  width: var(--w-margin);
  background: var(--margin);
  pointer-events: none;
}

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-width: var(--w-frame);
  padding: 11px 13px;
}

.form-group.has-error input:not(:focus),
.form-group.has-error select:not(:focus),
.form-group.has-error textarea:not(:focus) {
  border-color: var(--ink);
}

/* the error's words: ink, with the coach's query mark pencilled before them.
   A data URI cannot read a CSS variable, so the mark's stroke is --ultra written out (encoded); no request is made. */
.field-error {
  display: block;
  padding-left: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M11 2.2C6 1.4 2.1 4.6 2.3 9.6c.2 4.6 3.6 8.2 8.2 8 4.4-.2 7.4-3.6 7.2-7.8-.2-3.6-2.6-6.6-6.4-7.2' fill='none' stroke='%232742B5' stroke-width='1.4' stroke-linecap='round'/%3E%3Cpath d='M7.6 7.6c.2-1.6 1.4-2.5 2.8-2.4 1.5.1 2.5 1.2 2.3 2.6-.2 1.3-1.2 1.8-2 2.3-.6.4-.8.9-.8 1.6v.6' fill='none' stroke='%232742B5' stroke-width='1.8' stroke-linecap='round'/%3E%3Ccircle cx='9.9' cy='14.6' r='1.1' fill='%232742B5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0 1px;
  background-size: 20px 20px;
  color: var(--ink);
  font-family: var(--fb);
  font-size: var(--read);
  font-weight: var(--w-label);
  line-height: 1.4;
}

/* the submit button: the shared press look-alike (.btn.btn-primary in styles.css), 52px high (over the 44px minimum),
   its focus ring already pushed out past the shadow block there */
.lead-form .btn {
  align-self: flex-start;
  min-height: max(var(--tap), 52px);
}

/* ── the banners ── */

/* sent: the signed toast, ink ground, white words, a tick drawn in CSS (still; nothing animates) */
.banner-success {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  margin-bottom: 24px;
  padding: var(--s3) 18px;
  background: var(--ink);
  color: var(--page);
  font-family: var(--fb);
  font-size: var(--read);
  font-weight: var(--w-label);
  line-height: var(--lh-body);
}

.banner-success::before {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 13px;
  margin: 2px 4px 0 6px;
  border-right: 3px solid var(--page);
  border-bottom: 3px solid var(--page);
  transform: rotate(45deg);
}

.banner-success a {
  color: var(--on-ink-soft);
}

/* not sent: a 3px ink frame on the page with the red margin line inside its left edge; ink words */
.banner-error {
  position: relative;
  margin-bottom: 24px;
  padding: var(--s3) 18px var(--s3) 44px;
  background: var(--page);
  border: var(--w-frame) solid var(--ink);
  color: var(--ink);
  font-family: var(--fb);
  font-size: var(--read);
  font-weight: var(--w-label);
  line-height: var(--lh-body);
}

.banner-error::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 26px;
  width: var(--w-margin);
  background: var(--margin);
  pointer-events: none;
}

.banner-error a {
  color: var(--ultra);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── the side cards (the page chrome beside the form) ── */

/* the two rows in the first card are h3 now (the page's heading order runs h2 to h3), with the same small tracked capitals */
.contact-row h3 {
  margin: 0 0 4px;
  color: var(--ink-soft);
  font: var(--w-caps) 12px/1.3 var(--fb);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
}

/* the last row in a card sits on the card's own padding, with no extra gap under it */
.contact-card .contact-row:last-child {
  margin-bottom: 0;
}
