/*
  BBA Interactive Framework
  Phase 1 shared CSS.

  Scope:
  - Reusable launcher component.
  - Reusable modal application shell.
  - Placeholder renderer styles.
  - WordPress-friendly class names.
  - No tool-specific visual rules.
*/

:root {
  --bba-ifw-blue: #2477a8;
  --bba-ifw-blue-dark: #185a82;
  --bba-ifw-blue-soft: #e7f4fb;
  --bba-ifw-text: #1d2f3d;
  --bba-ifw-muted: #667784;
  --bba-ifw-border: #d7e3ec;
  --bba-ifw-surface: #ffffff;
  --bba-ifw-soft: #f5faff;
  --bba-ifw-focus: #2f7dd1;
  --bba-ifw-shadow: 0 1.25rem 3rem rgba(24, 90, 130, 0.18);
}

.bba-interactive-launcher,
.bba-interactive-launcher *,
.bba-interactive-modal,
.bba-interactive-modal *,
.bba-interactive-standalone,
.bba-interactive-standalone * {
  box-sizing: border-box;
}

.bba-interactive-launcher {
  max-width: 680px;
  margin: 1.5rem auto;
  padding: 1.25rem;
  border: 1px solid var(--bba-ifw-border);
  border-radius: 12px;
  background: var(--bba-ifw-surface);
  color: var(--bba-ifw-text);
  box-shadow: 0 0.85rem 2rem rgba(24, 90, 130, 0.1);
}

.bba-launcher-kicker,
.bba-launcher-title,
.bba-launcher-copy {
  margin-top: 0;
}

.bba-launcher-kicker {
  margin-bottom: 0.4rem;
  color: var(--bba-ifw-muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bba-launcher-title {
  margin-bottom: 0.55rem;
  color: var(--bba-ifw-text);
  font-size: 1.45rem;
  font-weight: 850;
  line-height: 1.16;
}

.bba-launcher-copy {
  margin-bottom: 1rem;
  color: var(--bba-ifw-muted);
  font-size: 1rem;
  line-height: 1.45;
}

.bba-launcher-button,
.bba-interactive-close,
.bba-interactive-primary-action,
.bba-interactive-secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  border-radius: 10px;
  font: inherit;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.bba-launcher-button,
.bba-interactive-primary-action {
  width: 100%;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--bba-ifw-blue);
  background: var(--bba-ifw-blue);
  color: #ffffff;
  box-shadow: 0 0.45rem 1rem rgba(36, 119, 168, 0.18);
}

.bba-launcher-button:hover,
.bba-interactive-primary-action:hover {
  border-color: var(--bba-ifw-blue-dark);
  background: var(--bba-ifw-blue-dark);
  color: #ffffff;
  transform: translateY(-1px);
}

.bba-interactive-primary-action:disabled,
.bba-interactive-secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

.bba-launcher-button:focus-visible,
.bba-interactive-close:focus-visible,
.bba-interactive-primary-action:focus-visible,
.bba-interactive-secondary-action:focus-visible {
  outline: 3px solid var(--bba-ifw-focus);
  outline-offset: 3px;
}

.bba-interactive-scroll-lock {
  overflow: hidden !important;
}

.bba-interactive-modal[hidden] {
  display: none !important;
}

.bba-interactive-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  min-height: 100vh;
  padding: 0;
  background: rgba(10, 28, 40, 0.58);
  color: var(--bba-ifw-text);
}

.bba-interactive-dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  width: 100%;
  min-height: 100vh;
  max-height: 100vh;
  margin: 0;
  overflow: hidden;
  background: var(--bba-ifw-surface);
}

.bba-interactive-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
  padding: 1rem;
  border-bottom: 1px solid var(--bba-ifw-border);
  background: var(--bba-ifw-surface);
}

.bba-interactive-eyebrow,
.bba-interactive-title,
.bba-interactive-intro,
.bba-interactive-time {
  margin-top: 0;
}

.bba-interactive-brand-logo {
  display: inline-flex;
  width: min(34vw, 128px);
  max-height: 44px;
  margin: 0 0 0.45rem;
  overflow: hidden;
}

.bba-interactive-brand-logo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 44px;
  object-fit: contain;
  object-position: left center;
}

.bba-interactive-brand-logo:focus-visible {
  outline: 3px solid var(--bba-ifw-focus);
  outline-offset: 4px;
  border-radius: 4px;
}

.bba-interactive-eyebrow {
  margin-bottom: 0.35rem;
  color: var(--bba-ifw-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bba-interactive-title {
  margin-bottom: 0.45rem;
  color: var(--bba-ifw-text);
  font-size: 1.55rem;
  font-weight: 850;
  line-height: 1.12;
}

.bba-interactive-intro {
  margin-bottom: 0;
  color: var(--bba-ifw-muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

.bba-interactive-time {
  margin: 0.65rem 0 0;
  color: var(--bba-ifw-blue-dark);
  font-size: 0.85rem;
  font-weight: 750;
}

.bba-interactive-close {
  width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: 1px solid var(--bba-ifw-border);
  background: #ffffff;
  color: var(--bba-ifw-text);
  font-size: 1.35rem;
  box-shadow: none;
}

.bba-interactive-close:hover {
  border-color: var(--bba-ifw-blue);
  background: var(--bba-ifw-blue-soft);
  color: var(--bba-ifw-blue-dark);
}

.bba-interactive-body {
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, var(--bba-ifw-soft) 100%);
}

.bba-interactive-shell {
  max-width: 680px;
  margin: 0 auto;
}

.bba-interactive-placeholder {
  padding: 1.25rem;
  border: 1px solid var(--bba-ifw-border);
  border-radius: 12px;
  background: var(--bba-ifw-surface);
  box-shadow: 0 0.8rem 2rem rgba(24, 90, 130, 0.08);
}

.bba-interactive-placeholder h3 {
  margin: 0 0 0.75rem;
  color: var(--bba-ifw-text);
  font-size: 1.35rem;
  line-height: 1.2;
}

.bba-interactive-placeholder p {
  margin: 0 0 1rem;
  color: var(--bba-ifw-muted);
  font-size: 1rem;
  line-height: 1.55;
}

.bba-interactive-placeholder p:last-child {
  margin-bottom: 0;
}

.bba-quiz {
  display: block;
}

.bba-quiz [hidden] {
  display: none !important;
}

.bba-quiz-progress {
  margin-bottom: 1.5rem;
  padding: 1.1rem;
  border: 1px solid var(--bba-ifw-border);
  border-radius: 10px;
  background: var(--bba-ifw-soft);
}

.bba-quiz-progress h3,
.bba-question-step {
  margin: 0 0 0.75rem;
  color: var(--bba-ifw-blue-dark);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bba-quiz-progress p {
  margin: 0 0 0.75rem;
  color: var(--bba-ifw-muted);
  font-weight: 700;
}

.bba-quiz-progress progress {
  display: block;
  width: 100%;
  height: 0.9rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #dcebf5;
  color: var(--bba-ifw-blue);
}

.bba-quiz-progress progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #dcebf5;
}

.bba-quiz-progress progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bba-ifw-blue), #65add4);
}

.bba-quiz-progress progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bba-ifw-blue), #65add4);
}

.bba-question {
  margin-bottom: 1.5rem;
  padding: 1.35rem;
  border: 1px solid var(--bba-ifw-border);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
}

.bba-question fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.bba-question legend {
  width: 100%;
  margin-bottom: 1.25rem;
  padding: 0;
  color: var(--bba-ifw-text);
  font-size: 1.35rem;
  font-weight: 850;
  line-height: 1.25;
}

.bba-question-help {
  margin: -0.65rem 0 1.15rem;
  color: var(--bba-ifw-muted);
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.45;
}

.bba-question p {
  margin: 0 0 0.9rem;
}

.bba-question p:last-child {
  margin-bottom: 0;
}

.bba-question input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.bba-question label {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--bba-ifw-border);
  border-radius: 10px;
  background: var(--bba-ifw-soft);
  color: var(--bba-ifw-text);
  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.35;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.bba-question label::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 1.45rem;
  width: 1.45rem;
  height: 1.45rem;
  border: 2px solid var(--bba-ifw-border);
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 850;
  line-height: 1;
  content: "";
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.bba-question label:hover {
  border-color: var(--bba-ifw-blue);
  background: #eef8ff;
  transform: translateY(-1px);
}

.bba-question input[type="radio"]:checked + label {
  border-color: var(--bba-ifw-blue);
  background: var(--bba-ifw-blue);
  color: #ffffff;
  box-shadow: 0 0.55rem 1.15rem rgba(36, 119, 168, 0.22);
}

.bba-question input[type="radio"]:checked + label::before {
  border-color: #ffffff;
  background: #ffffff;
  color: var(--bba-ifw-blue);
  content: "✓";
}

.bba-question input[type="radio"]:focus-visible + label {
  outline: 3px solid var(--bba-ifw-focus);
  outline-offset: 2px;
}

.bba-quiz-navigation {
  margin-top: 1.5rem;
}

.bba-quiz-navigation-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.bba-result {
  margin-top: 2rem;
  padding: 1.5rem;
  border: 2px solid var(--bba-ifw-border);
  border-radius: 12px;
  background: var(--bba-ifw-surface);
}

.bba-result-hero {
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
  margin: 0 auto 2rem;
  border-radius: 12px;
  box-shadow: 0 1rem 2.25rem rgba(24, 90, 130, 0.18);
}

.bba-result-title {
  margin: 0 0 1.5rem;
  color: inherit;
  font-size: 1.85rem;
  line-height: 1.25;
}

.bba-result-category {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.bba-result-explanation {
  margin: 0 0 1.6rem;
  font-size: 1.08rem;
  font-weight: 750;
}

.bba-result-next-steps {
  margin-top: 1.5rem;
}

.bba-result-next-steps h4,
.bba-result-detail h4,
.bba-safety-notice h4,
.bba-learn-more h4 {
  margin: 0 0 0.5rem;
  color: inherit;
  font-size: 1rem;
  line-height: 1.25;
}

.bba-result-detail {
  margin-top: 1.45rem;
}

.bba-result-detail p {
  margin: 0;
  font-weight: 650;
  line-height: 1.55;
}

.bba-result-next-steps ol {
  display: grid;
  gap: 0.9rem;
  margin: 0;
  padding-left: 1.25rem;
}

.bba-result-next-steps li {
  padding: 0.9rem 1rem;
  border: 1px solid currentColor;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.56);
  font-weight: 650;
}

.bba-safety-notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  margin-top: 2rem;
  padding: 1.15rem;
  border: 1px solid #b8d3ed;
  border-radius: 10px;
  background: #eef7ff;
  color: #1f4d72;
}

.bba-safety-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2.2rem;
  padding-bottom: 0.15rem;
  background: #2f6f9f;
  color: #ffffff;
  clip-path: polygon(50% 0, 88% 14%, 82% 72%, 50% 100%, 18% 72%, 12% 14%);
  font-size: 0.95rem;
  font-weight: 850;
  line-height: 1;
}

.bba-safety-notice p {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 650;
}

.bba-safety-notice p:last-child {
  margin-bottom: 0;
}

.bba-learn-more {
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid currentColor;
}

.bba-learn-more p {
  margin: 0 0 0.9rem;
  font-weight: 750;
}

.bba-learn-more a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0.95rem 1.25rem;
  border: 1px solid var(--bba-ifw-blue);
  border-radius: 10px;
  background: var(--bba-ifw-blue);
  color: #ffffff;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 0.45rem 1rem rgba(36, 119, 168, 0.18);
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.bba-learn-more a:hover {
  border-color: var(--bba-ifw-blue-dark);
  background: var(--bba-ifw-blue-dark);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 0.65rem 1.25rem rgba(24, 90, 130, 0.22);
  transform: translateY(-1px);
}

.bba-learn-more a:focus-visible {
  outline: 3px solid var(--bba-ifw-focus);
  outline-offset: 2px;
}

.bba-result[data-bba-result-color="green"] {
  border-color: #59ad76;
  background: #eaf7ef;
  color: #174f2d;
}

.bba-result[data-bba-result-color="yellow"] {
  border-color: #dfb246;
  background: #fff7df;
  color: #654a05;
}

.bba-result[data-bba-result-color="orange"] {
  border-color: #d99031;
  background: #fff4e3;
  color: #653a06;
}

.bba-result[data-bba-result-color="blue"] {
  border-color: #6fb1df;
  background: #edf7ff;
  color: #1f5f8c;
}

.bba-result[data-bba-result-color="red"] {
  border-color: #d97968;
  background: #fff0ed;
  color: #7b2b21;
}

.bba-result[data-bba-result-color="gray"] {
  border-color: #b7c0c8;
  background: #f4f6f8;
  color: #3f4b55;
}

.bba-interactive-action-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  margin-top: 1.25rem;
}

.bba-interactive-secondary-action {
  width: 100%;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--bba-ifw-blue);
  background: #ffffff;
  color: var(--bba-ifw-blue-dark);
}

.bba-interactive-secondary-action:hover {
  background: var(--bba-ifw-blue-soft);
}

.bba-interactive-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.bba-interactive-standalone {
  max-width: 760px;
  margin: 1.5rem auto;
}

.bba-interactive-standalone .bba-interactive-dialog {
  min-height: auto;
  max-height: none;
  border: 1px solid var(--bba-ifw-border);
  border-radius: 12px;
  box-shadow: var(--bba-ifw-shadow);
}

.bba-interactive-standalone .bba-interactive-body {
  overflow: visible;
}

.bba-interactive-standalone .bba-interactive-close {
  display: none;
}

@media (min-width: 42rem) {
  .bba-interactive-launcher {
    padding: 1.5rem;
  }

  .bba-launcher-button,
  .bba-interactive-primary-action,
  .bba-interactive-secondary-action {
    width: auto;
  }

  .bba-interactive-modal {
    place-items: center;
    padding: 2rem;
  }

  .bba-interactive-dialog {
    width: min(100%, 760px);
    min-height: 0;
    max-height: min(86vh, 820px);
    border-radius: 14px;
    box-shadow: var(--bba-ifw-shadow);
  }

  .bba-interactive-header {
    padding: 1.4rem 1.5rem;
  }

  .bba-interactive-title {
    font-size: 1.9rem;
  }

  .bba-interactive-body {
    padding: 1.5rem;
  }

  .bba-interactive-placeholder {
    padding: 1.5rem;
  }

  .bba-interactive-action-row {
    grid-template-columns: auto auto;
    justify-content: start;
  }

  .bba-question,
  .bba-result {
    padding: 2.25rem;
  }

  .bba-quiz-navigation-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
