/*
 * Rubin AC21 Screening — WordPress-scoped stylesheet
 * All questionnaire rules are isolated to the AC21 shortcode so the
 * active WordPress/Elementor theme cannot override core questionnaire
 * typography and the questionnaire cannot restyle the surrounding site.
 */
.ac21-shell,
.ac21-shell * { box-sizing: border-box; }

.ac21-shell {
  width: min(100% - 2rem, 62rem);
  margin: clamp(1rem, 4vw, 4rem) auto;
  color: #24211f;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.ac21-shell button,
.ac21-shell input { font: inherit; }

.ac21-shell a { color: #7b251f; text-underline-offset: .18em; }
.ac21-shell a:focus-visible,
.ac21-shell button:focus-visible,
.ac21-shell input:focus-visible,
.ac21-shell summary:focus-visible,
.ac21-skip:focus-visible { outline: 3px solid #c9832b; outline-offset: 3px; }

.ac21-skip {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 99999;
  padding: .8rem 1rem;
  background: #fff;
  color: #000;
}
.ac21-skip:focus { top: 1rem; }

.ac21-shell .ac21-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid #ded7cf;
  border-radius: .5rem;
  box-shadow: 0 1rem 3rem rgb(48 35 25 / 10%);
}

.ac21-shell .ac21-header {
  padding: 1.1rem clamp(1.1rem, 4vw, 2.5rem);
  color: #fff;
  background: #301d1b;
}

.ac21-shell .ac21-eyebrow,
.ac21-shell .ac21-result-label {
  margin: 0;
  color: #b4864b;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ac21-shell #ac21-content { padding: clamp(1.25rem, 4vw, 3rem); }

/* Higher-specificity typography prevents Elementor/theme heading rules from
   collapsing the questionnaire title's line-height or changing its typeface. */
.ac21-shell #ac21-content h1,
.ac21-shell #ac21-content h2,
.ac21-shell #ac21-content legend {
  color: #301d1b;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.18;
  letter-spacing: normal;
  text-transform: none;
}

.ac21-shell #ac21-content h1,
.ac21-shell #ac21-content legend {
  margin: 0 0 1.25rem;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 500;
}

.ac21-shell #ac21-content h2 {
  margin-top: 1.6rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.ac21-shell fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.ac21-shell #ac21-content legend { width: 100%; }
.ac21-shell .ac21-examples { display: grid; gap: .25rem; margin: 1.25rem 0 1.75rem; padding-left: 1.25rem; }
.ac21-shell .ac21-options { display: grid; gap: .75rem; margin: 1.5rem 0; }
.ac21-shell .ac21-option { display: flex; min-height: 3.25rem; gap: .8rem; align-items: flex-start; padding: .9rem 1rem; border: 1px solid #cec5bc; border-radius: .35rem; cursor: pointer; }
.ac21-shell .ac21-option:hover { border-color: #8d3a31; background: #fbf7f2; }
.ac21-shell .ac21-option:has(input:checked) { border-color: #7b251f; box-shadow: inset 0 0 0 1px #7b251f; background: #fff8f0; }
.ac21-shell .ac21-option input { width: 1.25rem; height: 1.25rem; margin: .15rem 0 0; flex: 0 0 auto; accent-color: #7b251f; }
.ac21-shell .ac21-option small { display: block; margin-top: .35rem; color: #5f5752; line-height: 1.4; }
.ac21-shell .ac21-actions,
.ac21-shell .ac21-nav { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.ac21-shell .ac21-nav { margin: 0; padding: 0 clamp(1.25rem, 4vw, 3rem) clamp(1.25rem, 4vw, 2rem); }
.ac21-shell .ac21-button { min-height: 2.75rem; min-width: 5rem; padding: .7rem 1.15rem; border: 1px solid transparent; border-radius: .25rem; font-weight: 700; cursor: pointer; }
.ac21-shell .ac21-button-primary { color: #fff; background: #7b251f; }
.ac21-shell .ac21-button-primary:hover { background: #5e1d18; }
.ac21-shell .ac21-button-secondary { color: #4b211d; border-color: #7b251f; background: #fff; }
.ac21-shell .ac21-button-link { color: #64251f; background: transparent; text-decoration: underline; }
.ac21-shell .ac21-button[aria-disabled="true"] { cursor: not-allowed; opacity: .62; }
.ac21-shell .ac21-progress-wrap { margin-top: .75rem; }
.ac21-shell .ac21-progress-label { display: flex; justify-content: space-between; font-size: .82rem; }
.ac21-shell .ac21-progress { height: .35rem; margin-top: .3rem; overflow: hidden; border-radius: 1rem; background: #6c5855; }
.ac21-shell .ac21-progress span { display: block; width: 0; height: 100%; background: #c5904d; transition: width .2s ease; }
.ac21-shell .ac21-date-fields { display: grid; gap: .9rem; margin: 1.4rem 0; padding: 1rem; background: #f7f3ee; border: 1px solid #ddd2c5; }
.ac21-shell .ac21-date-fields legend { margin: 0 0 .5rem; font-family: Arial, Helvetica, sans-serif; font-size: 1rem; font-weight: 700; }
.ac21-shell .ac21-field { display: grid; gap: .35rem; }
.ac21-shell .ac21-field input { width: min(100%, 22rem); min-height: 2.75rem; padding: .55rem; border: 1px solid #776f69; border-radius: .2rem; }
.ac21-shell .ac21-q5-calculator { margin: 1rem 0 0; }
.ac21-shell .ac21-q5-calculator > .ac21-button-link { padding-inline: 0; text-align: left; }
.ac21-shell .ac21-q5-calculator-panel { display: grid; gap: 1rem; margin-top: .75rem; padding: 1rem; border: 1px solid #cec5bc; border-radius: .35rem; background: #fbf7f2; }
.ac21-shell .ac21-q5-calculator-panel[hidden] { display: none; }
.ac21-shell .ac21-q5-calculator-panel .ac21-button { justify-self: start; }
.ac21-shell .ac21-q5-calculator-panel .ac21-error { margin: 0; }
.ac21-shell .ac21-q5-calculator-panel .ac21-calculation { overflow-wrap: anywhere; }
.ac21-shell .ac21-error { margin: 1rem 0; padding: .8rem; color: #7a0d0d; border-left: .3rem solid #a41313; background: #fff1f1; }
.ac21-shell .ac21-result-label { margin-bottom: .5rem; }
.ac21-shell .ac21-date-summary { margin: 1.2rem 0; padding: 1rem; background: #f7f0e7; border-left: .3rem solid #b4864b; }
.ac21-shell .ac21-result-section,
.ac21-shell .ac21-review { margin: 1.75rem 0 0; padding-top: .2rem; border-top: 1px solid #d9d1c9; }
.ac21-shell .ac21-result-section h2,
.ac21-shell .ac21-review h2 { margin: 1rem 0 .65rem; }
.ac21-shell .ac21-result-section.ac21-warning { padding: .25rem 1rem 1rem; border: 1px solid #d4a270; border-left: .35rem solid #a94f28; background: #fff8ef; }
.ac21-shell .ac21-review ol,
.ac21-shell .ac21-review ul { padding-left: 1.25rem; }
.ac21-shell .ac21-review h3 { margin: 1.25rem 0 .4rem; font-size: 1rem; }
.ac21-shell .ac21-sources { margin-top: 2rem; padding-top: 1rem; border-top: 2px solid #ddd5cc; }
.ac21-shell .ac21-cta { margin: 2rem 0 1rem; padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid #cdbda9; background: #fbf6ef; }
.ac21-shell .ac21-cta h2 { margin-top: 0; }
.ac21-shell .ac21-disclaimer { margin-top: 2rem; padding: 1rem; font-size: .92rem; background: #f3f1ef; }
.ac21-shell .ac21-debug { width: min(100%, 62rem); margin: 1rem auto; padding: 1rem; background: #1e1e1e; color: #e7e7e7; }
.ac21-shell .ac21-debug pre { overflow: auto; white-space: pre-wrap; }
.ac21-shell .ac21-table-wrap { overflow-x: auto; }
.ac21-shell table { width: 100%; border-collapse: collapse; }
.ac21-shell td { padding: .55rem; border: 1px solid #bbb; vertical-align: top; }
.ac21-shell .ac21-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.ac21-shell [hidden] { display: none !important; }
.ac21-shell .ac21-q5-manual-panel { margin-top: .5rem; padding-top: .75rem; border-top: 1px solid #ded6cf; }
.ac21-shell .ac21-q5-manual-panel[hidden] { display: none; }
.ac21-shell .ac21-q5-manual-panel legend { margin-bottom: .5rem; font-weight: 600; }

@media (max-width: 36rem) {
  .ac21-shell { width: 100%; margin: 0; }
  .ac21-shell .ac21-card { min-height: 100vh; border: 0; border-radius: 0; }
  .ac21-shell .ac21-actions .ac21-button { width: 100%; }
  .ac21-shell #ac21-content { overflow-wrap: anywhere; }
}

@media print {
  .ac21-shell { width: 100%; margin: 0; }
  .ac21-shell .ac21-card { border: 0; box-shadow: none; }
  .ac21-shell .ac21-header,
  .ac21-shell .ac21-nav,
  .ac21-shell .ac21-no-print,
  .ac21-shell .ac21-debug,
  .ac21-skip { display: none !important; }
  .ac21-shell #ac21-content { padding: 0; }
  .ac21-shell .ac21-result-section,
  .ac21-shell .ac21-review { break-inside: avoid; border: 0; }
  .ac21-shell .ac21-cta .ac21-actions { display: none; }
  .ac21-shell a { color: #000; text-decoration: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ac21-shell *,
  .ac21-shell *::before,
  .ac21-shell *::after { scroll-behavior: auto !important; transition: none !important; }
}
