/*
 * Course page v2, fold 7 FINAL (#enquire): ink fold, head + routes on the left, white recap card + certificate on the right.
 * Prefix .cfn-. Tokens only (base.css / skin.css). Amber is ONLY the card's "Enquire now".
 * Budget (direction section 2): content block <= 540px at 1366x768, >= 90px free inside the .v3-fold padding.
 * DOM order = phone reading order (head, card, certificate, routes); desktop places the blocks with grid areas.
 */

.course-v2 .cfn-root { position: relative; }
.course-v2 .cfn-root > .v3-wrap { position: relative; z-index: 1; }

/* ---------- Grid ---------- */
.course-v2 .cfn-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 1024px) {
    .course-v2 .cfn-grid {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        grid-template-rows: auto auto auto;
        grid-template-areas: "head card" "routes card" ". cert";
        column-gap: 64px; row-gap: 16px;
    }
    .course-v2 .cfn-head { grid-area: head; align-self: end; padding-bottom: 8px; }
    .course-v2 .cfn-card { grid-area: card; align-self: center; }
    .course-v2 .cfn-cert { grid-area: cert; }
    .course-v2 .cfn-routes { grid-area: routes; align-self: start; padding-top: 8px; }
}
@media (min-width: 1024px) and (max-width: 1279px) { .course-v2 .cfn-grid { column-gap: 48px; } }

/* ---------- Head ---------- */
.course-v2 .cfn-head .v3-eyebrow { color: var(--on-dark-3); }
.course-v2 .cfn-head .v3-h2 { color: var(--on-dark); max-width: 18ch; }
.course-v2 .cfn-lead { max-width: 44ch; color: var(--on-dark-2); }
@media (min-width: 1024px) { .course-v2 .cfn-lead { max-width: none; } }
@media (min-width: 1024px) and (min-height: 620px) {
    .home-v3.course-v2 .cfn-root .v3-h2 { font-size: clamp(1.75rem, .4rem + 3vh, 2.375rem); }
    .home-v3.course-v2 .cfn-root .cfn-lead { font-size: 17px; }
}

/* ---------- Routes ---------- */
.course-v2 .cfn-routes { display: grid; margin: 0; padding: 0; list-style: none; }
.course-v2 .cfn-route { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 6px 0; border-top: 1px solid rgba(255, 255, 255, .12); }
.course-v2 .cfn-route:last-child { border-bottom: 1px solid rgba(255, 255, 255, .12); }
.course-v2 .cfn-tile { width: 36px; height: 36px; border-radius: 10px; }
.course-v2 .cfn-tile .v3-i { width: 20px; height: 20px; }
.course-v2 .cfn-route-text { font-size: 17px; line-height: 1.45; color: var(--on-dark); }
.course-v2 .cfn-route-link { min-height: 40px; color: var(--l300); }
.course-v2 .cfn-route-link:hover { color: var(--on-dark); }

/* ---------- Recap card ---------- */
.course-v2 .cfn-card {
    container-type: inline-size;
    display: flex; flex-direction: column; gap: 18px;
    padding: 28px; border-radius: var(--r-panel); background: var(--white); color: var(--ink);
    box-shadow: var(--shadow-panel);
}
.course-v2 .cfn-label { display: block; padding: 0; font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--mute); }
.course-v2 .cfn-course { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.course-v2 .cfn-course-text { min-width: 0; }
.course-v2 .cfn-name { display: block; margin-top: 2px; font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 24px; line-height: 1.25; color: var(--ink); }
.home-v3.course-v2 .v3-ink .cfn-card .cfn-days { flex: none; background: var(--l100); color: var(--brand-deep); }
.course-v2 .cfn-days[hidden] { display: none; }

/* Format switch: native radios inside label chips, fixed order */
.course-v2 .cfn-switch { margin: 0; padding: 0; border: 0; min-width: 0; }
.course-v2 .cfn-switch[hidden] { display: none; }
.course-v2 .cfn-switch legend { margin-bottom: 8px; }
.course-v2 .cfn-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.course-v2 .cfn-card .cfn-chip {
    justify-content: center; gap: 6px; min-height: 48px; padding: 8px 8px; text-align: center;
    border-color: var(--l200); background: var(--white); color: var(--ink);
    font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 16px; line-height: 1.2;
}
.course-v2 .cfn-card .cfn-chip:hover { border-color: var(--l300); }
.course-v2 .cfn-card .cfn-chip:has(input:checked) { background: var(--brand); border-color: var(--brand); color: var(--white); box-shadow: none; }
.course-v2 .cfn-card .cfn-chip:has(input:focus-visible) { outline: var(--focus-light); outline-offset: 2px; }
.course-v2 .cfn-chip .v3-i { flex: none; width: 18px; height: 18px; }
.course-v2 .cfn-chip-i { display: none; color: var(--brand); }
.course-v2 .cfn-chip-tick { display: none; }
.course-v2 .cfn-chip:has(input:checked) .cfn-chip-tick { display: inline-block; }
.course-v2 .cfn-chip-text { min-width: 0; }
/* Chip icons only on wide cards (1280px+), never next to the tick */
@container (min-width: 600px) {
    .course-v2 .cfn-chip-i { display: inline-block; }
    .course-v2 .cfn-chip:has(input:checked) .cfn-chip-i { display: none; }
}
@container (max-width: 519px) {
    .course-v2 .cfn-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Next-date panel */
.course-v2 .cfn-next { border-radius: 16px; background: var(--l50); box-shadow: 0 0 0 1px var(--l200) inset; }
.course-v2 .cfn-row { display: flex; align-items: flex-start; gap: 16px 24px; min-height: 92px; padding: 18px 20px; }
.course-v2 .cfn-row[hidden] { display: none; }
.course-v2 .cfn-cell { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.course-v2 .cfn-cell-price { flex: none; align-items: flex-end; text-align: right; }
.course-v2 .cfn-k { font-size: 16px; line-height: 1.4; color: var(--mute); }
.course-v2 .cfn-v { margin-top: 2px; font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 20px; line-height: 1.3; color: var(--ink); font-variant-numeric: tabular-nums; }
.course-v2 .cfn-v.is-long { font-family: 'Work Sans', sans-serif; font-weight: 500; font-size: 17px; line-height: 1.45; }
.course-v2 .cfn-price { font-weight: 700; font-size: 24px; line-height: 1.2; white-space: nowrap; }
.course-v2 .cfn-vat { font-size: 16px; line-height: 1.4; color: var(--mute); }
.course-v2 .cfn-sub { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 16px; line-height: 1.4; color: var(--ink-2); }
.course-v2 .cfn-sub-i { width: 18px; height: 18px; color: var(--brand); }

/* Button + helper */
.course-v2 .cfn-btn { margin-top: 2px; font-size: 17px; }
.course-v2 .cfn-help { margin: -6px 0 0; text-align: center; font-size: 16px; line-height: 1.5; color: var(--mute); }
.course-v2 .cfn-help [hidden] { display: none; }
.course-v2 .cfn-help .cfn-book { display: inline-flex; align-items: center; min-height: 32px; color: var(--brand-deep); }

/* ---------- Certificate line ---------- */
.course-v2 .cfn-cert .cv2-cert { margin: 0; align-items: flex-start; color: var(--on-dark-2); font-weight: 400; }
.course-v2 .cfn-cert .cv2-cert .v3-i { margin-top: 2px; color: var(--l300); }

/* ---------- Tablet (768 to 1023px): one column, centred head, card max 560px ---------- */
@media (min-width: 768px) and (max-width: 1023px) {
    .course-v2 .cfn-grid { justify-items: center; }
    .course-v2 .cfn-head { text-align: center; }
    .course-v2 .cfn-head .v3-h2, .course-v2 .cfn-lead { margin-inline: auto; }
    .course-v2 .cfn-card, .course-v2 .cfn-cert, .course-v2 .cfn-routes { width: 100%; max-width: 560px; }
}

/* ---------- Phones ---------- */
@media (max-width: 767px) {
    .course-v2 .cfn-root.v3-section { padding: 56px 0 64px; }
    .course-v2 .cfn-head .v3-h2 { font-size: 28px; max-width: none; }
    .course-v2 .cfn-card { padding: 20px; border-radius: 16px; gap: 16px; }
    .course-v2 .cfn-name { font-size: 20px; }
    .course-v2 .cfn-row { flex-direction: column; gap: 10px; min-height: 0; padding: 16px; }
    .course-v2 .cfn-cell-price { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 8px; text-align: left; }
    .course-v2 .cfn-cell-price .cfn-k { flex-basis: 100%; }
    .course-v2 .cfn-price { font-size: 22px; }
    .course-v2 .cfn-help { margin-top: -4px; }
    .course-v2 .cfn-help .cfn-book { min-height: 44px; }
    .course-v2 .cfn-route { min-height: 56px; }
    .course-v2 .cfn-route-link { min-height: 44px; }
}

/* ---------- Motion ---------- */
@keyframes cfPulse { from { box-shadow: 0 0 0 0 rgba(255, 181, 71, .55); } to { box-shadow: 0 0 0 14px rgba(255, 181, 71, 0); } }
html.hv-motion .course-v2 .cfn-btn.cfn-pulse { animation: cfPulse 1200ms var(--ease) 1; }
html.hv-motion .course-v2 .cfn-row.cfn-out { opacity: 0; transition: opacity 120ms ease; }
html.hv-motion .course-v2 .cfn-row.cfn-in { animation: v3PanelIn 380ms var(--ease) both; }
html.hv-motion .course-v2 .cfn-help .cfn-in { animation: v3PanelIn 380ms var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
    .course-v2 .cfn-btn.cfn-pulse, .course-v2 .cfn-row.cfn-in, .course-v2 .cfn-help .cfn-in { animation: none !important; }
    .course-v2 .cfn-row.cfn-out { opacity: 1 !important; transition: none !important; }
}
@media (forced-colors: active) {
    .course-v2 .cfn-card .cfn-chip:has(input:checked) { outline: 2px solid Highlight; }
    .course-v2 .cfn-next { border: 1px solid CanvasText; }
}
@media print {
    .course-v2 .cfn-switch, .course-v2 .cfn-routes { display: none !important; }
}

/* Onsite: 'Quote for your team' is words, not a figure */
.course-v2 .cfn-price.is-text { font-weight: 600; font-size: 18px; line-height: 1.35; white-space: normal; max-width: 12ch; }
