/* ============================================================
   SHELLO FREEDIVING COURSE FINDER
   The "Find Your Freediving Path" band (freediving.html) and the
   quiz dialog (js/course-finder.js). Uses the tokens in style.css.
   ============================================================ */

/* ---------- Page band ---------- */
.cf-band {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center;
  background-image: var(--grad-free); color: var(--white);
  border-radius: var(--radius); padding: 48px 52px; box-shadow: var(--shadow-lg);
}
.cf-band--mer { background-image: var(--grad-mer); }
.cf-band.cf-band--mer .kicker { color: #ffd6e6; }
.cf-band::before, .cf-band::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  border: 1.5px solid rgba(127, 196, 212, 0.28);
}
.cf-band::before { width: 340px; height: 340px; right: -90px; top: -120px; }
.cf-band::after { width: 200px; height: 200px; right: 70px; bottom: -110px; border-color: rgba(127, 196, 212, 0.18); }
.cf-band > * { position: relative; z-index: 1; }
.cf-band .kicker { color: var(--aqua); }
.cf-band h2 { color: var(--white); }
.cf-band-sub { margin-top: 14px; color: rgba(255, 255, 255, 0.82); font-size: 1.08rem; max-width: 48ch; }
.cf-band-side { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.cf-band-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.cf-band-facts li {
  font-size: 0.82rem; font-weight: 600; padding: 7px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18);
}
.cf-band .btn-primary { box-shadow: 0 10px 30px rgba(245, 130, 31, 0.4); }
@media (max-width: 820px) {
  .cf-band { grid-template-columns: 1fr; padding: 36px 24px; gap: 24px; }
  .cf-band-side .btn { width: 100%; justify-content: center; }
}

/* ---------- Dialog ---------- */
html.cf-lock { overflow: hidden; }
.cf {
  --cf-line: rgba(43, 51, 119, 0.14);
  --cf-soft: #eef6f8;
  border: 0; padding: 0; margin: auto; color: var(--text); background: transparent;
  width: min(640px, calc(100% - 32px)); max-height: none; overflow: visible;
}
.cf::backdrop { background: rgba(13, 18, 48, 0.55); backdrop-filter: blur(3px); }
.cf.cf-fallback { position: fixed; inset: 0; z-index: 1000; display: block; }
.cf-shell {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: min(860px, calc(100vh - 48px)); max-height: min(860px, calc(100dvh - 48px));
  overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column;
}
.cf-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px 12px 24px; background: var(--white);
}
.cf-brand { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--navy); }
.cf-close {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--sand);
  color: var(--ink); font-size: 1rem; display: grid; place-items: center; flex: 0 0 auto;
}
.cf-close:hover { background: var(--sand-2); }
.cf-bar { height: 4px; background: var(--cf-soft); margin: 0 24px; border-radius: 4px; overflow: hidden; }
.cf-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--aqua), var(--blue)); border-radius: 4px; transition: width .35s ease; }
.cf-body { padding: 20px 24px 28px; }

@media (max-width: 640px) {
  /* Full-screen sheet on phones. */
  .cf { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; }
  .cf-shell { border-radius: 0; height: 100vh; height: 100dvh; max-height: none; }
  .cf-head { padding-top: max(12px, env(safe-area-inset-top)); }
  .cf-body { padding: 18px 18px max(28px, env(safe-area-inset-bottom)); flex: 1; }
}

/* ---------- Step transitions ---------- */
@keyframes cf-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes cf-in-back { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
.cf-in { animation: cf-in .28s ease both; }
.cf-in-back { animation: cf-in-back .28s ease both; }

/* ---------- Question ---------- */
.cf-step { display: flex; flex-direction: column; min-height: 100%; }
.cf-count { font-size: 0.8rem; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; margin-bottom: 8px; }
.cf-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.cf-legend { padding: 0; float: left; width: 100%; } /* float: lets the legend wrap like a normal block */
.cf-legend + * { clear: both; }
.cf-q { font-size: clamp(1.45rem, 4.6vw, 1.85rem); outline: none; }
.cf-sub { color: var(--muted); padding-top: 8px; clear: both; }
.cf-opts { display: grid; gap: 10px; margin-top: 22px; clear: both; }
.cf-opt {
  position: relative; display: flex; align-items: center; gap: 14px; cursor: pointer;
  background: var(--white); border: 1.5px solid var(--cf-line); border-radius: 14px;
  padding: 14px 16px; min-height: 60px; line-height: 1.4; font-weight: 500; color: var(--ink);
  transition: border-color .15s, background .15s, box-shadow .15s, transform .15s;
}
.cf-opt:hover { border-color: rgba(43, 51, 119, 0.4); box-shadow: 0 6px 18px rgba(13, 18, 48, 0.06); }
.cf-opt:active { transform: scale(0.99); }
.cf-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.cf-opt:has(input:focus-visible) { outline: 3px solid var(--orange); outline-offset: 2px; }
.cf-opt-key {
  flex: 0 0 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  font-size: 0.82rem; font-weight: 700; color: var(--navy); background: var(--cf-soft);
  transition: background .15s, color .15s;
}
.cf-opt-text { flex: 1; }
.cf-opt-tick {
  flex: 0 0 22px; height: 22px; border-radius: 50%; border: 1.5px solid rgba(43, 51, 119, 0.25);
  transition: all .15s;
}
.cf-opt.is-on { border-color: var(--navy); background: var(--cf-soft); box-shadow: 0 6px 18px rgba(43, 51, 119, 0.08); }
.cf-opt.is-on .cf-opt-key { background: var(--navy); color: var(--white); }
.cf-opt.is-on .cf-opt-tick { border-color: var(--navy); background: var(--navy); box-shadow: inset 0 0 0 4px var(--white); }

.cf-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; padding-top: 4px; }
.cf-nav .btn { padding: 13px 26px; }
.cf-nav .btn[disabled] { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
@media (max-width: 640px) {
  .cf-step .cf-nav { margin-top: auto; padding-top: 24px; }
  .cf-nav .btn { flex: 1; justify-content: center; }
  .cf-nav > span:empty { display: none; }
}

/* ---------- Result ---------- */
.cf-eyebrow { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--orange); }
.cf-title { font-size: clamp(1.8rem, 6vw, 2.3rem); margin-top: 6px; outline: none; }
.cf-why {
  margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--cf-soft);
  color: var(--ink); font-size: 0.96rem;
}
.cf-why b { display: block; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--navy); margin-bottom: 4px; }
.cf-dream { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--cf-line); font-weight: 600; color: var(--navy); }
.cf-upgrade { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--cf-soft); border: 1px solid rgba(61, 91, 217, 0.3); font-size: 0.93rem; }
.cf-upgrade b { display: block; color: var(--blue); margin-bottom: 2px; }
.cf-start { margin-top: 16px; padding: 18px; border-radius: 14px; background: var(--grad-free); color: var(--white); }
.cf-start-title { display: block; font-family: var(--font-display); font-weight: 500; font-size: 1.25rem; line-height: 1.25; }
.cf-start-lead { margin-top: 6px; font-size: 0.92rem; color: rgba(255, 255, 255, 0.85); }
.cf-start-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.cf-start-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 0.9rem; color: rgba(255, 255, 255, 0.88); }
.cf-start-steps b { display: block; color: var(--white); font-size: 0.95rem; }
.cf-start-ico { flex: 0 0 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.14); font-size: 1rem; }
.cf-intro { margin-top: 16px; color: var(--text); font-size: 1.02rem; }
.cf-price { margin-top: 16px; font-family: var(--font-display); font-size: 2rem; color: var(--ink); line-height: 1.1; }
.cf-price small { display: block; font-family: var(--font-body); font-size: 0.82rem; color: var(--muted); margin-top: 4px; }
.cf-incl { margin-top: 10px; font-size: 0.95rem; }
.cf-fine { margin-top: 12px; font-size: 0.84rem; color: var(--muted); font-style: italic; }
.cf-note { margin-top: 14px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--cf-line); font-size: 0.92rem; }
.cf-note b { display: block; color: var(--ink); margin-bottom: 2px; }
.cf-note p { color: var(--text); }
.cf-note.is-care { background: #fff6ec; border-color: rgba(245, 130, 31, 0.35); }
.cf-nextstep { margin-top: 18px; padding: 16px 18px; border-radius: 14px; background: var(--sand); }
.cf-nextstep-label { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.cf-nextstep b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 1.2rem; color: var(--ink); margin: 2px 0 4px; }
.cf-nextstep p { font-size: 0.93rem; }
.cf-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.cf-ctas .btn { justify-content: center; }
@media (max-width: 640px) { .cf-ctas .btn { width: 100%; } }
.cf-alt {
  display: block; margin-top: 16px; padding: 14px 16px; border-radius: 14px;
  border: 1.5px dashed var(--cf-line); transition: border-color .15s, background .15s;
}
.cf-alt:hover { border-color: var(--navy); background: var(--cf-soft); }
.cf-alt-label { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.cf-alt-line { display: block; font-weight: 600; color: var(--navy); margin-top: 2px; }
.cf-alt-price { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.cf-disclaimer { margin-top: 18px; font-size: 0.8rem; color: var(--muted); }
.cf-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--cf-line); }
.cf-link { background: none; border: 0; padding: 10px 2px; min-height: 44px; font: 600 0.9rem var(--font-body); color: var(--navy); }
.cf-link:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .cf-in, .cf-in-back { animation: none; }
  .cf-bar span, .cf-opt { transition: none; }
}

/* ---------- Optional "leave your number" card ---------- */
.cf-lead { margin-top: 16px; padding: 16px; border-radius: 14px; background: var(--sand); border: 1px solid var(--cf-line); }
.cf-lead-title { display: block; color: var(--ink); font-size: 1rem; }
.cf-lead-text { margin-top: 4px; font-size: 0.9rem; color: var(--text); }
.cf-lead-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.cf-lead-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.cf-lead-field input {
  font: 500 1rem var(--font-body); color: var(--ink); background: var(--white);
  border: 1.5px solid var(--cf-line); border-radius: 10px; padding: 11px 12px; min-height: 46px; width: 100%;
}
.cf-lead-field input:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(43, 51, 119, 0.15); }
.cf-lead-msg { margin-top: 8px; font-size: 0.85rem; color: var(--orange-deep); font-weight: 600; }
.cf-lead-btn { margin-top: 12px; padding: 12px 22px; }
.cf-lead-fine { margin-top: 8px; font-size: 0.76rem; color: var(--muted); }
.cf-lead.is-done { background: var(--cf-soft); border-color: rgba(43, 51, 119, 0.2); }
.cf-lead.is-done b { color: var(--navy); }
.cf-lead.is-done p { margin-top: 2px; font-size: 0.9rem; }
@media (max-width: 640px) {
  .cf-lead-row { grid-template-columns: 1fr; }
  .cf-lead-btn { width: 100%; justify-content: center; }
}
