/* Chapter 7 vs. Chapter 13 quiz. Everything is scoped under .bkq so it can't
   leak into the theme. Colors and type follow the theme (Bootstrap 5.3 +
   Helvetica Neue, primary #0d6efd). Mobile first. */

.bkq {
  --bkq-primary: #0d6efd;
  --bkq-primary-dark: #0a58ca;
  --bkq-border: #ced4da;
  --bkq-text: #212529;
  --bkq-muted: #6c757d;
  --bkq-danger: #dc3545;
  --bkq-note-bg: #fff8e1;
  --bkq-note-border: #f0c36d;
  margin: 0 auto 2rem;
  max-width: 640px;
  color: var(--bkq-text);
}

.bkq-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.75rem;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
  padding: 1.25rem 1rem 1.5rem;
}

.bkq-progress {
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.bkq-progress-bar {
  height: 100%;
  width: 0;
  background: var(--bkq-primary);
  transition: width 0.3s ease;
}

.bkq-short-disclaimer {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--bkq-muted);
  margin: 0 0 1rem;
}

/* Fixed minimum height so the card doesn't jump between short and long screens. */
.bkq-screen {
  min-height: 420px;
}

.bkq-fieldset,
.bkq-subfieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.bkq-fieldset > legend,
.bkq-sublegend {
  float: none;
  width: 100%;
  padding: 0;
}

.bkq .bkq-question,
.bkq .bkq-result-headline {
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 0 0 1.25rem;
}
.bkq .bkq-question:focus,
.bkq .bkq-result-headline:focus {
  outline: none;
}
.bkq .bkq-question:focus-visible,
.bkq .bkq-result-headline:focus-visible {
  outline: 3px solid var(--bkq-primary);
  outline-offset: 4px;
  border-radius: 2px;
}

.bkq-sublegend {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

/* --- Answer options: full-width tap targets ------------------------------ */
.bkq-options {
  display: grid;
  gap: 0.6rem;
}
.bkq-options-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* Options look like the evaluation form's option buttons
   (.btn.btn-outline-primary.option-btn): blue outline and text, filled blue
   with white text when selected. The real radio/checkbox stays in the DOM,
   visually hidden, so keyboard and screen-reader behavior is unchanged. */
.bkq-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  margin: 0;
  padding: 15px;
  border: 1px solid var(--bkq-primary);
  border-radius: 8px;
  background: #fff;
  color: var(--bkq-primary);
  font-size: 1rem;
  line-height: 1.5;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}
.bkq-option.is-checked {
  background-color: var(--bkq-primary);
  color: #fff;
}
/* Hover fill only on devices with a real pointer, so a tap on a phone
   doesn't leave an unselected option looking selected. */
@media (hover: hover) {
  .bkq-option:hover {
    background-color: var(--bkq-primary);
    color: #fff;
  }
}
.bkq-option:focus-within {
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.5);
}

.bkq-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.bkq-multi-row {
  display: grid;
  gap: 0.5rem;
}
.bkq-sub-amount {
  padding: 0 0.25rem 0.25rem;
}

/* --- Dollar inputs -------------------------------------------------------- */
.bkq-amount {
  position: relative;
}
.bkq-amount-prefix {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.15rem;
  color: var(--bkq-muted);
  pointer-events: none;
}
.bkq .bkq-amount-input {
  padding-left: 2rem;
  font-size: 1.15rem;
}

.bkq .form-select-lg,
.bkq .form-control-lg {
  min-height: 56px;
}

.bkq-prior {
  display: grid;
  gap: 1.25rem;
}

/* --- Errors --------------------------------------------------------------- */
.bkq-error {
  color: var(--bkq-danger);
  font-size: 0.95rem;
  margin-top: 0.75rem;
}
.bkq-error:empty {
  display: none;
}
.bkq [aria-invalid="true"] {
  border-color: var(--bkq-danger);
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.2);
}

/* --- Navigation ----------------------------------------------------------- */
.bkq-nav {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.bkq-nav .btn {
  min-height: 52px;
}
.bkq-back {
  flex: 0 0 auto;
}
.bkq-next {
  flex: 1 1 auto;
  margin-left: auto;
}

/* --- Result screen -------------------------------------------------------- */
.bkq-result p {
  margin-bottom: 1rem;
}
.bkq-notes {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: grid;
  gap: 0.75rem;
}
.bkq-note {
  margin: 0;
  padding: 0.75rem 1rem;
  background: var(--bkq-note-bg);
  border-left: 4px solid var(--bkq-note-border);
  border-radius: 0.375rem;
  line-height: 1.5;
}
.bkq-cta-wrap {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  margin: 1.5rem 0 1.25rem;
}
.bkq .bkq-cta {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.bkq .bkq-restart {
  font-size: 0.95rem;
}
.bkq-disclaimer {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--bkq-muted);
  margin: 0;
}

.bkq a:focus-visible,
.bkq .btn:focus-visible {
  outline: 3px solid var(--bkq-primary);
  outline-offset: 2px;
}

@media (min-width: 576px) {
  .bkq-card {
    padding: 2rem 2rem 2rem;
  }
  .bkq .bkq-question,
  .bkq .bkq-result-headline {
    font-size: 1.5rem;
  }
  .bkq-next {
    flex: 0 0 auto;
    min-width: 180px;
  }
  .bkq .bkq-cta {
    width: auto;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bkq-progress-bar,
  .bkq-option {
    transition: none;
  }
}
