/* ============================================================
   CKB Form Foundation R1
   Shared presentation for site-native forms.
   Business semantics remain distinct across Registration,
   Newsletter, Library and Contact flows.
   ============================================================ */

.form-page-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 30px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
}
.form-page-back:hover,
.form-page-back:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.shared-form-section {
  max-width: 980px;
  padding-top: 42px;
}
.shared-form-heading {
  margin: 0 0 10px;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.05;
  letter-spacing: -.03em;
  font-weight: 600;
}
.shared-form-intro {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}
.shared-form-section .service-form { padding-top: 34px; }

.form-prototype-state {
  margin-top: 20px;
  max-width: 760px;
  padding: 14px 16px;
  border-left: 2px solid var(--ink);
  background: rgba(11,11,11,.035);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}
.form-prototype-state[hidden] { display: none !important; }

.form-fallback {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.form-fallback a {
  margin-left: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .065em;
  text-decoration: none;
}
.form-fallback a:hover,
.form-fallback a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.form-context-note {
  margin: 16px 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* Keep browser-native validation visible without inventing custom errors. */
.form-grid input:focus-visible,
.form-grid select:focus-visible,
.form-grid textarea:focus-visible {
  outline: 2px solid transparent;
  border-bottom-width: 2px;
}

@media (max-width: 860px) {
  .form-page-back { margin-bottom: 20px; }
  .shared-form-section { padding-top: 30px; }
  .shared-form-heading { font-size: 28px; }
  .shared-form-intro { font-size: 15px; }
  .shared-form-section .service-form { padding-top: 28px; }
  .form-fallback { margin-top: 20px; }
  .form-fallback a {
    display: block;
    margin: 8px 0 0;
    min-height: 44px;
    line-height: 44px;
  }
}

@media (max-width: 640px) {
  .shared-form-heading { font-size: 26px; }
  .form-prototype-state { font-size: 13px; }
}

/* Keep long service-form page titles from orphaning a final letter on phones. */
@media (max-width: 640px) {
  body[data-page="library-reservation"] .service-hero h1 {
    font-size: 38px !important;
    line-height: 1.02;
    letter-spacing: -.035em;
    overflow-wrap: normal !important;
    word-break: normal;
    hyphens: none;
  }
}
