/* Finanzcheck figures in the case-figures hand. Loaded after case-figures.css, which
   owns the ground, the card roles and the tokens; this file only composes the credit
   funnel figure (.cff) and restyles the A/B demo (.ab) on top of them. */

.cf, .cfd { --cf-ink: #1F50B5; }

/* ---------- the funnel, before and after ---------- */
.cff {
  width: 100%; max-width: 860px;
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 1fr) clamp(48px, 9cqi, 88px) minmax(0, 1.08fr);
}
.cff .cf__k { margin: 0 0 16px 4px; }
.cff .cff__s { display: block; font-size: 13px; line-height: 1.45; color: var(--cf-quiet); margin-top: 6px; }
.cff .cf-card__n, .cff .cf-hi__n { display: block; }
.cff .cf-card__s { display: block; margin-top: 10px; }

.cff__pile { display: grid; }
.cff__dense { width: min(100%, 260px); padding-bottom: 30px; transform: rotate(-2deg); position: relative; z-index: 1; }
.cff__form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; margin-bottom: 14px;
  height: 118px; overflow: hidden;
  -webkit-mask: linear-gradient(#000 55%, transparent); mask: linear-gradient(#000 55%, transparent);
}
.cff__form b { display: block; height: 22px; position: relative; }
.cff__form b::before { content: ""; position: absolute; left: 0; top: 0; height: 4px; width: 56%; border-radius: 2px; background: var(--cf-bar); }
.cff__form b:nth-child(3n)::before { width: 40%; }
.cff__form b:nth-child(4n+1)::before { width: 70%; }
.cff__form b::after { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 14px; border-radius: 4px; background: var(--cf-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cf-rule) 70%, transparent); }
.cff__home {
  position: relative; z-index: 2; width: min(78%, 230px); justify-self: end;
  margin: -22px -4px 0 0; transform: rotate(2.5deg);
}

.cff__join { align-self: stretch; position: relative; }
.cff__join i {
  position: absolute; left: 10px; right: 12px; top: 50%; height: 1.5px;
  background: repeating-linear-gradient(90deg, var(--cf-line) 0 2px, transparent 2px 7px);
}
.cff__join i::after {
  content: ""; position: absolute; right: -1px; top: 50%; width: 8px; height: 8px;
  border: solid var(--cf-marker); border-width: 1.5px 1.5px 0 0; transform: translate(0, -50%) rotate(45deg);
}

.cff__after { display: grid; }
.cff__hi { margin-right: 18px; }
.cff__q { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.cff__bar {
  display: block; height: 6px; border-radius: 3px; background: var(--cf-soft); overflow: hidden; margin-bottom: 8px;
}
.cff__bar em { display: block; height: 100%; width: 34%; border-radius: 3px; background: var(--cf-ink); }
.cff__q b { display: block; height: 7px; border-radius: 4px; background: var(--cf-bar); width: 72%; }
.cff__q b + b { width: 46%; height: 5px; background: color-mix(in srgb, var(--cf-bar) 60%, var(--cf-soft)); }
.cff__field {
  display: block; height: 36px; margin-top: 4px; border-radius: 8px; background: var(--cf-card);
  box-shadow: 0 0 0 1.5px var(--cf-ink), 0 0 0 5px color-mix(in srgb, var(--cf-ink) 12%, transparent);
  position: relative;
}
.cff__field::before { content: ""; position: absolute; left: 12px; top: 10px; bottom: 10px; width: 1.5px; background: var(--cf-ink); }
.cff__light { margin: -22px -6px 0 44px; padding-top: 38px; position: relative; z-index: 1; }

@container (max-width: 699px) {
  .cff { grid-template-columns: 1fr; max-width: 440px; }
  .cff__dense { width: 84%; }
  .cff__home { width: 74%; margin: -20px 0 0 0; }
  .cff__form { height: 84px; }
  .cff__q { margin-bottom: 14px; gap: 8px; }
  .cff__field { height: 30px; }
  .cff__join { height: 44px; }
  .cff__join i {
    left: 50%; right: auto; top: 8px; bottom: 10px; width: 1.5px; height: auto;
    background: repeating-linear-gradient(180deg, var(--cf-line) 0 2px, transparent 2px 7px);
  }
  .cff__join i::after { right: auto; top: auto; left: 50%; bottom: -1px; transform: translate(-50%, 0) rotate(135deg); }
  .cff__hi { margin-right: 14px; }
  .cff__light { margin: -20px 0 0 36px; padding-top: 34px; }
}

/* ---------- the experiment call ---------- */
.ab .ab__eyebrow { font-family: inherit; font-size: 13px; line-height: 1.3; font-weight: 500; letter-spacing: 0; color: var(--muted, #6B6B66); }
.ab__g {
  background: var(--cf-ground); border-radius: 12px; padding: clamp(20px, 5vw, 44px);
  container-type: inline-size; overflow: hidden;
}
.ab .ab__grid { background: none; border-radius: 0; padding: 0; gap: 16px; align-items: start; }
.ab .ab__card {
  border: 0; border-radius: 12px; background: var(--cf-card); opacity: 1;
  padding: 20px 22px 22px; position: relative;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cf-rule) 55%, transparent), var(--cf-rest);
  transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s ease, opacity .45s ease, border-radius .45s ease;
}
.ab .ab__card-top { margin: 0 0 16px; }
.ab .ab__tag { font-family: var(--cf-mono); font-size: 12px; letter-spacing: 0; color: var(--cf-quiet); }
.ab .ab__verdict {
  display: inline-flex; align-items: center; gap: 8px; padding: 0; border-radius: 0; background: none;
  font-family: var(--cf-mono); font-size: 12px; font-weight: 500; line-height: 1.3;
  visibility: hidden; opacity: 0; transition: opacity .35s ease .15s, visibility 0s linear .5s;
}
.ab .ab__verdict::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; }
.ab .ab__verdict--lose { color: var(--cf-terra); background: none; }
.ab .ab__verdict--lose::before { box-shadow: inset 0 0 0 1.5px var(--cf-terra); }
.ab .ab__verdict--win { color: var(--cf-ink); background: none; }
.ab .ab__verdict--win::before { background: var(--cf-ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cf-ink) 16%, transparent); }

.ab .ab__name { font-size: 17px; line-height: 1.25; color: var(--cf-text); }
.ab .ab__desc { font-size: 13.5px; line-height: 1.5; color: var(--cf-quiet); margin: 0 0 16px; }
.ab .ab__point { font-size: 13px; color: var(--cf-text); }
.ab .ab__point::before, .ab .ab__point--lose::before, .ab .ab__point--win::before { background: var(--cf-marker); transition: background .35s ease; }

/* drawn thumbnails of the two forms */
.ab__art { display: block; height: 64px; margin: 0 0 16px; }
.ab__art--dense {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 8px; align-content: start; overflow: hidden;
  -webkit-mask: linear-gradient(#000 50%, transparent); mask: linear-gradient(#000 50%, transparent);
}
.ab__art--dense b { display: block; height: 12px; border-radius: 3px; background: var(--cf-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cf-rule) 70%, transparent); }
.ab__art--conv { display: flex; flex-direction: column; gap: 9px; }
.ab__bar { display: block; height: 5px; border-radius: 3px; background: var(--cf-soft); overflow: hidden; }
.ab__bar em { display: block; height: 100%; width: 34%; border-radius: 3px; background: var(--cf-bar); transition: background .35s ease; }
.ab__art--conv b { display: block; height: 6px; width: 62%; border-radius: 3px; background: var(--cf-bar); margin-top: 3px; }
.ab__field {
  display: block; height: 26px; border-radius: 7px; background: var(--cf-card);
  box-shadow: 0 0 0 1px var(--cf-rule); transition: box-shadow .35s ease;
}

/* the result */
.ab .ab__result { display: grid; justify-items: start; align-items: center; margin: 26px 0 0; gap: 0; }
.ab .ab__reveal, .ab .ab__readout { grid-area: 1 / 1; }
.ab .ab__reveal {
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 10px; cursor: pointer;
  font: 500 14px/1 var(--font, Inter, system-ui, sans-serif); color: var(--cf-text);
  background: var(--cf-card); box-shadow: 0 0 0 1px color-mix(in srgb, var(--cf-rule) 55%, transparent), var(--cf-rest);
  transition: box-shadow var(--t-fast) ease, transform var(--t-fast) ease;
}
.ab .ab__reveal:hover { opacity: 1; box-shadow: 0 0 0 1px var(--cf-rule), var(--cf-lift); transform: translateY(-1px); }
.ab .ab__reveal:focus-visible { outline: 2px solid var(--cf-ink); outline-offset: 3px; }
.ab .ab__readout { gap: 14px; pointer-events: none; }
.ab .ab__reveal { position: relative; z-index: 1; }
.ab[data-revealed="true"] .ab__readout { pointer-events: auto; }
.ab .ab__figure { color: var(--cf-green); }
.ab .ab__figure-note { color: var(--cf-quiet); }
.ab .ab__cap { margin-top: 14px; }

/* revealed: the winner is the one lifted card, the case ink only on it */
.ab[data-revealed="true"] .ab__verdict { visibility: visible; opacity: 1; transition: opacity .35s ease .15s, visibility 0s; }
.ab[data-revealed="true"] .ab__card--win {
  z-index: 2; border-radius: 16px;
  transform: translateY(-6px) scale(1.025);
  box-shadow: 0 0 0 1px var(--cf-rule), var(--cf-lift);
}
.ab[data-revealed="true"] .ab__card--lose { transform: translateY(6px) scale(.965); opacity: .86; }
.ab[data-revealed="true"] .ab__card--win .ab__point::before { background: var(--cf-ink); }
.ab[data-revealed="true"] .ab__card--win .ab__bar em { background: var(--cf-ink); }
.ab[data-revealed="true"] .ab__card--win .ab__field { box-shadow: 0 0 0 1.5px var(--cf-ink), 0 0 0 5px color-mix(in srgb, var(--cf-ink) 12%, transparent); }

@container (min-width: 560px) {
  .ab .ab__card--lose { transform-origin: 100% 50%; }
  .ab .ab__card--win { transform-origin: 0 50%; }
  .ab .ab__result { margin-left: calc(50% + 8px); min-height: 52px; }
  .ab .ab__readout { flex-wrap: nowrap; align-items: center; }
  .ab .ab__figure-note { max-width: 26ch; }
}
@container (max-width: 559px) {
  .ab .ab__grid { grid-template-columns: 1fr; gap: 14px; }
  .ab .ab__card { padding: 18px 18px 20px; }
  .ab[data-revealed="true"] .ab__card--win { transform: translateY(-2px) scale(1.02); }
  .ab[data-revealed="true"] .ab__card--lose { transform: scale(.96); }
  .ab .ab__result { justify-items: stretch; }
  .ab .ab__reveal { width: 100%; }
}
@media (pointer: coarse) { .ab .ab__reveal { min-height: 48px; } }
@media (prefers-reduced-motion: reduce) {
  .ab .ab__card, .ab .ab__verdict, .ab__bar em, .ab__field, .ab .ab__point::before, .ab .ab__reveal { transition: none; }
}
