/* /audit-exemption-calculator only (Figma 2183:595 and the checker states 2209:3705).
   Shared tokens, buttons, header, footer and the "Try one client file" block live in styles.css. */

.calc {
  display: flex;
  align-items: flex-start;
  gap: 64px;
  padding-bottom: 24px;
}

/* The checker card */
.checker {
  flex: 0 1 720px;
  min-width: 0;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.checker-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}
.checker-step[hidden] {
  display: none;
}
.checker-progress {
  color: var(--brand);
  font-size: 13px;
  line-height: normal;
  letter-spacing: 0;
  white-space: pre-wrap;
}
.checker-title {
  color: var(--brand);
  font-size: 28px;
  font-weight: 500;
  line-height: 36px;
  letter-spacing: -1.7px;
}
.checker-title:focus {
  outline: none;
}

/* One question: a legend (or label) and its answers */
.q {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.q legend,
.q-label,
.limits > legend {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  color: var(--text-2);
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.25px;
}
.lim:not(:empty)::before {
  content: " · ";
}
.opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* Real radio buttons, drawn as the design's answer buttons */
.opts input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.opts label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 100ms ease;
}
.opts:has(input:checked) label {
  border-color: var(--border-strong);
}
.opts label:hover {
  background: #f6f8fc;
}
.opts label:active {
  transform: scale(0.97);
}
.opts input:checked + label {
  border-color: var(--navy-200);
  background: var(--navy-100);
}
.opts input:focus-visible + label {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(31, 56, 100, 0.55);
}
.q.is-invalid .opts label,
.date[aria-invalid="true"] {
  border-color: #c2410c;
}
.q-error {
  margin-top: 8px;
  color: #b42318;
  font-size: 13px;
  line-height: 18px;
  letter-spacing: 0;
}
.q-error[hidden] {
  display: none;
}
.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: normal;
  letter-spacing: 0;
}
.hint a {
  text-decoration: underline;
}
.date {
  width: 240px;
  max-width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-2);
  font: inherit;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.25px;
}
.date:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(31, 56, 100, 0.55);
}

/* "Within the limit in all three years?" */
.limits {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 0;
  border-radius: 8px;
  background: var(--subtle);
}
.limits[hidden] {
  display: none;
}
.limits > legend {
  float: left;
  width: 100%;
  margin-bottom: 0;
}
.limits > legend + .q {
  clear: both;
}

.checker-go[aria-disabled="true"] {
  opacity: 0.4;
  box-shadow: none;
}
.checker-go[aria-disabled="true"]:hover {
  border-color: var(--brand);
  background: var(--brand);
}
.checker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Result */
.result-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 24px;
  border-radius: 8px;
  background: #e6f4ea;
  color: var(--text-2);
  font-size: 18px;
  line-height: 28px;
  letter-spacing: -0.25px;
}
.result-box.is-review {
  background: var(--navy-100);
}
.result-box.is-audit {
  background: #fff6e5;
}
.result-reasons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
  line-height: 22px;
  letter-spacing: -0.075px;
}
.result-reasons:empty {
  display: none;
}
.result-next {
  color: var(--text-2);
  font-size: 18px;
  line-height: 28px;
  letter-spacing: -0.25px;
}
.text-btn {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.text-btn:hover {
  color: var(--text);
}

/* The column beside the checker */
.calc-side {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  min-width: 0;
  padding-top: 8px;
}
.calc-side-title {
  color: var(--brand);
  font-size: 28px;
  font-weight: 500;
  line-height: 36px;
  letter-spacing: -1.7px;
}
.calc-side .lead {
  color: var(--text-2);
}
.calc-privacy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 24px;
  border-radius: 12px;
  background: var(--subtle);
  color: var(--text-2);
  font-size: 18px;
  line-height: 28px;
  letter-spacing: -0.25px;
}
.calc-privacy .calc-privacy-note {
  color: var(--muted);
  font-size: 15px;
  line-height: 22px;
  letter-spacing: -0.075px;
}
.calc-source {
  color: var(--muted);
  font-size: 15px;
  line-height: 22px;
}
a.calc-source:hover {
  color: var(--text);
  text-decoration: underline;
}

/* The next stage replaces the question: a short fade and a 4 px rise (about 180 ms). */
.checker-step.is-in {
  animation: step-in 260ms var(--ease-out);
  pointer-events: none;
}
@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(calc(8px * var(--move)));
  }
}

/* The decision trail (motion guide 2348:1167): one line per answered stage, the newest marked
   with a short navy underline that draws in (about 300 ms). Once it has a line, it takes the
   intro's place. */
.calc-side.has-trail .calc-intro {
  display: none;
}
.trail {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
  list-style: none;
}
.trail[hidden] {
  display: none;
}
.trail li {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  animation: trail-in 300ms ease-out;
}
.trail-label {
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}
.trail-text {
  grid-column: 1;
  color: var(--text-2);
  font-size: 15px;
  line-height: 22px;
  letter-spacing: -0.075px;
}
.trail li[data-at="2"] .trail-text {
  color: var(--text);
  font-weight: 500;
}
.trail-edit {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  padding: 4px 0;
  color: var(--brand);
  font-size: 14px;
  line-height: 20px;
}
.trail-edit:hover {
  color: var(--brand-hover);
}
.trail li.is-current::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 32px;
  height: 2px;
  background: var(--brand);
  transform-origin: left;
  animation: trail-underline 300ms ease-out;
}
@keyframes trail-in {
  from {
    opacity: 0;
    transform: translateY(calc(6px * var(--move)));
  }
}
@keyframes trail-underline {
  from {
    transform: scaleX(calc(1 - var(--move)));
  }
}

/* Below 1024px the two columns stack; below 768px one tighter column. */
@media (max-width: 1180px) {
  .calc {
    gap: 40px;
  }
  .calc-side {
    flex-basis: 260px;
  }
}
@media (max-width: 1023px) {
  .calc {
    flex-direction: column;
    gap: 40px;
  }
  .checker {
    flex-basis: auto;
    width: 100%;
  }
  .calc-side {
    flex-basis: auto;
    width: 100%;
    padding-top: 0;
  }
}
@media (max-width: 767px) {
  .checker {
    padding: 24px 20px;
  }
  .checker-title,
  .calc-side-title {
    font-size: 24px;
    line-height: 32px;
    letter-spacing: -1px;
  }
  .opts label {
    padding: 0 16px;
  }
  .result-box {
    padding: 20px;
  }
}
