/**
 * Test kolagenu (quiz) — Collibre. Style 1:1 z mockupem „Collibre Test kolagenu standalone".
 * Markup: inc/quiz.php (szablon page-quiz.php). Silnik: assets/js/quiz.js.
 * Astra styluje <input>/<button> selektorem atrybutowym (0,1,1) > nasza klasa (0,1,0)
 * → wygląd formularzy/przycisków wymusza !important (patrz collibre-produkty-sekcja / GOTCHA 3).
 */

/* Pełna szerokość szablonu (jak blog): kontener Astry nie flexuje treści. */
body.page-template-page-quiz .site-content > .ast-container { display: block; }

/* Chowanie atrybutem [hidden] — nasze reguły display:grid/flex nadpisałyby UA [hidden]{display:none},
   więc wymuszamy je globalnie w obrębie quizu (sekcje intro/quiz/lead/wynik + karty). */
.tech-quiz [hidden] { display: none !important; }

.tech-quiz__wrap {
	max-width: 72rem;
	margin-inline: auto;
	padding-inline: 1rem;
}
@media (min-width: 640px) { .tech-quiz__wrap { padding-inline: 1.5rem; } }

/* standard breadcrumbs: 2rem / 3rem@1024; inline 0 (wrap quizu ma własny padding-inline) */
.tech-quiz .tech-breadcrumbs { padding: 2rem 0 0; max-width: none; }
@media (min-width: 1024px) { .tech-quiz .tech-breadcrumbs { padding-top: 3rem; } }

/* ── Animacje ─────────────────────────────────────────────────────────────── */
@keyframes tech-quiz-fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes tech-quiz-pop  { 0% { transform: scale(.7); opacity: 0; } 60% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
.tech-quiz__fade { animation: tech-quiz-fade .4s ease both; }
@media (prefers-reduced-motion: reduce) { .tech-quiz__fade { animation: none; } }

/* ── INTRO ────────────────────────────────────────────────────────────────── */
.tech-quiz__intro {
	display: grid;
	gap: 2rem;
	align-items: center;
	padding-block: 2.5rem;
}
@media (min-width: 1024px) {
	.tech-quiz__intro { grid-template-columns: 1fr 1fr; gap: 3.5rem; padding-block: 4rem; }
	.tech-quiz__intro-text  { order: 1; }
	.tech-quiz__intro-media { order: 2; }
}
.tech-quiz__intro-media { order: -1; }

.tech-quiz__eyebrow {
	font-size: var(--tech-fs-xs);
	font-weight: var(--tech-fw-bold);
	text-transform: uppercase;
	letter-spacing: .18em;
	color: var(--tech-slate);
	margin: 0 0 1rem;
}
.tech-quiz__title {
	font-size: var(--tech-fs-4xl);
	font-weight: var(--tech-fw-extrabold);
	letter-spacing: var(--tech-tracking-tight);
	line-height: 1.05;
	margin: 0;
}
@media (min-width: 640px)  { .tech-quiz__title { font-size: var(--tech-fs-5xl); } }
@media (min-width: 1024px) { .tech-quiz__title { font-size: var(--tech-fs-6xl); } }

.tech-quiz__lead {
	margin: 1.25rem 0 0;
	font-size: var(--tech-fs-lg);
	font-weight: var(--tech-fw-semibold);
	color: var(--tech-ink);
}
.tech-quiz__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-top: 1rem;
	font-size: var(--tech-fs-sm);
	color: var(--tech-slate);
}
.tech-quiz__fact { display: inline-flex; align-items: center; gap: .375rem; }

.tech-quiz__infobox {
	margin-top: 1.75rem;
	display: flex;
	gap: .75rem;
	padding: 1.25rem;
	background: var(--tech-mist);
	border: 1px solid var(--tech-border);
	border-radius: var(--tech-radius-lg);
}
.tech-quiz__infobox svg { color: var(--tech-ink); flex: 0 0 auto; margin-top: .125rem; }
.tech-quiz__infobox p { margin: 0; font-size: var(--tech-fs-sm); color: var(--tech-slate); line-height: var(--tech-lh-normal); }

.tech-quiz__promo { margin-top: 1.75rem; }
.tech-quiz__promo-pill {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	border-radius: var(--tech-radius-pill);
	background: var(--tech-mint-50);
	border: 1px solid var(--tech-mint-100);
	padding: .5rem 1rem;
	font-size: var(--tech-fs-sm);
	font-weight: var(--tech-fw-semibold);
	color: var(--tech-ink);
}
.tech-quiz__promo-pill svg { color: var(--tech-mint); }

.tech-quiz__start {
	margin-top: 1.75rem;
	display: inline-flex !important;
	align-items: center;
	gap: .5rem;
	padding: 1rem 2rem !important;
	border-radius: var(--tech-radius-pill) !important;
	background: var(--tech-ink) !important;
	color: var(--tech-white) !important;
	border: 0 !important;
	font-weight: var(--tech-fw-semibold) !important;
	font-size: var(--tech-fs-base) !important;
	cursor: pointer;
	transition: background-color .15s ease;
	min-width: 0 !important;
}
.tech-quiz__start:hover { background: var(--tech-slate) !important; }

.tech-quiz__ph {
	border-radius: var(--tech-radius-lg);
	aspect-ratio: 4 / 3;
	background-color: var(--tech-mist);
	background-image: repeating-linear-gradient(135deg, rgba(91,102,112,.07) 0 10px, rgba(91,102,112,0) 10px 20px);
}
@media (min-width: 1024px) { .tech-quiz__ph { aspect-ratio: 1 / 1; } }

/* Zdjęcie wstępu z panelu „Test kolagenu” — ta sama geometria co placeholder (4:3 → 1:1 od 1024). */
.tech-quiz__intro-img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--tech-radius-lg);
}
@media (min-width: 1024px) { .tech-quiz__intro-img { aspect-ratio: 1 / 1; } }

/* Karta: produkt chwilowo niedostępny (przycisk wyłączony). */
.tech-quiz__stock {
	margin: .75rem 0 0;
	font-size: .875rem;
	color: var(--tech-slate);
}
.tech-quiz__add[disabled] { opacity: .5; cursor: not-allowed; }

/* Wynik: żaden produkt testu nie istnieje. */
.tech-quiz__empty {
	margin: 0;
	text-align: center;
	color: var(--tech-slate);
}
.tech-quiz__empty a { color: inherit; text-decoration: underline; }

/* ── QUIZ (pytania) ───────────────────────────────────────────────────────── */
.tech-quiz__quiz { padding-block: 2rem; }
@media (min-width: 640px) { .tech-quiz__quiz { padding-block: 3rem; } }
.tech-quiz__quiz-inner { max-width: 42rem; margin-inline: auto; }

.tech-quiz__bar-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: var(--tech-fs-sm);
	margin-bottom: .75rem;
}
.tech-quiz__back {
	display: inline-flex !important;
	align-items: center;
	gap: .375rem;
	background: transparent !important;
	border: 0 !important;
	padding: 0 !important;
	min-width: 0 !important;
	color: var(--tech-slate) !important;
	font-size: var(--tech-fs-sm) !important;
	font-weight: var(--tech-fw-medium) !important;
	cursor: pointer;
	transition: color .15s ease;
}
.tech-quiz__back:hover { color: var(--tech-ink) !important; }
.tech-quiz__counter { font-weight: var(--tech-fw-semibold); color: var(--tech-ink); }

.tech-quiz__bar {
	height: .375rem;
	border-radius: var(--tech-radius-pill);
	background: var(--tech-mist);
	overflow: hidden;
}
.tech-quiz__bar-fill {
	height: 100%;
	background: var(--tech-ink);
	transition: width .3s ease;
}

.tech-quiz__question { margin-top: 2rem; }
.tech-quiz__q {
	font-size: var(--tech-fs-2xl);
	font-weight: var(--tech-fw-bold);
	letter-spacing: var(--tech-tracking-tight);
	line-height: var(--tech-lh-snug);
	margin: 0;
}
@media (min-width: 640px) { .tech-quiz__q { font-size: var(--tech-fs-3xl); } }

.tech-quiz__opts { margin-top: 1.5rem; display: flex; flex-direction: column; gap: .75rem; }
.tech-quiz__opt {
	width: 100% !important;
	text-align: left !important;
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.25rem !important;
	border-radius: var(--tech-radius-lg) !important;
	border: 1px solid var(--tech-border) !important;
	background: var(--tech-white) !important;
	min-width: 0 !important;
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease, transform .1s ease;
}
.tech-quiz__opt:hover { border-color: var(--tech-ink) !important; }
.tech-quiz__opt:active { transform: scale(.99); }
.tech-quiz__opt[data-selected="true"] { border-color: var(--tech-ink) !important; background: var(--tech-mist) !important; }
.tech-quiz__opt-txt { font-weight: var(--tech-fw-semibold); color: var(--tech-ink); }
.tech-quiz__tick {
	flex: 0 0 auto;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	background: var(--tech-ink);
	color: var(--tech-white);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity .15s ease;
}
.tech-quiz__opt[data-selected="true"] .tech-quiz__tick { opacity: 1; }

/* ── LEAD (e-mail) ────────────────────────────────────────────────────────── */
.tech-quiz__lead { padding-block: 2.5rem; }
@media (min-width: 640px) { .tech-quiz__lead { padding-block: 3.5rem; } }
.tech-quiz__lead-inner { max-width: 34rem; margin-inline: auto; text-align: center; }
.tech-quiz__lead-ico {
	width: 4rem; height: 4rem;
	margin: 0 auto;
	border-radius: 50%;
	background: var(--tech-mist);
	color: var(--tech-ink);
	display: flex; align-items: center; justify-content: center;
}
.tech-quiz__lead-title {
	margin: 1.5rem 0 0;
	font-size: var(--tech-fs-2xl);
	font-weight: var(--tech-fw-extrabold);
	letter-spacing: var(--tech-tracking-tight);
}
@media (min-width: 640px) { .tech-quiz__lead-title { font-size: var(--tech-fs-3xl); } }
.tech-quiz__lead-lead { margin: .75rem auto 0; max-width: 30rem; color: var(--tech-slate); line-height: var(--tech-lh-normal); }

.tech-quiz__lead-form {
	margin-top: 1.75rem;
	display: flex;
	gap: .625rem;
	max-width: 30rem;
	margin-inline: auto;
}
.tech-quiz__lead-input {
	flex: 1 1 auto;
	min-width: 0;
	background: var(--tech-white) !important;
	border: 1px solid var(--tech-border) !important;
	border-radius: var(--tech-radius-pill) !important;
	padding: .875rem 1.25rem !important;
	color: var(--tech-ink) !important;
	font-size: var(--tech-fs-base) !important;
	width: auto !important;
	box-shadow: none !important;
}
.tech-quiz__lead-input:focus { border-color: var(--tech-ink) !important; outline: none !important; }
.tech-quiz__lead-input.is-invalid { border-color: #d64545 !important; }

.tech-quiz__lead-submit {
	flex: 0 0 auto;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	background: var(--tech-ink) !important;
	color: var(--tech-white) !important;
	border: 0 !important;
	border-radius: var(--tech-radius-pill) !important;
	padding: .875rem 1.5rem !important;
	font-weight: var(--tech-fw-semibold) !important;
	font-size: var(--tech-fs-base) !important;
	min-width: 0 !important;
	cursor: pointer;
	transition: background-color .15s ease;
	white-space: nowrap;
}
.tech-quiz__lead-submit:hover { background: var(--tech-slate) !important; }

.tech-quiz__lead-consent {
	display: flex;
	gap: .5rem;
	align-items: flex-start;
	max-width: 30rem;
	margin: 1rem auto 0;
	text-align: left;
	font-size: var(--tech-fs-sm);
	color: var(--tech-slate);
	line-height: var(--tech-lh-normal);
}
.tech-quiz__lead-consent input { margin-top: .2rem; flex: 0 0 auto; }
.tech-quiz__lead-err { margin: .75rem 0 0; color: #d64545; font-size: var(--tech-fs-sm); }
.tech-quiz__lead-skip {
	margin-top: 1.25rem;
	background: transparent !important;
	border: 0 !important;
	padding: 0 !important;
	min-width: 0 !important;
	color: var(--tech-slate) !important;
	font-size: var(--tech-fs-sm) !important;
	font-weight: var(--tech-fw-medium) !important;
	text-decoration: underline;
	cursor: pointer;
}
.tech-quiz__lead-skip:hover { color: var(--tech-ink) !important; }

/* ── WYNIK ────────────────────────────────────────────────────────────────── */
.tech-quiz__result { padding-block: 2.5rem; }
@media (min-width: 640px) { .tech-quiz__result { padding-block: 3.5rem; } }
.tech-quiz__result-head { max-width: 48rem; margin-inline: auto; text-align: center; }
.tech-quiz__result-check {
	width: 4rem; height: 4rem;
	margin: 0 auto;
	border-radius: 50%;
	background: var(--tech-mint);
	color: var(--tech-white);
	display: flex; align-items: center; justify-content: center;
	animation: tech-quiz-pop .5s ease both;
}
/* Wyjątek PO regule bazowej — wcześniej stał wyżej i przegrywał kaskadę (review pi r14). */
@media (prefers-reduced-motion: reduce) { .tech-quiz__result-check { animation: none; } }
.tech-quiz__result-eyebrow {
	margin: 1.5rem 0 0;
	font-size: var(--tech-fs-xs);
	font-weight: var(--tech-fw-bold);
	text-transform: uppercase;
	letter-spacing: .18em;
	color: var(--tech-slate);
}
.tech-quiz__result-title {
	margin: .5rem 0 0;
	font-size: var(--tech-fs-3xl);
	font-weight: var(--tech-fw-extrabold);
	letter-spacing: var(--tech-tracking-tight);
}
@media (min-width: 640px) { .tech-quiz__result-title { font-size: var(--tech-fs-4xl); } }
.tech-quiz__result-reason {
	margin: 1rem auto 0;
	max-width: 36rem;
	color: var(--tech-slate);
	font-size: var(--tech-fs-lg);
	line-height: var(--tech-lh-normal);
}

/* Punkty „Twoja potrzeba → co daje produkt" (JS, max 3) */
.tech-quiz__needs {
	list-style: none;
	margin: 1.5rem auto 0;
	padding: 0;
	max-width: 36rem;
	display: grid;
	gap: .625rem;
	text-align: left;
}
.tech-quiz__need {
	position: relative;
	margin: 0;
	padding: .875rem 1rem .875rem 2.75rem;
	border-radius: var(--tech-radius);
	background: var(--tech-mint-50);
	color: var(--tech-slate);
	font-size: var(--tech-fs-sm);
	line-height: var(--tech-lh-normal);
	overflow-wrap: anywhere;
}
.tech-quiz__need::before {
	content: "";
	position: absolute;
	left: 1rem; top: 1.05rem;
	width: 1rem; height: 1rem;
	border-radius: 50%;
	background: var(--tech-mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / .625rem no-repeat;
}
.tech-quiz__need-lab { color: var(--tech-ink); font-weight: var(--tech-fw-bold); }

/* Karta wyniku (jedna widoczna) */
.tech-quiz__cards { margin-top: 2.5rem; }
.tech-quiz__card {
	max-width: 48rem;
	margin-inline: auto;
	border: 1px solid var(--tech-border);
	border-radius: var(--tech-radius-lg);
	overflow: hidden;
	display: grid;
}
@media (min-width: 640px) { .tech-quiz__card { grid-template-columns: 2fr 3fr; } }

.tech-quiz__rmedia {
	background-color: var(--tech-mist);
	min-height: 220px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.tech-quiz__rimg { width: 100%; height: 100%; object-fit: cover; display: block; }

.tech-quiz__rbody { padding: 1.5rem; }
@media (min-width: 640px) { .tech-quiz__rbody { padding: 2rem; } }

.tech-quiz__rrating { margin-bottom: .25rem; }
.tech-quiz__rrating .tech-produkt__rating { border: 0; width: 140px; height: 22px; display: block; }
.tech-quiz__rname {
	margin: 0;
	font-size: var(--tech-fs-2xl);
	font-weight: var(--tech-fw-bold);
	letter-spacing: var(--tech-tracking-tight);
}
.tech-quiz__rdesc { margin: .5rem 0 0; color: var(--tech-slate); line-height: var(--tech-lh-normal); }

.tech-quiz__rprice { margin-top: 1rem; display: flex; align-items: baseline; flex-wrap: wrap; gap: .75rem; }
.tech-quiz__price-new { font-size: var(--tech-fs-3xl); font-weight: var(--tech-fw-extrabold); color: var(--tech-ink); }
.tech-quiz__price-old { font-size: var(--tech-fs-lg); color: var(--tech-slate); text-decoration: line-through; }
.tech-quiz__price-badge {
	display: inline-block;
	border-radius: var(--tech-radius-pill);
	background: var(--tech-mint-50);
	color: var(--tech-ink);
	border: 1px solid var(--tech-mint-100);
	font-size: var(--tech-fs-xs);
	font-weight: var(--tech-fw-bold);
	padding: .25rem .625rem;
}

.tech-quiz__code-wrap { margin-top: 1.25rem; }
.tech-quiz__code-lab {
	font-size: var(--tech-fs-xs);
	font-weight: var(--tech-fw-bold);
	text-transform: uppercase;
	letter-spacing: .14em;
	color: var(--tech-slate);
	margin-bottom: .5rem;
}
.tech-quiz__code-row { display: flex; align-items: stretch; gap: .5rem; }
.tech-quiz__code {
	flex: 1 1 auto;
	border: 2px dashed rgba(56,63,69,.3);
	background: var(--tech-mist);
	border-radius: var(--tech-radius);
	padding: 0 1rem;
	display: flex;
	align-items: center;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-weight: var(--tech-fw-bold);
	color: var(--tech-ink);
	letter-spacing: .1em;
	font-size: var(--tech-fs-lg);
}
.tech-quiz__copy {
	flex: 0 0 auto;
	display: inline-flex !important;
	align-items: center;
	gap: .5rem;
	background: var(--tech-ink) !important;
	color: var(--tech-white) !important;
	border: 0 !important;
	border-radius: var(--tech-radius) !important;
	padding: 0 1rem !important;
	min-width: 0 !important;
	font-weight: var(--tech-fw-semibold) !important;
	font-size: var(--tech-fs-sm) !important;
	cursor: pointer;
	transition: background-color .15s ease;
}
.tech-quiz__copy:hover { background: var(--tech-slate) !important; }

.tech-quiz__cta { margin-top: 1.5rem; display: flex; flex-direction: column; gap: .75rem; }
.tech-quiz__add {
	width: 100% !important;
	height: 3.5rem;
	display: flex !important;
	align-items: center;
	justify-content: center;
	gap: .625rem;
	border-radius: var(--tech-radius-pill) !important;
	background: var(--tech-ink) !important;
	color: var(--tech-white) !important;
	border: 0 !important;
	font-size: var(--tech-fs-base) !important;
	font-weight: var(--tech-fw-semibold) !important;
	min-width: 0 !important;
	cursor: pointer;
	white-space: nowrap;
	padding-inline: 1rem !important;
	transition: background-color .15s ease;
}
@media (min-width: 640px) { .tech-quiz__add { height: 4rem; font-size: var(--tech-fs-lg) !important; } }
.tech-quiz__add:hover { background: var(--tech-slate) !important; }
.tech-quiz__add:disabled { opacity: .75; cursor: default; }

.tech-quiz__details {
	width: 100%;
	height: 3rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--tech-radius-pill);
	border: 1px solid var(--tech-ink);
	color: var(--tech-ink);
	font-weight: var(--tech-fw-semibold);
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease;
}
.tech-quiz__details:hover { background: var(--tech-ink); color: var(--tech-white); }

.tech-quiz__note { margin: .75rem 0 0; font-size: var(--tech-fs-xs); color: var(--tech-slate); }

.tech-quiz__restart-wrap { margin-top: 2rem; text-align: center; }
.tech-quiz__restart {
	display: inline-flex !important;
	align-items: center;
	gap: .5rem;
	background: transparent !important;
	border: 0 !important;
	padding: 0 !important;
	min-width: 0 !important;
	color: var(--tech-slate) !important;
	font-size: var(--tech-fs-sm) !important;
	font-weight: var(--tech-fw-semibold) !important;
	cursor: pointer;
	transition: color .15s ease;
}
.tech-quiz__restart:hover { color: var(--tech-ink) !important; }
