.form-type-badge {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  margin: 0 auto 18px;
  padding: 12px 28px;
  border-radius: var(--control-radius);
  background: var(--fg);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(26,26,26,.35);
  font-family: var(--font-jp);
  font-size: clamp(15px, 1.6vw, 18px);
  font-weight: 600;
}

.form-page-hero .lead p { margin: 0 0 14px; }

.form-page-hero .lead p:last-child { margin-bottom: 0; }

.form-page-hero .lead strong { color: var(--fg); font-weight: 600; }

/* ============================================================
   Form section
   ============================================================ */
.form-section {
  padding: clamp(12px, 2vh, 24px) var(--pad-x) clamp(64px, 9vh, 100px);
  background: var(--bg);
}

.form-wrap {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

/* ============================================================
   Hearing form (extends contact form pattern)
   ============================================================ */
.hearing-form,
.contact-form {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: clamp(28px, 4vw, 48px);
  font-family: var(--font-jp);
}

.field { margin-bottom: 28px; }

.field:last-of-type { margin-bottom: 32px; }

.field-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 6px;
  line-height: 1.5;
}

.required-badge,
.optional-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  flex-shrink: 0;
}
.required-badge { background: var(--required); color: #fff; }
.optional-badge { background: #E5E4E2; color: #333; }

.field-help {
  font-size: 14px;
  color: var(--muted-soft);
  margin: 0 0 12px;
  line-height: 1.7;
}

.form-preamble {
  margin-bottom: 28px;
  padding: 22px 24px;
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--muted-soft);
  font-family: var(--font-jp);
  font-size: var(--text-sm);
  line-height: 1.9;
}
.form-preamble .note {
  margin: 0 0 12px;
  padding-left: 1em;
  text-indent: -1em;
}
.form-preamble .note:last-of-type { margin-bottom: 0; }
.form-preamble strong { color: var(--fg); font-weight: 600; }

.sublabel {
  font-size: 14px;
  color: var(--muted-soft);
  margin-bottom: 6px;
  font-weight: 500;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 540px) {
  .row-2 { grid-template-columns: 1fr; }
}

.input,
.textarea {
  width: 100%;
  font-family: var(--font-jp);
  font-size: 16px;
  color: var(--fg);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 13px 16px;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}

.input::placeholder,
.textarea::placeholder {
  color: rgba(26,26,26,.32);
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--fg);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12);
}

.textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.75;
}

.textarea-sm {
  min-height: 96px;
}

select.input {
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 14px;
  cursor: pointer;
}
select.input:invalid,
select.input option[value=""] { color: rgba(26,26,26,.45); }
select.input option { color: var(--fg); }

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
}

.radio-group-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
}

.radio-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: var(--fg);
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
  line-height: 1.5;
}

.radio-item input[type="radio"],
.radio-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  margin: 0;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color .15s;
  background: #fff;
}

.radio-item input[type="radio"] { border-radius: 50%; }

.radio-item input[type="checkbox"] { border-radius: 4px; }

.radio-item input[type="radio"]:checked,
.radio-item input[type="checkbox"]:checked {
  border-color: var(--fg);
}
.radio-item input[type="radio"]:checked::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--fg);
  content: "";
  transform: translate(-50%, -50%);
}
.radio-item input[type="checkbox"]:checked::after {
  position: absolute;
  top: 1px;
  left: 5px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}
.radio-item input[type="checkbox"]:checked { background: var(--fg); }

.uni-group-heading {
  grid-column: 1 / -1;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-jp);
  font-size: var(--text-sm);
  font-weight: 600;
}
.uni-group-heading:not(:first-child) { margin-top: 8px; }

.subfield {
  margin-top: 14px;
  padding: 18px 20px;
  border-radius: 10px;
  background: var(--bg-soft);
}
.subfield-label {
  display: block;
  margin-bottom: 8px;
  color: var(--fg);
  font-family: var(--font-jp);
  font-size: var(--text-sm);
  font-weight: 600;
}

.privacy-field {
  margin-top: 16px;
  padding: 20px 24px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-soft);
}
.privacy-field p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.9;
}
.privacy-field .radio-item { font-weight: 600; }
.privacy-field a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Submit */
.submit-row {
  text-align: center;
  margin-top: 36px;
}

.submit-btn {
  min-width: 200px;
  padding: 16px 56px;
  border: 0;
  border-radius: var(--control-radius);
  background: var(--fg);
  color: #fff;
  font-family: var(--font-jp);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  cursor: pointer;
  transition: background var(--control-transition), transform var(--control-transition),
    opacity var(--control-transition);
}
.submit-btn:hover:not(:disabled) { background: #343432; }

.submit-btn:active:not(:disabled) {
  transform: scale(.98);
}

.submit-btn:disabled {
  background: rgba(26,26,26,.12);
  color: rgba(26,26,26,.45);
  cursor: not-allowed;
}

.form-error {
  display: none;
  margin-top: 20px;
  padding: 14px 18px;
  border: 1px solid rgba(179, 38, 30, .18);
  border-radius: 8px;
  background: rgba(179, 38, 30, .07);
  color: #B3261E;
  font-size: var(--text-sm);
  line-height: 1.7;
}
.form-error.is-shown { display: block; }

.field.is-conditional { display: none; }
.field.is-conditional.is-shown {
  display: block;
  animation: form-field-in .25s ease;
}
@keyframes form-field-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Visually hidden anti-spam field shared by public forms. */
.honeypot-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
