/* =========================================
   CoFIM Assessment CSS
   Two-stage card UI, gating notice,
   escape hatch dialog.
   ========================================= */

/* ── Step label ── */
.cofim-step-label {
  font-family: var(--font-head);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin: 0 0 8px;
}

/* Stage question text */
.cofim-stage-q {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--c-text);
  margin: 0 0 14px;
  line-height: 1.45;
}

/* ── Stage 1: A/B/C/D choice cards ── */

.cofim-stage1 { margin-top: 4px; }

.cofim-choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}

.cofim-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border-radius: 9px;
  border: 1.5px solid var(--c-border);
  background: var(--c-surface);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--c-text);
  line-height: 1.45;
  transition: border-color 140ms, background 140ms, box-shadow 140ms;
}

.cofim-choice:hover {
  border-color: var(--c-orange);
  background: rgba(201, 148, 0, 0.04);
}

.cofim-choice.active {
  border-color: var(--c-orange);
  background: rgba(201, 148, 0, 0.06);
  box-shadow: 0 0 0 3px rgba(201, 148, 0, 0.15);
}

.cofim-choice-letter {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--c-surface2);
  border: 1.5px solid var(--c-border);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-muted);
  transition: background 140ms, border-color 140ms, color 140ms;
}

.cofim-choice.active .cofim-choice-letter {
  background: var(--c-orange);
  border-color: var(--c-orange);
  color: #fff;
}

.cofim-choice-text {
  flex: 1;
}

/* ── Stage 2: descriptor reveal ── */

.cofim-stage2-wrap {
  display: none;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1.5px solid var(--c-border);
}

.cofim-stage2-wrap.show {
  display: block;
  animation: fadeUp 0.2s ease both;
}

.cofim-descriptors {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.cofim-descriptor {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  padding: 14px 16px;
  border-radius: 9px;
  border: 1.5px solid var(--c-border);
  background: var(--c-surface);
  cursor: pointer;
  font-family: inherit;
  color: var(--c-text);
  transition: border-color 140ms, background 140ms, box-shadow 140ms;
}

.cofim-descriptor:hover {
  border-color: var(--c-orange);
  background: rgba(201, 148, 0, 0.04);
}

.cofim-descriptor.active {
  border-color: var(--c-orange);
  background: rgba(201, 148, 0, 0.06);
  box-shadow: 0 0 0 3px rgba(201, 148, 0, 0.15);
}

.cofim-descriptor--none {
  border-style: dashed;
  opacity: 0.8;
}

.cofim-descriptor--none:hover,
.cofim-descriptor--none.active {
  opacity: 1;
  border-style: solid;
}

.cofim-descriptor--confirmed {
  cursor: default;
  border-color: var(--c-orange);
  background: rgba(201, 148, 0, 0.06);
  border-left: 3px solid var(--c-orange);
}

.cofim-descriptor--confirmed:hover {
  border-color: var(--c-orange);
  background: rgba(201, 148, 0, 0.06);
  box-shadow: none;
}

.cofim-descriptor-title {
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 2px;
}

.cofim-descriptor-body {
  font-size: 0.82rem;
  color: var(--c-muted);
  line-height: 1.55;
}

.cofim-you-text {
  margin: 4px 0 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  list-style: disc;
}

.cofim-you-text li {
  font-size: 0.82rem;
  color: var(--c-muted);
  line-height: 1.55;
}

/* ── CoFIM instructions section ── */
.cofim-stage-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.cofim-stage-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.cofim-stage-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-orange);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cofim-stage-item-text {
  flex: 1;
}

.cofim-stage-item-text strong {
  display: block;
  font-family: var(--font-head);
  font-size: 0.9rem;
  margin-bottom: 3px;
}

.cofim-stage-item-text p {
  font-size: 0.85rem;
  color: var(--c-muted);
  margin: 0;
}

/* ── Dialog (escape hatch) ── */

.report-dialog {
  border: none;
  border-radius: var(--radius, 10px);
  padding: 0;
  max-width: min(680px, 94vw);
  width: 100%;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  max-height: 88dvh;
  position: fixed;
  inset: 0;
  margin: auto;
  overflow: hidden;
}

.report-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: dialogFadeIn 0.2s ease both;
}

@keyframes dialogFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.report-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

.report-dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: 88dvh;
  overflow: hidden;
}

.report-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px 16px;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
  background: var(--c-surface);
}

.report-dialog-name {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-dialog-content {
  overflow-y: auto;
  padding: 20px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Adaptive gating notice ── */
.gating-notice[hidden] { display: none; }
.gating-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 24px;
  padding: 14px 16px;
  background: var(--c-blue-lt);
  border: 1px solid rgba(24,99,220,0.18);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--c-text);
  line-height: 1.5;
}
.gating-notice-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: #1863dc;
}
.gating-notice p { margin: 0; }

/* ── Escape hatch dialog ── */
.escape-hatch-body p {
  margin: 0 0 20px;
  line-height: 1.6;
  color: var(--c-text);
}
.escape-hatch-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (min-width: 480px) {
  .escape-hatch-options { flex-direction: row; flex-wrap: wrap; }
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .cofim-choice { font-size: 0.84rem; padding: 10px 12px; gap: 10px; }
  .cofim-descriptor { padding: 12px 14px; }
}

@media (max-width: 480px) {
  .cofim-choice { font-size: 0.82rem; }
  .cofim-choice-letter { width: 22px; height: 22px; font-size: 0.7rem; }
}
