/* Where you stand (templates/site/hooks/_where_you_stand.html, assets/lp/js/hooks/where_you_stand.js). One hero,
   the state's average score on FICO's own scale; the kit's type, segmented control, stat tiles and gate for the
   rest. Laid out by its own width (a container query): the number beside the question in a wide column, stacked
   on a phone. Palette: the brand blue family and white at opacities; red only for the error state. */

.bxwy { container-type: inline-size; }
.bxwy-card { position: relative; border-radius: 24px; padding: 28px 22px 24px; overflow: hidden; }
.bxwy-grid { --wy-gap: 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--wy-gap); transition: opacity .3s var(--bx-ease); }
.bxwy.is-refresh .bxwy-grid { opacity: .5; pointer-events: none; }
.bxwy-grid[hidden], .bxwy-state[hidden], .bxwy-change[hidden] { display: none !important; }

/* ---------- words ---------- */
.bxwy-kicker { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 5px 14px 5px 12px; margin: 0 0 16px; border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); font-size: 15px; line-height: 20px; color: #FFFFFF; }
.bxwy-kicker svg { width: 16px; height: 16px; color: var(--bx-peri); flex: none; }
.bxwy-title { margin: 0 0 10px; text-wrap: balance; }
.bxwy-title em { font-style: normal; color: var(--bx-peri); font-variant-numeric: tabular-nums; }
.bxwy-sub { max-width: 560px; }
.bxwy-sub b { font-weight: 500; color: #FFFFFF; }
.bxwy-where { display: flex; align-items: center; gap: 10px; margin-top: 14px; min-height: 44px; font-size: 14px; line-height: 20px; color: var(--bx-text-2); }
.bxwy-where__txt { min-width: 0; }
.bxwy-where__txt b { font-weight: 500; color: #FFFFFF; }
.bxwy-where__ico { width: 28px; height: 28px; border-radius: 8px; flex: none; display: flex; align-items: center; justify-content: center; background: rgba(38, 75, 255, .18); color: var(--bx-peri); }
.bxwy-where__ico svg { width: 16px; height: 16px; }
.bxwy-change { position: relative; display: inline-flex; align-items: center; flex: none; min-height: 44px; padding: 0 4px; cursor: pointer; font-weight: 500; color: var(--bx-peri);
    border-radius: 8px; white-space: nowrap; transition: color .3s var(--bx-ease); }
.bxwy-change:hover { color: #FFFFFF; }
.bxwy-change select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; border: 0; -webkit-appearance: none; appearance: none; }
/* the list a browser draws for the hidden select (Chrome on Windows paints it with the select's own colours) */
.bxwy-change select option { color: #141C24; }
.bxwy-change:focus-within { outline: 2px solid var(--bx-peri); outline-offset: 2px; }

/* ---------- the hero: the number on FICO's scale ---------- */
.bxwy-hero { display: flex; flex-direction: column; align-items: stretch; padding: 22px 20px 18px; border-radius: 20px;
    background: radial-gradient(90% 80% at 50% 0%, rgba(38, 75, 255, .16) 0%, rgba(38, 75, 255, 0) 70%), rgba(255, 255, 255, .02);
    box-shadow: inset 0 0 0 1px var(--bx-line-8); }
.bxwy-num { display: block; text-align: center; font-family: var(--bx-font-numbers); font-weight: 500; font-size: 84px; line-height: 84px; letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums; color: #FFFFFF; min-height: 84px; }
.bxwy-cap { display: block; margin: 6px 0 20px; text-align: center; font-size: 14px; line-height: 20px; color: var(--bx-text-2); }
.bxwy-cap b { font-weight: 500; color: #FFFFFF; }
.bxwy-scale { position: relative; height: 22px; }
.bxwy-track { position: absolute; left: 0; right: 0; top: 7px; height: 8px; display: flex; gap: 3px; }
.bxwy-band { display: block; flex-basis: 0; height: 100%; border-radius: 4px; background: rgba(255, 255, 255, .10); transition: background .4s var(--bx-ease), box-shadow .4s var(--bx-ease); }
.bxwy-band.is-home { background: var(--bx-ramp); box-shadow: 0 0 14px rgba(38, 75, 255, .55); }
.bxwy-shade { position: absolute; top: 3px; height: 16px; border-radius: 8px; background: rgba(133, 133, 233, .16); box-shadow: inset 0 0 0 1px rgba(185, 195, 255, .45);
    opacity: 0; transition: left .45s var(--bx-ease), width .45s var(--bx-ease), opacity .3s var(--bx-ease); pointer-events: none; }
.bxwy-shade.is-on { opacity: 1; }
.bxwy-dot { position: absolute; top: 11px; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #FFFFFF; opacity: 0;
    box-shadow: 0 0 0 4px rgba(38, 75, 255, .45), 0 0 16px rgba(133, 133, 233, .9); transition: left .7s var(--bx-ease), opacity .3s var(--bx-ease); }
.bxwy-dot.is-on { opacity: 1; }
.bxwy-dot.is-pulse { animation: bxwy-pulse .6s var(--bx-ease); }
@keyframes bxwy-pulse { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.bxwy-legend { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 12px; line-height: 16px; color: var(--bx-text-3); font-variant-numeric: tabular-nums; }
.bxwy-legend__band { color: var(--bx-peri); font-weight: 500; text-align: center; }

/* ---------- the question ---------- */
.bxwy-q { margin: 0 0 12px; font-family: var(--bx-font-numbers); font-weight: 500; font-size: 20px; line-height: 24px; letter-spacing: -0.01em; }
.bxwy-seg { position: relative; max-width: 520px; }
.bxwy-seg button { position: relative; z-index: 1; font-size: 15px; padding: 0 8px; transform: translateZ(0); transition: background .3s var(--bx-ease), color .3s var(--bx-ease), transform 75ms var(--bx-ease); }
/* the iOS segmented control: one thumb that glides to the answer, instead of the kit's per-button fill. The script
   puts the thumb on the pressed segment (--wy-tx, --wy-tw), so it fits segments of any width */
.bxwy-seg button[aria-pressed="true"] { background: none; box-shadow: none; color: #FFFFFF; }
.bxwy-thumb { position: absolute; top: 3px; bottom: 3px; left: 0; width: var(--wy-tw, calc((100% - 10px) / 3)); border-radius: 9px; pointer-events: none;
    background: rgba(255, 255, 255, .14); box-shadow: 0 3px 8px rgba(0, 0, 0, .25), inset 0 0 0 .5px rgba(255, 255, 255, .2);
    opacity: 0; transform: translateX(var(--wy-tx, 3px)); transition: transform .35s var(--bx-ease), width .35s var(--bx-ease), opacity .2s var(--bx-ease); }
.bxwy-seg[data-pick] .bxwy-thumb { opacity: 1; }
.bxwy-seg button:hover:not([disabled]):not([aria-pressed="true"]) { background: rgba(255, 255, 255, .07); color: #FFFFFF; }
.bxwy-seg button:active:not([disabled]) { transform: scale(.97); }
.bxwy-seg button[disabled] { opacity: .4; cursor: not-allowed; }
.bxwy-seg button:focus-visible { outline: 2px solid var(--bx-peri); outline-offset: 2px; }
.bxwy-note { margin-top: 10px; }

/* ---------- the answer, opened by a tap and kept behind the gate ---------- */
/* out of the grid until the first tap, so the closed answer leaves no gap; then it grows open from nothing */
.bxwy-answer { display: none; grid-template-columns: minmax(0, 1fr); grid-template-rows: 0fr; transition: grid-template-rows .45s var(--bx-ease); }
.bxwy-answer.is-shown { display: grid; }
.bxwy-answer.is-open { grid-template-rows: 1fr; }
.bxwy-answer__in { min-height: 0; overflow: hidden; }
.bxwy-answer.is-open .bxwy-answer__in { overflow: visible; }
.bxwy .bxg-locked { display: flex; flex-direction: column; gap: 18px; }
.bxwy-said { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; line-height: 1;
    color: rgba(255, 255, 255, .86); background: rgba(38, 75, 255, .14); box-shadow: inset 0 0 0 1px rgba(133, 133, 233, .42); }
.bxwy-said b { font-weight: 500; color: #FFFFFF; }
.bxwy-line { font-size: 17px; line-height: 26px; color: rgba(255, 255, 255, .86); max-width: 720px; text-wrap: pretty; }
.bxwy-line b { font-weight: 500; color: #FFFFFF; }
.bxwy-tiles { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.bxwy-tile { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 16px; background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--bx-line-8); }
.bxwy-tile b { font-family: var(--bx-font-numbers); font-weight: 500; font-size: 28px; line-height: 32px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.bxwy-tile span { font-size: 13px; line-height: 18px; color: var(--bx-text-2); }
.bxwy-go { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 16px;
    background: radial-gradient(120% 140% at 0% 0%, rgba(38, 75, 255, .22) 0%, rgba(38, 75, 255, 0) 60%), rgba(255, 255, 255, .02); box-shadow: inset 0 0 0 1px rgba(133, 133, 233, .3); }
.bxwy-go p b { display: block; font-family: var(--bx-font-numbers); font-weight: 500; font-size: 18px; line-height: 24px; }
.bxwy-go p span { display: block; font-size: 14px; line-height: 20px; color: var(--bx-text-2); margin-top: 2px; }
.bxwy-go .btn { align-self: stretch; text-decoration: none; }
.bxwy-src { color: var(--bx-text-3); }

/* ---------- skeletons, in the final shape ---------- */
/* a skeleton line sits in its text's own line box, so a skeleton paragraph is as tall as its words */
.bxwy-sk { display: inline-block; vertical-align: middle; height: 24px; margin: 0; border-radius: 8px; }
.bxwy-title .bxwy-sk { height: 26px; }
.bxwy-sk--s { height: 16px; }
.bxwy-sk--xs { height: 12px; border-radius: 6px; }
.bxwy-sk--num { display: block; width: 160px; height: 72px; margin: 6px auto; border-radius: 16px; }
.bxwy[data-view="loading"] .bxwy-band { background: rgba(255, 255, 255, .07); }
/* as many skeleton lines as the words take: --n lines only on a phone, --m ones below 860px of card */
@container (min-width: 600px) { .bxwy-sk--n { display: none; } }
@container (min-width: 860px) { .bxwy-sk--m { display: none; } }

/* ---------- error ---------- */
.bxwy-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 32px 8px 20px; }
.bxwy-state .bxc-sub { max-width: 420px; margin-bottom: 8px; }
.bxwy-state__ico { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 6px;
    background: rgba(255, 66, 66, .10); color: #FF4242; box-shadow: inset 0 0 0 1px rgba(255, 66, 66, .32); }
.bxwy-state__ico svg { width: 24px; height: 24px; }
.bxwy .btn_border { min-width: 160px; }

/* ---------- at width ---------- */
@container (min-width: 600px) {
    .bxwy-card { padding: 32px 36px 28px; }
    .bxwy-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bxwy-go { flex-direction: row; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; }
    .bxwy-go .btn { align-self: center; flex: none; }
}
@container (min-width: 860px) {
    .bxwy-card { padding: 40px 48px 32px; }
    .bxwy-grid { --wy-gap: 28px; grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "intro hero" "ask hero" "src src"; column-gap: 64px; row-gap: var(--wy-gap); }
    .bxwy.is-answered .bxwy-grid { grid-template-areas: "intro hero" "ask hero" "answer answer" "src src"; }
    .bxwy-intro { grid-area: intro; }
    .bxwy-hero { grid-area: hero; align-self: center; }
    .bxwy-ask { grid-area: ask; }
    .bxwy-answer { grid-area: answer; }
    .bxwy-src { grid-area: src; }
    .bxwy-title { font-size: 32px; line-height: 38px; }
    .bxwy .bxg.is-locked .bxg-form { max-width: 720px; margin-left: auto; margin-right: auto; }
    /* one line of title at this width, and one line of skeleton for it */
    .bxwy-title .bxwy-sk { height: 32px; }
}
@container (max-width: 420px) {
    /* on a phone the three thirds are too narrow for "About the same" (105px of words in 78 to 101px): the middle
       segment takes the width its words need and the other two share the rest, as iOS does by content */
    .bxwy-seg { grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr); }
    .bxwy-seg button { font-size: 14px; padding: 0 8px; }
    .bxwy-num { font-size: 76px; line-height: 80px; }
    .bxwy-tile { padding: 14px 16px; gap: 4px; }
    .bxwy-tile b { font-size: 24px; line-height: 28px; }
}
/* the narrowest phones (320px): the answer's button keeps to the card */
@container (max-width: 300px) {
    .bxwy .bxwy-go .btn { padding: 0 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .bxwy-answer, .bxwy-dot, .bxwy-shade, .bxwy-band, .bxwy-seg button, .bxwy-grid, .bxwy-thumb { transition: none !important; }
    .bxwy-dot.is-pulse { animation: none; }
}
