/* QuizFlow — public quiz styles. Everything is scoped under .qf */

.qf {
	--qf-theme: #2563eb;
	--qf-title: #0f172a;
	--qf-text: #475569;
	--qf-bg: #ffffff;
	--qf-font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--qf-tfont: var(--qf-font);
	--qf-r: 16px;
	--qf-h: 56px;
	--qf-ts: 24px;
	--qf-line: color-mix(in srgb, var(--qf-title) 12%, transparent);
	--qf-soft: color-mix(in srgb, var(--qf-title) 4%, var(--qf-bg));
	--qf-tint: color-mix(in srgb, var(--qf-theme) 10%, var(--qf-bg));
	--qf-on-theme: #fff;
	box-sizing: border-box;
	font-family: var(--qf-font);
	font-size: 16px;
	line-height: 1.5;
	color: var(--qf-text);
	background: var(--qf-bg);
	max-width: 480px;
	margin: 0 auto;
	padding: 0 20px 40px;
	text-align: center;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}
.qf *, .qf *::before, .qf *::after { box-sizing: inherit; }
.qf.qf-full { min-height: 100vh; min-height: 100dvh; }
.qf.qf-left { text-align: left; }
.qf img { max-width: 100%; height: auto; display: block; }
.qf button { font: inherit; color: inherit; margin: 0; cursor: pointer; }
.qf strong { color: var(--qf-title); font-weight: 700; }
.qf .qf-i { width: 20px; height: 20px; flex: none; }
.qf :focus-visible { outline: 2px solid var(--qf-theme); outline-offset: 2px; }

/* header */
.qf-head { position: sticky; top: 0; z-index: 5; background: var(--qf-bg); padding: 12px 0 10px; margin-bottom: 8px; }
.qf-head-row { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; min-height: 40px; }
.qf-logo { margin: 0 auto; max-height: 56px; object-fit: contain; }
.qf-back { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; border-radius: 50%; padding: 0; color: var(--qf-title); }
.qf-back:hover { background: var(--qf-soft); }
.qf-back.is-ph { visibility: hidden; }
.qf-progress { height: 6px; border-radius: 99px; background: var(--qf-line); overflow: hidden; margin-top: 10px; }
.qf-progress span { display: block; height: 100%; border-radius: inherit; background: var(--qf-theme); transition: width .5s cubic-bezier(.2, .8, .2, 1); }

/* body + element rhythm */
.qf-body { display: flex; flex-direction: column; gap: 16px; padding-top: 12px; outline: none; animation: qf-in .35s ease both; }
@keyframes qf-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.qf-el { min-width: 0; }
.qf-err { margin: 6px 0 0; font-size: 14px; color: #dc2626; display: none; text-align: left; }
.qf-el.has-err .qf-err { display: block; }
.qf-el.has-err .qf-input, .qf-el.has-err .qf-opt { border-color: #dc2626; }

/* type */
.qf-h { margin: 0; font-family: var(--qf-tfont); color: var(--qf-title); font-size: var(--qf-ts); line-height: 1.25; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
.qf-h.qf-size-sm { font-size: calc(var(--qf-ts) - 4px); }
.qf-h.qf-size-lg { font-size: calc(var(--qf-ts) + 4px); }
.qf-h.qf-size-xl { font-size: calc(var(--qf-ts) + 10px); letter-spacing: -.02em; }
.qf-t { font-size: 16px; text-wrap: pretty; }
.qf-t.qf-size-sm { font-size: 14px; }
.qf-t.qf-size-lg { font-size: 18px; }
.qf-al-center { text-align: center; }
.qf-al-left { text-align: left; }
.qf-hl { background: none; color: var(--qf-theme); font-weight: 700; }
.qf .qf-hl strong, .qf .qf-hl em { color: inherit; }

/* media */
.qf-img img { margin: 0 auto; border-radius: var(--qf-r); }
.qf-img { margin: 0; }
.qf-video { position: relative; border-radius: var(--qf-r); overflow: hidden; background: #000; }
.qf-video.qf-v169 { aspect-ratio: 16 / 9; }
.qf-video.qf-v916 { aspect-ratio: 9 / 16; max-width: 340px; margin: 0 auto; }
.qf-video iframe, .qf-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.qf-cover { position: absolute; inset: 0; z-index: 2; }
.qf-ph { display: flex; flex-direction: column; align-items: center; gap: 8px; justify-content: center; min-height: 140px; border: 2px dashed var(--qf-line); border-radius: var(--qf-r); color: var(--qf-text); font-size: 14px; }

/* options */
.qf-opts { display: flex; flex-direction: column; gap: 10px; }
.qf-opt { display: flex; flex-direction: column; width: 100%; min-height: var(--qf-h); padding: 0; border: 1.5px solid var(--qf-line); border-radius: var(--qf-r); background: var(--qf-soft); text-align: left; overflow: hidden; transition: border-color .15s, background .15s, transform .1s; }
.qf-opt:hover { border-color: color-mix(in srgb, var(--qf-theme) 55%, transparent); }
.qf-opt:active { transform: scale(.985); }
.qf-opt.is-on { border-color: var(--qf-theme); background: var(--qf-tint); }
.qf-opt-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: calc(var(--qf-h) - 3px); flex: 1; width: 100%; }
.qf-opt-emoji { font-size: 22px; line-height: 1; width: 28px; text-align: center; flex: none; }
.qf-opt-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.qf-opt-l { color: var(--qf-title); font-weight: 600; line-height: 1.3; }
.qf-opt-d { font-size: 14px; line-height: 1.35; margin-top: 2px; }
.qf-box { width: 22px; height: 22px; border: 1.5px solid var(--qf-line); border-radius: 6px; display: grid; place-items: center; flex: none; color: transparent; background: var(--qf-bg); transition: all .15s; }
.qf-box .qf-i { width: 15px; height: 15px; stroke-width: 3; }
.qf-opt.is-on .qf-box { background: var(--qf-theme); border-color: var(--qf-theme); color: var(--qf-on-theme); }
.qf-opts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qf-opts-grid .qf-opt-row { justify-content: center; text-align: center; flex-direction: column; gap: 6px; padding: 12px 10px; }
.qf-opts-grid .qf-opt-txt { align-items: center; }
.qf-opts-grid .qf-opt-emoji { font-size: 30px; width: auto; }
.qf-opts-grid .qf-box { position: absolute; top: 8px; right: 8px; }
.qf-opts-grid .qf-opt { position: relative; }
.qf-opt-img { display: block; aspect-ratio: 1; background: var(--qf-line); width: 100%; }
.qf-opt-img img { width: 100%; height: 100%; object-fit: cover; }
.qf-opts-list .qf-opt.has-img { flex-direction: row; align-items: stretch; }
.qf-opts-list .qf-opt-img { width: 72px; flex: none; aspect-ratio: auto; }

/* inputs */
.qf-field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.qf-label { font-size: 14px; font-weight: 600; color: var(--qf-title); }
.qf-label small { font-weight: 400; color: var(--qf-text); }
.qf-input { width: 100%; min-height: var(--qf-h); padding: 12px 16px; font: inherit; font-size: 16px; color: var(--qf-title); background: var(--qf-bg); border: 1.5px solid var(--qf-line); border-radius: var(--qf-r); outline: none; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
.qf-input::placeholder { color: color-mix(in srgb, var(--qf-text) 70%, transparent); }
.qf-input:focus { border-color: var(--qf-theme); box-shadow: 0 0 0 4px color-mix(in srgb, var(--qf-theme) 15%, transparent); }
textarea.qf-input { resize: vertical; }

/* button */
.qf-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: var(--qf-h); padding: 12px 20px; border: 0; border-radius: var(--qf-r); background: var(--qf-theme); color: var(--qf-on-theme) !important; font-weight: 700; font-size: 17px; line-height: 1.25; transition: filter .15s, transform .1s; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--qf-theme) 60%, transparent); }
.qf-btn strong { color: inherit; }
.qf-btn:hover { filter: brightness(1.06); }
.qf-btn:active { transform: scale(.98); }
.qf-pulse { animation: qf-pulse 2s infinite; }
@keyframes qf-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
.qf-btn-sub { margin: 8px 0 0; font-size: 13px; text-align: center; }

/* loading */
.qf-load { text-align: left; }
.qf-load-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; font-weight: 600; color: var(--qf-title); }
.qf-load-pct { font-variant-numeric: tabular-nums; color: var(--qf-theme); }
.qf-bar { height: 10px; border-radius: 99px; background: var(--qf-line); overflow: hidden; }
.qf-bar span { display: block; height: 100%; background: var(--qf-theme); border-radius: inherit; }
.qf-load-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.qf-load-list li { display: flex; gap: 10px; align-items: center; opacity: .45; transition: opacity .3s; }
.qf-load-list li .qf-i { width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: var(--qf-line); color: transparent; stroke-width: 3; transition: all .3s; }
.qf-load-list li.is-done { opacity: 1; }
.qf-load-list li.is-done .qf-i { background: var(--qf-theme); color: var(--qf-on-theme); }

/* notice */
.qf-note { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: var(--qf-r); text-align: left; font-size: 15px; --tone: var(--qf-theme); background: color-mix(in srgb, var(--tone) 10%, var(--qf-bg)); border: 1px solid color-mix(in srgb, var(--tone) 25%, transparent); }
.qf-note .qf-i { color: var(--tone); margin-top: 1px; }
.qf-note-success { --tone: #16a34a; }
.qf-note-warning { --tone: #d97706; }
.qf-note-danger { --tone: #dc2626; }

/* testimonials */
.qf-testis { display: grid; gap: 12px; }
.qf-carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin: 0 -20px; padding: 0 20px 6px; scrollbar-width: none; }
.qf-carousel::-webkit-scrollbar { display: none; }
.qf-carousel .qf-testi { flex: 0 0 86%; scroll-snap-align: center; }
.qf-testi { margin: 0; padding: 16px; border: 1px solid var(--qf-line); border-radius: var(--qf-r); background: var(--qf-soft); text-align: left; }
.qf-testi-photo { border-radius: calc(var(--qf-r) - 6px); margin-bottom: 12px; width: 100%; }
.qf-testi-head { display: flex; align-items: center; gap: 10px; }
.qf-testi-head > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.qf-testi-head small { font-size: 13px; }
.qf-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--qf-tint); color: var(--qf-theme); font-weight: 700; font-size: 14px; flex: none; }
.qf-stars { display: flex; gap: 1px; color: var(--qf-line); }
.qf-stars .on { color: #f59e0b; }
.qf-stars .qf-i { width: 15px; height: 15px; }
.qf-testi blockquote { margin: 10px 0 0; font-size: 15px; }

/* price */
.qf-plans { display: grid; gap: 12px; margin-bottom: 4px; }
.qf-plan { position: relative; display: block; width: 100%; padding: 16px; text-align: left; border: 2px solid var(--qf-line); border-radius: var(--qf-r); background: var(--qf-bg); transition: border-color .15s, background .15s; }
.qf-plan.is-on { border-color: var(--qf-theme); background: var(--qf-tint); }
.qf-plan-badge { position: absolute; top: -11px; right: 14px; padding: 2px 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 99px; background: var(--qf-theme); color: var(--qf-on-theme); }
.qf-plan-main { display: flex; align-items: center; gap: 12px; }
.qf-radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--qf-line); flex: none; transition: all .15s; }
.qf-plan.is-on .qf-radio { border: 7px solid var(--qf-theme); }
.qf-plan-name { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.qf-plan-name small { font-size: 13px; }
.qf-plan-price { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; text-align: right; }
.qf-plan-price s { font-size: 13px; opacity: .7; }
.qf-plan-price strong { font-size: 22px; }
.qf-plan-price small { font-size: 12px; }
.qf-plan-feats { display: grid; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--qf-line); font-size: 14px; }
.qf-plan-feats span { display: flex; gap: 8px; align-items: flex-start; }
.qf-plan-feats .qf-i { width: 16px; height: 16px; color: var(--qf-theme); margin-top: 3px; stroke-width: 3; }
.qf-plans + .qf-btn { margin-top: 12px; }

/* timer */
.qf-timer { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: var(--qf-r); background: #dc2626; color: #fff; font-weight: 600; font-size: 15px; }
.qf-timer strong { color: #fff; font-variant-numeric: tabular-nums; font-size: 18px; }
.qf-timer .qf-i { width: 18px; height: 18px; }
.qf-el-timer:has(.qf-sticky) { position: sticky; top: 0; z-index: 6; }

/* chart */
.qf-chart { padding: 16px; border: 1px solid var(--qf-line); border-radius: var(--qf-r); background: var(--qf-soft); }
.qf-chart-title { font-family: var(--qf-tfont); font-weight: 700; color: var(--qf-title); margin-bottom: 8px; }
.qf-line { width: 100%; height: auto; display: block; overflow: visible; }
.qf-line-labels { display: flex; justify-content: space-between; font-size: 12px; margin-top: 6px; }
.qf-line-labels .is-hl { color: var(--qf-theme); font-weight: 700; }
.qf-chart-badge { margin-top: 10px; display: inline-block; padding: 4px 12px; border-radius: 99px; background: var(--qf-theme); color: var(--qf-on-theme); font-size: 13px; font-weight: 600; }
.qf-bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; }
.qf-bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; font-size: 13px; }
.qf-bar-fill { width: 100%; border-radius: 8px 8px 4px 4px; background: color-mix(in srgb, var(--qf-theme) 30%, var(--qf-bg)); }
.qf-bar-col.is-hl .qf-bar-fill { background: var(--qf-theme); }
.qf-bar-v { font-weight: 700; color: var(--qf-title); }
.qf-bar-l { line-height: 1.2; }

/* level */
.qf-level { padding: 16px; border: 1px solid var(--qf-line); border-radius: var(--qf-r); background: var(--qf-soft); text-align: left; }
.qf-level-top { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; color: var(--qf-title); margin-bottom: 34px; }
.qf-level-top strong { color: var(--qf-theme); }
.qf-level-bar { position: relative; height: 10px; border-radius: 99px; background: linear-gradient(90deg, #22c55e, #eab308 50%, #ef4444); }
.qf-level-mark { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--qf-bg); border: 4px solid var(--qf-title); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.qf-level-mark em { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-style: normal; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--qf-title); color: var(--qf-bg); }
.qf-level-legend { display: flex; justify-content: space-between; font-size: 12px; margin-top: 8px; }

/* faq */
.qf-faq { display: grid; gap: 8px; text-align: left; }
.qf-faq details { border: 1px solid var(--qf-line); border-radius: var(--qf-r); background: var(--qf-soft); }
.qf-faq summary { list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 16px; font-weight: 600; color: var(--qf-title); cursor: pointer; }
.qf-faq summary::-webkit-details-marker { display: none; }
.qf-plus { position: relative; width: 14px; height: 14px; flex: none; }
.qf-plus::before, .qf-plus::after { content: ''; position: absolute; left: 0; top: 6px; width: 14px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s; }
.qf-plus::after { transform: rotate(90deg); }
.qf-faq details[open] .qf-plus::after { transform: rotate(0); }
.qf-faq details > div { padding: 0 16px 14px; font-size: 15px; }

/* list */
.qf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; text-align: left; }
.qf-list li { display: flex; gap: 10px; align-items: flex-start; }
.qf-list .qf-i { width: 22px; height: 22px; padding: 3px; border-radius: 50%; stroke-width: 3; color: var(--qf-on-theme); background: var(--qf-theme); margin-top: 1px; }
.qf-list-x .qf-i { background: #ef4444; }
.qf-list-dot .qf-i { background: none; color: var(--qf-theme); }

/* compare */
.qf-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.qf-cmp-side { padding: 14px 12px; border-radius: var(--qf-r); border: 1px solid var(--qf-line); background: var(--qf-soft); }
.qf-cmp-side.is-good { border: 2px solid var(--qf-theme); background: var(--qf-tint); }
.qf-cmp-title { font-family: var(--qf-tfont); font-weight: 700; color: var(--qf-title); text-align: center; margin-bottom: 10px; }
.qf-cmp-side img { border-radius: calc(var(--qf-r) - 6px); margin-bottom: 10px; width: 100%; aspect-ratio: 1; object-fit: cover; }
.qf-cmp ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; line-height: 1.35; }
.qf-cmp li { display: flex; gap: 6px; align-items: flex-start; }
.qf-cmp li .qf-i { width: 16px; height: 16px; margin-top: 1px; color: #ef4444; stroke-width: 3; }
.qf-cmp-side.is-good li .qf-i { color: var(--qf-theme); }

.qf-testbadge { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 99999; max-width: calc(100vw - 24px); padding: 6px 12px; border-radius: 99px; background: #18181b; color: #fff; font: 600 12px/1.3 system-ui, -apple-system, 'Segoe UI', sans-serif; text-align: center; opacity: .88; pointer-events: none; }

.qf-empty { padding: 40px 16px; border: 2px dashed var(--qf-line); border-radius: var(--qf-r); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
	.qf *, .qf-body { animation: none !important; transition: none !important; }
}
