/* Survey page only. Loaded after styles.css. */

.survey-preview-banner {
  display: inline-block;
  margin: 0.5rem 0 1rem;
  padding: 0.6rem 0.9rem;
  color: var(--amber);
  background: var(--amber-pale);
  border-left: 4px solid var(--amber);
}

.survey-form { display: grid; gap: 2rem; max-width: 46rem; }

.survey-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }

.survey-form .survey-group {
  padding: 1.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.25rem;
}

.survey-group > legend {
  float: left;
  width: 100%;
  margin-bottom: 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2.5vw, 1.7rem);
  font-weight: 700;
  line-height: 1.25;
}

.survey-group > legend + * { clear: left; }

.survey-step {
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  margin-right: 0.4rem;
  color: var(--white);
  background: var(--ink);
  border-radius: 50%;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.95rem;
  vertical-align: 0.15em;
}

.survey-question { margin-top: 1.5rem; }

.survey-question > legend,
.survey-field-label {
  display: block;
  margin-bottom: 0.6rem;
  font-weight: 700;
  line-height: 1.4;
}

.survey-required,
.survey-optional {
  margin-left: 0.3rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
}

.survey-choice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.35rem 0;
  padding: 0.45rem 0.6rem;
  line-height: 1.4;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0.15rem;
  cursor: pointer;
}

.survey-choice:has(input:checked) { background: var(--navy-pale); border-color: var(--ink); }

.survey-choice input {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.1rem 0 0;
  accent-color: var(--ink);
}

.survey-columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  column-gap: 0.6rem;
}

.survey-input {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.6rem 0.7rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line-dark);
  border-radius: 0.15rem;
  font: inherit;
}

.survey-input-short { max-width: 9rem; }

textarea.survey-input { resize: vertical; }

.survey-hint { margin: 0.4rem 0 0; color: var(--ink-soft); font-size: 0.9rem; }

.survey-skip-note { margin-bottom: 0.5rem; }

/* Works without JavaScript: browsers that support :has() collapse section 2
   when "Not a parent" is chosen. Others show it with the skip note. */
.survey-form:has(#role-non-parent:checked) .parent-only { display: none; }

/* Show the July follow-ups only after "Yes". Browsers without :has() drop
   this rule and show them with the "answer only if" note. */
.survey-form:not(:has(#july-yes:checked)) .july-followup { display: none; }

.survey-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.survey-submit .button[disabled] { cursor: not-allowed; opacity: 0.55; }

@media (max-width: 680px) {
  .survey-form .survey-group { padding: 1rem; }
}

/* Turnstile widget and submit */
.survey-turnstile { min-height: 65px; margin: 1rem 0 0.5rem; }

/* Survey admin page */
.admin-status { color: var(--ink-soft); }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.75rem; }
.admin-card { display: grid; gap: 0.2rem; padding: 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: 0.25rem; }
.admin-card-value { font-family: Georgia, "Times New Roman", serif; font-size: 2rem; font-weight: 700; line-height: 1.1; }
.admin-card-label { color: var(--ink-soft); font-size: 0.9rem; }
.admin-two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 2rem; }
.admin-subhead { margin-top: 2rem; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; background: var(--white); }
.admin-table th, .admin-table td { padding: 0.5rem 0.6rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.admin-table th { background: var(--navy-pale); }
.admin-responses td:nth-child(6) { max-width: 22rem; }
.admin-flag { display: inline-block; margin: 0 0.2rem 0.2rem 0; padding: 0.05rem 0.35rem; background: var(--amber-pale); border-radius: 0.15rem; font-size: 0.8rem; }
.admin-action { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.admin-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.admin-filter select { min-height: 2.5rem; padding: 0.4rem 0.6rem; font: inherit; border: 1px solid var(--line-dark); border-radius: 0.15rem; background: var(--white); }
.admin-glossary { margin-top: 1rem; font-size: 0.88rem; }
.admin-glossary dt { margin-top: 0.6rem; font-family: ui-monospace, Menlo, monospace; font-weight: 700; }
.admin-glossary dd { margin: 0.1rem 0 0; color: var(--ink-soft); }
