/**
 * Quiz Master Pro — Public Frontend CSS
 * EC Digital Services | ec-digital.com
 * @version 2.2.0
 *
 * Design system:
 *  - CSS custom properties for full theme-ability
 *  - GPU-accelerated transitions (transform + opacity only)
 *  - Slide animations for one-per-page mode
 *  - Accessible focus styles
 *  - Mobile-first responsive
 */

/* ═══════════════════════════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════════════════════════ */
.ec-quiz-wrap {
  /* Brand */
  --ec-primary:         #0073aa;
  --ec-primary-hover:   #005a87;
  --ec-primary-light:   rgba(0, 115, 170, 0.08);
  --ec-primary-border:  rgba(0, 115, 170, 0.35);

  /* Neutral */
  --ec-white:     #ffffff;
  --ec-bg:        #f8f9fb;
  --ec-border:    #e4e7ec;
  --ec-text:      #1a1f2e;
  --ec-muted:     #6b7280;
  --ec-error:     #dc2626;
  --ec-success:   #16a34a;

  /* Shape */
  --ec-radius-sm: 6px;
  --ec-radius:    12px;
  --ec-radius-lg: 18px;

  /* Shadow */
  --ec-shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --ec-shadow:    0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --ec-shadow-lg: 0 12px 40px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);

  /* Motion */
  --ec-dur-fast:  150ms;
  --ec-dur:       280ms;
  --ec-dur-slow:  420ms;
  --ec-ease:      cubic-bezier(0.4, 0, 0.2, 1);
  --ec-ease-out:  cubic-bezier(0, 0, 0.2, 1);
  --ec-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ec-text);
  max-width: 700px;
  margin: 0 auto;
  padding: 8px 0 32px;
}

/* ═══════════════════════════════════════════════════════════════
   QUIZ HEADER
═══════════════════════════════════════════════════════════════ */
.ec-quiz-title {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ec-text);
  margin: 0 0 10px;
  line-height: 1.2;
}
.ec-quiz-desc {
  color: var(--ec-muted);
  font-size: 15px;
  margin: 0 0 24px;
}

/* ═══════════════════════════════════════════════════════════════
   PROGRESS BAR
═══════════════════════════════════════════════════════════════ */
.ec-progress-wrap {
  margin-bottom: 28px;
}
.ec-progress-bar {
  height: 6px;
  background: var(--ec-border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}
.ec-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ec-primary), #00a8e8);
  border-radius: 99px;
  transition: width var(--ec-dur) var(--ec-ease);
  position: relative;
}
.ec-progress-fill::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4));
  border-radius: 99px;
}
.ec-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ec-progress-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--ec-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.ec-progress-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--ec-primary);
}

/* ═══════════════════════════════════════════════════════════════
   QUESTION CARDS  (.ec-q)
═══════════════════════════════════════════════════════════════ */

/*
 * Step-mode layout:
 * .ec-quiz-form has position:relative so absolute-positioned
 * exit cards don't escape to the page body.
 *
 * The questions wrapper clips overflow so the sliding cards
 * don't create scrollbars, and its height matches only the
 * currently visible card (no accumulated space from previous cards).
 */
.ec-quiz-form {
  position: relative;
}

.ec-q {
  background: var(--ec-white);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-lg);
  margin-bottom: 16px;
  box-shadow: var(--ec-shadow);
  overflow: hidden;
  display: none;
  opacity: 0;
}

/* The one currently shown question */
.ec-q.ec-q-visible {
  display: block;
  opacity: 1;
}

/* ── Step mode animations (fade only — no position tricks) ─── */
/*
 * We use opacity + transform only.
 * Exit cards are hidden with display:none BEFORE the animation starts
 * (JS sets this). Enter cards fade+slide in from the side.
 * This means there is NEVER more than one card in the flow at a time,
 * so the form height never accumulates.
 */
@media (prefers-reduced-motion: no-preference) {
  .ec-q.ec-q-enter-right {
    display: block;
    opacity: 0;
    transform: translateX(32px);
    transition: transform var(--ec-dur-slow) var(--ec-ease-out),
                opacity   var(--ec-dur)      var(--ec-ease);
  }

  .ec-q.ec-q-enter-left {
    display: block;
    opacity: 0;
    transform: translateX(-32px);
    transition: transform var(--ec-dur-slow) var(--ec-ease-out),
                opacity   var(--ec-dur)      var(--ec-ease);
  }

  .ec-q.ec-q-visible {
    transform: translateX(0);
    opacity: 1;
    transition: transform var(--ec-dur-slow) var(--ec-ease-out),
                opacity   var(--ec-dur)      var(--ec-ease);
  }
}

/* Exit classes are only used transiently by JS for the old card
   — it immediately sets display:none after adding the exit class,
   so no CSS transition is needed on exit. */
.ec-q.ec-q-exit-left,
.ec-q.ec-q-exit-right {
  display: none !important;
}

/* Shake on validation error */
@keyframes ec-shake {
  0%, 100% { transform: translateX(0); }
  20%  { transform: translateX(-8px); }
  40%  { transform: translateX(8px); }
  60%  { transform: translateX(-5px); }
  80%  { transform: translateX(5px); }
}
.ec-q.ec-q-shake { animation: ec-shake 0.55s var(--ec-ease); }

/* Error state */
.ec-q.has-error {
  border-color: var(--ec-error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .10), var(--ec-shadow);
}

/* ── Question image — fixed frame, top of card ───────────────── */
/*
 * Fixed 16:9 frame — same size regardless of upload dimensions.
 * object-fit:cover fills the frame, cropping if needed.
 * object-position:center keeps the subject centred.
 * !important on display/width prevents theme overrides.
 */
.ec-q-image-col {
  display: block !important;
  width: 100% !important;
  float: none !important;
  flex: none !important;
  line-height: 0;          /* Remove phantom space below inline images */
}

.ec-q-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;   /* Fixed frame — all images same height regardless of upload */
  object-fit: cover;
  object-position: center center;
  border-radius: 0;        /* Flush with card top edge */
  background: var(--ec-border); /* Placeholder colour while loading */
}

/* Ensure the question card itself is never a grid or flex container
   that could place image beside body */
.ec-q,
.ec-q.ec-q-visible {
  display: block !important;
  /* display:block is set here; the visible class just ensures it shows */
}

/* Re-apply the correct visible override AFTER the above */
.ec-q:not(.ec-q-visible):not(.ec-q-enter-right):not(.ec-q-enter-left) {
  display: none !important;
}

/* Step mode: only show the active question */
.ec-quiz-form[data-step-mode="true"] .ec-q:not(.ec-q-visible):not(.ec-q-enter-right):not(.ec-q-enter-left):not(.ec-q-exit-left):not(.ec-q-exit-right) {
  display: none !important;
}

/* Question body padding */
.ec-q-body {
  padding: 24px 28px 28px;
}

/* ── Question label ────────────────────────────────────────── */
.ec-q-label {
  font-size: 17px;
  font-weight: 700;
  color: var(--ec-text);
  line-height: 1.45;
  margin: 0 0 6px;
}
.ec-q-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ec-primary-light);
  color: var(--ec-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 99px;
  margin-bottom: 8px;
  display: block;
}
.ec-q-required { color: var(--ec-error); margin-left: 2px; }
.ec-q-desc {
  font-size: 14px;
  color: var(--ec-muted);
  margin: 0 0 18px;
  line-height: 1.6;
}
.ec-q-error {
  font-size: 13px;
  color: var(--ec-error);
  font-weight: 600;
  margin: 12px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ec-q-error::before {
  content: '⚠';
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════
   ANSWER OPTIONS  (.ec-option)
═══════════════════════════════════════════════════════════════ */
.ec-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

/* Hide native input */
.ec-option-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.ec-option-label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 2px solid var(--ec-border);
  border-radius: var(--ec-radius);
  cursor: pointer;
  user-select: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--ec-text);
  background: var(--ec-white);
  transition:
    border-color var(--ec-dur-fast) var(--ec-ease),
    background   var(--ec-dur-fast) var(--ec-ease),
    box-shadow   var(--ec-dur-fast) var(--ec-ease),
    transform    var(--ec-dur-fast) var(--ec-ease-spring);
  will-change: transform;
  position: relative;
  overflow: hidden;
}

/* Hover */
.ec-option-label:hover {
  border-color: var(--ec-primary-border);
  background: var(--ec-primary-light);
  transform: translateY(-1px);
  box-shadow: var(--ec-shadow-sm);
}

/* Focus-visible ring */
.ec-option-input:focus-visible ~ .ec-option-label,
.ec-option-label:focus-within {
  outline: 3px solid var(--ec-primary);
  outline-offset: 2px;
}

/* Selected state */
.ec-option.is-selected .ec-option-label,
.ec-option-input:checked + .ec-option-label {
  border-color: var(--ec-primary);
  background: var(--ec-primary-light);
  font-weight: 600;
}

/* Ripple on select */
@keyframes ec-ripple {
  0%   { transform: scale(0); opacity: 0.3; }
  100% { transform: scale(4); opacity: 0; }
}
.ec-option.is-selected .ec-option-label::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  background: var(--ec-primary);
  border-radius: 50%;
  animation: ec-ripple 0.5s var(--ec-ease) forwards;
  pointer-events: none;
}

/* ── Custom SVG markers ──────────────────────────────────────── */
.ec-option-marker {
  flex-shrink: 0;
  color: var(--ec-muted);
  transition: color var(--ec-dur-fast) var(--ec-ease);
  line-height: 0;
}
.ec-option.is-selected .ec-option-marker,
.ec-option-input:checked + .ec-option-label .ec-option-marker {
  color: var(--ec-primary);
}

/* Animate radio dot */
.ec-radio-dot {
  transition: opacity var(--ec-dur-fast) var(--ec-ease),
              r 150ms var(--ec-ease-spring);
}
.ec-option-input:checked + .ec-option-label .ec-radio-dot {
  opacity: 1;
}

/* Animate checkbox checkmark */
.ec-check-path {
  transition: opacity var(--ec-dur-fast) var(--ec-ease);
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
}
.ec-option-input:checked + .ec-option-label .ec-check-path {
  opacity: 1;
  stroke-dashoffset: 0;
  transition: opacity var(--ec-dur-fast) var(--ec-ease),
              stroke-dashoffset 200ms var(--ec-ease-out);
}

.ec-option-text { flex: 1; }

/* ═══════════════════════════════════════════════════════════════
   NAV BUTTONS
═══════════════════════════════════════════════════════════════ */
.ec-quiz-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.ec-quiz-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  border: none;
  border-radius: var(--ec-radius);
  cursor: pointer;
  text-decoration: none;
  transition:
    background   var(--ec-dur-fast) var(--ec-ease),
    transform    var(--ec-dur-fast) var(--ec-ease-spring),
    box-shadow   var(--ec-dur-fast) var(--ec-ease);
  will-change: transform;
  position: relative;
  overflow: hidden;
}
.ec-btn-primary {
  background: var(--ec-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,115,170,.35);
}
.ec-btn-primary:hover {
  background: var(--ec-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,115,170,.45);
  color: #fff;
}
.ec-btn-primary:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(0,115,170,.3); }
.ec-btn-primary:disabled, .ec-btn-primary.is-loading {
  opacity: .75;
  cursor: not-allowed;
  transform: none;
}

.ec-btn-secondary {
  background: var(--ec-white);
  color: var(--ec-text);
  border: 2px solid var(--ec-border);
}
.ec-btn-secondary:hover {
  border-color: var(--ec-primary-border);
  background: var(--ec-primary-light);
  color: var(--ec-primary);
  transform: translateY(-1px);
}

.ec-btn-icon { font-size: 16px; line-height: 1; }

/* Loading spinner */
@keyframes ec-spin { to { transform: rotate(360deg); } }
.ec-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ec-spin .7s linear infinite;
  flex-shrink: 0;
}
.ec-quiz-submitting {
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ec-muted);
  margin-top: 16px;
}
.ec-quiz-submitting .ec-spinner {
  border-color: rgba(0,115,170,.2);
  border-top-color: var(--ec-primary);
}

.ec-global-error {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--ec-error);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: var(--ec-radius-sm);
  margin-top: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   RESULTS PAGE
═══════════════════════════════════════════════════════════════ */
.ec-results-page { padding-top: 4px; }

/* Hero — ring + score */
.ec-results-hero {
  background: var(--ec-white);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-lg);
  box-shadow: var(--ec-shadow);
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 16px;

  /* Entrance animation */
  animation: ec-fade-up var(--ec-dur-slow) var(--ec-ease-out) both;
}

@keyframes ec-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* SVG ring — no CSS fill so themes cannot override inline attrs */
.ec-ring-wrap {
  position: relative;
  width: 150px; height: 150px;
  flex-shrink: 0;
}
.ec-ring-wrap svg { display: block; overflow: visible; }
.ec-ring-centre {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  flex-direction: column;
}
.ec-ring-pct {
  font-size: 34px;
  font-weight: 900;
  color: var(--ec-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}
.ec-ring-pct-sym { font-size: 20px; font-weight: 700; vertical-align: super; }

/* Score text */
.ec-results-headline { flex: 1; min-width: 0; }
.ec-results-quiz-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--ec-muted);
  margin: 0 0 10px;
}
.ec-results-raw-score {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 12px;
}
.ec-rs-num {
  font-size: 56px;
  font-weight: 900;
  color: var(--ec-primary);
  line-height: 1;
  letter-spacing: -0.03em;
}
.ec-rs-sep  { font-size: 24px; color: var(--ec-border); }
.ec-rs-max  { font-size: 24px; font-weight: 700; color: var(--ec-muted); }
.ec-rs-label { font-size: 14px; color: var(--ec-muted); }

/* Progress bar */
.ec-results-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.ec-results-bar {
  flex: 1;
  height: 8px;
  background: var(--ec-border);
  border-radius: 99px;
  overflow: hidden;
}
.ec-results-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 1.2s var(--ec-ease-out);
  background: linear-gradient(90deg, var(--ec-primary), #00a8e8);
}
.ec-results-bar-label { font-size: 12px; color: var(--ec-muted); white-space: nowrap; flex-shrink: 0; }

/* Result cards */
.ec-result-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}
.ec-result-card {
  background: var(--ec-white);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius);
  box-shadow: var(--ec-shadow-sm);
  overflow: hidden;
  display: flex;
  animation: ec-fade-up var(--ec-dur-slow) var(--ec-ease-out) both;
}
.ec-result-card:nth-child(2) { animation-delay: 100ms; }
.ec-result-card:nth-child(3) { animation-delay: 200ms; }
.ec-result-card-accent { width: 5px; flex-shrink: 0; }
.ec-result-card-content { padding: 22px 24px; flex: 1; }
.ec-result-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.ec-result-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ec-muted);
  margin: 0;
}
.ec-result-body p { margin: 0 0 8px; }
.ec-result-body p:last-child { margin: 0; }

/* Retake / action row */
.ec-retake-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 20px 0 0;
  border-top: 1px solid var(--ec-border);
}

/* ═══════════════════════════════════════════════════════════════
   QUIZ LIST GRID
═══════════════════════════════════════════════════════════════ */
.ec-quiz-list-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(var(--ec-cols, 3), 1fr);
}
@media (max-width: 900px) { .ec-quiz-list-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px) { .ec-quiz-list-grid { grid-template-columns: 1fr; } }

.ec-quiz-list-card {
  background: var(--ec-white);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius);
  overflow: hidden;
  box-shadow: var(--ec-shadow-sm);
  transition: transform var(--ec-dur) var(--ec-ease-spring), box-shadow var(--ec-dur) var(--ec-ease);
  display: flex;
  flex-direction: column;
}
.ec-quiz-list-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ec-shadow-lg);
}

/* Fixed square thumbnail — constrained size */
.ec-ql-thumb-link { display: block; line-height: 0; }
.ec-ql-thumb {
  width: 100%;
  height: 160px;          /* Fixed height — not aspect-ratio, so it stays compact */
  overflow: hidden;
  background: var(--ec-border);
}
.ec-ql-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform .4s var(--ec-ease);
}
.ec-quiz-list-card:hover .ec-ql-thumb img {
  transform: scale(1.04);
}
/* Placeholder when no featured image */
.ec-ql-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ec-primary-light), rgba(0,115,170,.15));
  color: var(--ec-primary);
}

.ec-quiz-list-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.ec-quiz-list-title { font-size: 16px; font-weight: 700; margin: 0 0 8px; line-height: 1.3; }
.ec-quiz-list-title a { color: var(--ec-text); text-decoration: none; }
.ec-quiz-list-title a:hover { color: var(--ec-primary); }
.ec-quiz-list-excerpt { font-size: 13px; color: var(--ec-muted); flex: 1; margin-bottom: 14px; line-height: 1.5; }
.ec-quiz-list-footer { margin-top: auto; }
.ec-quiz-list-link { font-size: 13px; font-weight: 700; color: var(--ec-primary); text-decoration: none; }
.ec-quiz-list-link:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════
   REDUCED MOTION
═══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .ec-q, .ec-q-visible, .ec-q-enter-right, .ec-q-enter-left,
  .ec-q-exit-left, .ec-q-exit-right,
  .ec-option-label, .ec-quiz-btn,
  .ec-result-card, .ec-results-hero {
    animation: none !important;
    transition: none !important;
  }
}

/* ════════════════════════════════════════════════════════════════
   ANSWER OPTION DESCRIPTION  (.ec-option-desc)
════════════════════════════════════════════════════════════════ */
.ec-option-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.ec-option-text {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
}
.ec-option-desc {
  font-size: 13px;
  color: var(--ec-muted);
  font-weight: 400;
  line-height: 1.5;
}
.ec-option.is-selected .ec-option-desc,
.ec-option-input:checked + .ec-option-label .ec-option-desc {
  color: var(--ec-primary);
  opacity: .85;
}

/* ════════════════════════════════════════════════════════════════
   SCORE BREAKDOWN TABLE
════════════════════════════════════════════════════════════════ */
.ec-breakdown {
  background: var(--ec-white);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--ec-shadow-sm);
}
.ec-breakdown-heading {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--ec-text);
}
.ec-breakdown-table {
  border-top: 2px solid var(--ec-border);
}
.ec-breakdown-head,
.ec-breakdown-row {
  display: grid;
  grid-template-columns: 1fr 1.8fr 64px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--ec-border);
}
.ec-breakdown-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--ec-muted);
  padding-bottom: 8px;
}
.ec-breakdown-row:last-child { border-bottom: none; }
.ec-bd-question {
  font-size: 13px;
  font-weight: 600;
  color: var(--ec-text);
  line-height: 1.3;
}
.ec-bd-answer {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ec-bd-answer strong { font-size: 13px; color: var(--ec-text); }
.ec-bd-answer small  { font-size: 12px; color: var(--ec-muted); line-height: 1.4; }
.ec-bd-score {
  font-size: 15px;
  font-weight: 800;
  text-align: right;
}

/* ════════════════════════════════════════════════════════════════
   EMAIL CAPTURE FORM
════════════════════════════════════════════════════════════════ */
.ec-email-capture {
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fb 100%);
  border: 1px solid var(--ec-primary-border);
  border-radius: var(--ec-radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.ec-email-capture-inner { padding: 24px; }
.ec-email-capture-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ec-text);
}
.ec-email-capture-desc {
  font-size: 14px;
  color: var(--ec-muted);
  margin: 0 0 16px;
}
.ec-email-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 560px) {
  .ec-email-fields { grid-template-columns: 1fr; }
  .ec-breakdown-head, .ec-breakdown-row { grid-template-columns: 1fr 1fr 48px; }
}
.ec-email-fields input {
  padding: 11px 14px;
  border: 1.5px solid var(--ec-border) !important;
  border-bottom: 1.5px solid var(--ec-border) !important; /* override theme underline styles */
  border-radius: var(--ec-radius-sm);
  font-size: 14px;
  background: var(--ec-white);
  transition: border-color var(--ec-dur-fast) var(--ec-ease);
  width: 100%;
  box-shadow: none !important;
  text-decoration: none !important;
}
.ec-email-fields input:focus {
  outline: none !important;
  border-color: var(--ec-primary) !important;
  border-bottom-color: var(--ec-primary) !important;
  box-shadow: 0 0 0 3px rgba(0,115,170,.12) !important;
}
.ec-capture-status { margin-top: 10px; font-size: 13px; }
.ec-cap-success { color: var(--ec-success); font-weight: 600; }
.ec-cap-error   { color: var(--ec-error);   font-weight: 600; }

/* ── Disabled Next/Submit button (required question unanswered) ──────────── */
.ec-quiz-btn.is-disabled,
.ec-quiz-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  pointer-events: none;
}
/* Subtle hint below the disabled button */
.ec-quiz-btn.is-disabled::after,
.ec-btn-next:disabled::after {
  content: attr(title);
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--ec-muted);
  margin-top: 4px;
  text-align: center;
  pointer-events: none;
}
