/* ==========================================================================
   Course feedback and testimonials (course-feedback.js)
   ==========================================================================
   A light card in the Academy's own tokens. Gold appears only on chosen
   stars; the chosen value is also written out as text. Targets are at least
   44px, every control shows a strong focus ring, and nothing moves for a
   reader who has asked for less motion.
   ========================================================================== */

/* The hidden attribute must win over the display that classes such as .btn
   (inline-flex) and .cf-attr (grid) set, or hidden controls still show. */
.cf-card [hidden], .cf-dash [hidden] { display: none !important; }

.cf-section { max-width: 760px; margin: 34px auto 0; scroll-margin-top: calc(var(--header-h) + 16px); }

.cf-card {
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  border-radius: 12px; padding: 30px 32px; box-shadow: 0 10px 34px rgba(16,24,40,.10);
  font-family: var(--font-body); font-size: 15.5px; line-height: 1.55;
}
.cf-card p { color: var(--text-dark); }
.cf-h { font-family: var(--font-head); font-size: 23px; line-height: 1.25; color: var(--ink);
  margin: 0 0 8px; }
.cf-h:focus { outline: none; }
.cf-h:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.cf-lead { color: var(--text-mid) !important; margin: 0 0 18px; }
.cf-saved { font-family: var(--font-label); font-size: 12.5px; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--ok) !important; margin: 0 0 6px; }

.cf-invite { border-left: 4px solid var(--accent); }
.cf-kicker { font-family: var(--font-label); font-size: 12.5px; font-weight: 600; letter-spacing: 1.3px;
  text-transform: uppercase; color: var(--accent-ink) !important; margin: 0 0 6px; }
/* The step before the certificate: the card stands alone on the stage.
   (Not .cf-step: that is the "Step 1 of 2" label.) */
.cf-stepmode { margin-top: 10px; }
.cf-compact { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 22px; }
.cf-compact p { margin: 0; flex: 1 1 260px; }

.cf-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 22px; }
.cf-card .btn { min-height: 44px; }
/* --accent as text is under 4.5:1 on white at this size; --accent-ink is not. */
.cf-card .btn-outline-blue, .cf-dash .btn-outline-blue { color: var(--accent-ink); border-color: var(--accent-ink); }
.cf-card .btn-outline-blue:hover, .cf-dash .btn-outline-blue:hover { background: var(--accent-ink); color: #fff; }
.cf-card .btn:focus-visible, .cf-dash .btn:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---- progress ---- */
.cf-progress { margin-bottom: 14px; }
.cf-step { font-family: var(--font-label); font-size: 12.5px; font-weight: 600;
  letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent-ink) !important; margin: 0 0 6px; }
.cf-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-width: 220px; }
.cf-bar span { height: 5px; border-radius: 3px; background: var(--line); }
.cf-bar span.on { background: var(--accent); }

/* ---- questions ---- */
.cf-q { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }
.cf-q legend, .cf-q > label { font-weight: 600; color: var(--ink); font-size: 15.5px;
  padding: 0; margin-bottom: 10px; display: block; }
.cf-tag { font-weight: 400; font-size: 13px; color: var(--text-mid); }
.cf-note { font-size: 13.5px; color: var(--text-mid) !important; margin: -4px 0 8px; }
.cf-count { font-size: 12.5px; color: var(--text-mid) !important; margin: 4px 0 0; text-align: right; }
.cf-error { color: #B3172F !important; font-size: 14px; font-weight: 500; margin: 6px 0 0; }
.cf-error::before { content: '! '; font-weight: 700; }
.has-error .cf-stars, .has-error .cf-options { outline: 2px solid #B3172F; outline-offset: 4px; border-radius: 8px; }

.cf-card textarea, .cf-card input[type="text"] {
  width: 100%; font-family: var(--font-body); font-size: 15px; color: var(--ink);
  padding: 11px 12px; border: 1px solid #A9BBD0; border-radius: 8px; background: #fff;
  resize: vertical; min-height: 44px; box-sizing: border-box;
}
.cf-card textarea:focus-visible, .cf-card input[type="text"]:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.cf-card [aria-invalid="true"] { border-color: #B3172F; }

.cf-prominent { background: var(--accent-soft); border-radius: 10px; padding: 16px 18px; }
.cf-prominent > label { font-family: var(--font-head); font-size: 17.5px; color: var(--accent-ink); }

/* ---- star ratings: native radios, visually hidden but focusable ---- */
.cf-sr-input, .cf-sr {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.cf-stars { display: flex; gap: 4px; flex-wrap: wrap; }
.cf-star { width: 46px; height: 46px; display: grid; place-items: center; cursor: pointer;
  border-radius: 8px; }
.cf-star svg { width: 32px; height: 32px; fill: #fff; stroke: #6F84A0; stroke-width: 1.4; }
.cf-star.on svg { fill: #F5A623; stroke: #9A5F00; }
.cf-star:hover svg { stroke: var(--accent-ink); }
.cf-sr-input:focus-visible + .cf-star { outline: 3px solid var(--accent); outline-offset: 1px; }
.cf-rating-value { font-size: 14px; color: var(--text-mid) !important; margin: 6px 0 0; }
.cf-rating-value.set { color: var(--ink) !important; font-weight: 600; }

/* ---- choices ---- */
.cf-options { display: flex; flex-direction: column; gap: 8px; }
.cf-option { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 14px;
  border: 1px solid #C9D6E4; border-radius: 8px; cursor: pointer; background: #fff; }
.cf-option:hover { border-color: var(--line-accent); background: #F7FAFD; }
.cf-option input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.cf-option input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.cf-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.cf-option.is-disabled { opacity: .55; cursor: not-allowed; }
.cf-follow { margin-top: -8px; }

/* ---- testimonial ---- */
.cf-attr { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin-bottom: 8px; }
.cf-attr .cf-q { margin-bottom: 14px; }
.cf-attr .cf-q > label { font-size: 14px; margin-bottom: 6px; }
.cf-attr .cf-error { grid-column: 1 / -1; }
.cf-preview { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px;
  background: #F7FAFD; padding: 16px 18px; margin: 4px 0 18px; }
.cf-preview-label { font-family: var(--font-label); font-size: 12px; font-weight: 600;
  letter-spacing: 1.3px; text-transform: uppercase; color: var(--text-mid) !important; margin: 0 0 8px; }
.cf-preview-quote { margin: 0 0 8px; font-size: 16px; color: var(--ink); white-space: pre-wrap;
  overflow-wrap: anywhere; }
.cf-preview-quote::before { content: '\201C'; }
.cf-preview-quote::after { content: '\201D'; }
.cf-preview-attr { margin: 0; font-weight: 600; color: var(--ink) !important; overflow-wrap: anywhere; }
.cf-preview-rating { margin: 6px 0 0; font-size: 14px; color: var(--text-mid) !important; }
.cf-check, .cf-q > label.cf-check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  font-size: 14.5px; font-weight: 400; margin-bottom: 0; }
.cf-check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.cf-check input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.cf-check a, .cf-card a { color: var(--accent-ink); text-decoration: underline; }
.cf-withdraw { margin-top: 16px; }

/* ---- dashboard card ---- */
.cf-dash { border-left: 4px solid var(--accent); }
.cf-dash h3 { margin-bottom: 6px; }
.cf-dash p { color: var(--text-mid); font-size: 14.5px; margin: 0; }
.cf-dash .btn { min-height: 44px; }

/* ---- phones: one column ---- */
@media (max-width: 640px) {
  .cf-section { margin-top: 24px; }
  .cf-card { padding: 22px 18px; }
  .cf-h { font-size: 20px; }
  .cf-attr { grid-template-columns: 1fr; }
  .cf-actions .btn { flex: 1 1 100%; justify-content: center; }
  .cf-star { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .cf-card *, .cf-dash * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .cf-section { display: none !important; }
}
