/**
 * Vprašalnik — frontend styles.
 *
 * BEM block: .av-vprasalnik
 * Animations: swipe-right-in / swipe-left-in mirror the original avemed.si feel.
 */

.av-vprasalnik {
	--av-vprasalnik-accent: var(--primary-color, #0a5b3e);
	--av-vprasalnik-accent-soft: rgba(10, 91, 62, .08);
	--av-vprasalnik-ink: #1a2032;
	--av-vprasalnik-muted: #6a7282;
	--av-vprasalnik-border: #e5e7eb;
	--av-vprasalnik-bg: #ffffff;
	--av-vprasalnik-bg-soft: #f8fafc;
	--av-vprasalnik-error: #c53030;
	--av-vprasalnik-radius: 14px;
	--av-vprasalnik-shadow: 0 10px 40px rgba(15, 23, 42, .06);

	position: relative;
	max-width: 720px;
	margin: 0 auto;
	padding: 32px 24px;
	font-family: var(--av-font-family, inherit);
	color: var(--av-vprasalnik-ink);
}

/* ── progress ─────────────────────────────────────────── */

.av-vprasalnik__progress {
	position: relative;
	height: 6px;
	border-radius: 999px;
	background: var(--av-vprasalnik-bg-soft);
	overflow: hidden;
	margin-bottom: 32px;
}

.av-vprasalnik__progress-bar {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0%;
	background: var(--av-vprasalnik-accent);
	transition: width .35s ease;
	border-radius: 999px;
}

.av-vprasalnik__progress-number {
	position: absolute;
	right: 0;
	top: 10px;
	font-size: 12px;
	color: var(--av-vprasalnik-muted);
	font-variant-numeric: tabular-nums;
}

/* ── saving hint ──────────────────────────────────────── */

.av-vprasalnik__hint {
	position: absolute;
	top: 12px;
	left: 24px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: var(--av-vprasalnik-muted);
	background: var(--av-vprasalnik-bg);
	padding: 6px 10px;
	border-radius: 999px;
	box-shadow: var(--av-vprasalnik-shadow);
	pointer-events: none;
	opacity: 0;
	transition: opacity .25s;
}

.av-vprasalnik__hint[data-show="1"] { opacity: 1; }

.av-vprasalnik__spinner {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 2px solid var(--av-vprasalnik-accent-soft);
	border-top-color: var(--av-vprasalnik-accent);
	animation: avVprasalnikSpin .8s linear infinite;
}

@keyframes avVprasalnikSpin { to { transform: rotate(360deg); } }

/* ── steps ────────────────────────────────────────────── */

.av-vprasalnik__form {
	position: relative;
	min-height: 380px;
}

.av-vprasalnik__step {
	display: none;
	background: var(--av-vprasalnik-bg);
	border: 1px solid var(--av-vprasalnik-border);
	border-radius: var(--av-vprasalnik-radius);
	box-shadow: var(--av-vprasalnik-shadow);
	padding: 36px 32px;
}

.av-vprasalnik__step.is-active { display: block; animation: avVprasalnikSwipeIn .45s cubic-bezier(.22, 1, .36, 1); }
.av-vprasalnik__step.is-leaving { animation: avVprasalnikSwipeOut .35s cubic-bezier(.55, .055, .675, .19) forwards; }
.av-vprasalnik__step.is-leaving-back { animation: avVprasalnikSwipeOutBack .35s cubic-bezier(.55, .055, .675, .19) forwards; }
.av-vprasalnik__step.is-active-back { animation: avVprasalnikSwipeInBack .45s cubic-bezier(.22, 1, .36, 1); }

@keyframes avVprasalnikSwipeIn      { from { opacity:0; transform: translateX( 32px); } to { opacity:1; transform: translateX(0); } }
@keyframes avVprasalnikSwipeOut     { from { opacity:1; transform: translateX(0); }    to { opacity:0; transform: translateX(-32px); } }
@keyframes avVprasalnikSwipeInBack  { from { opacity:0; transform: translateX(-32px); } to { opacity:1; transform: translateX(0); } }
@keyframes avVprasalnikSwipeOutBack { from { opacity:1; transform: translateX(0); }    to { opacity:0; transform: translateX( 32px); } }

@keyframes avVprasalnikShake {
	0%, 100% { transform: translateX(0); }
	20%, 60% { transform: translateX(-6px); }
	40%, 80% { transform: translateX(6px); }
}

.av-vprasalnik__step.is-error { animation: avVprasalnikShake .4s; }

/* Submit step is auto-triggered — no manual buttons needed. */
.av-vprasalnik__step--submit .av-vprasalnik__step-foot { display: none; }
.av-vprasalnik__step--submit.is-submit-error .av-vprasalnik__step-foot { display: flex; }

/* Three-dot loader for the "Pripravljamo vaša priporočila…" step. */
.av-vprasalnik__loader {
	display: flex;
	justify-content: center;
	gap: 10px;
	padding: 24px 0 8px;
}

.av-vprasalnik__loader span {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--av-vprasalnik-accent);
	opacity: .35;
	animation: avVprasalnikDot 1.2s ease-in-out infinite;
}

.av-vprasalnik__loader span:nth-child(2) { animation-delay: .15s; }
.av-vprasalnik__loader span:nth-child(3) { animation-delay: .3s; }

@keyframes avVprasalnikDot {
	0%, 80%, 100% { opacity: .35; transform: scale(1); }
	40%           { opacity: 1;   transform: scale(1.3); }
}

/* ── headers ──────────────────────────────────────────── */

.av-vprasalnik__step-head {
	margin-bottom: 24px;
}

.av-vprasalnik__step-title {
	font-size: 24px;
	line-height: 1.25;
	font-weight: 600;
	margin: 0 0 8px;
	color: var(--av-vprasalnik-ink);
}

.av-vprasalnik__step-help {
	margin: 0;
	color: var(--av-vprasalnik-muted);
	font-size: 15px;
	line-height: 1.5;
}

/* ── text/email/date inputs ───────────────────────────── */

.av-vprasalnik__field-label {
	display: block;
	font-size: 15px;
	font-weight: 600;
	color: var(--av-vprasalnik-ink);
	margin: 0 0 8px;
}

.av-vprasalnik .av-vprasalnik__input {
	width: 100%;
	max-width: 100%;
	min-width: 0;             /* prevents iOS Safari date input from forcing wider intrinsic width */
	box-sizing: border-box;   /* padding + border counted inside width, so 100% never overflows */
	padding: 12px 15px;
	height: 42px;
	border: 1.5px solid var(--av-vprasalnik-border);
	border-radius: 8px;
	background: var(--av-vprasalnik-bg);
	color: var(--av-vprasalnik-ink);
	transition: border-color .2s, box-shadow .2s;
	font-family: inherit;
}

/* iOS Safari renders date inputs with extra internal toolbars + a hidden
   "dd. mm. llll" mask that pushes content past the right edge inside flex
   containers. The combo below tames both. */
.av-vprasalnik .av-vprasalnik__input[type="date"] {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	line-height: 1.2;
}

.av-vprasalnik .av-vprasalnik__input:focus {
	outline: none;
	border-color: var(--av-vprasalnik-accent);
	box-shadow: 0 0 0 4px var(--av-vprasalnik-accent-soft);
}

/* ── radio/checkbox ───────────────────────────────────── */

.av-vprasalnik__choices {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.av-vprasalnik__choice {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
	border: 1.5px solid var(--av-vprasalnik-border);
	border-radius: 12px;
	background: var(--av-vprasalnik-bg);
	cursor: pointer;
	transition: border-color .15s, background .15s, transform .1s;
	user-select: none;
}

.av-vprasalnik__choice:hover {
	border-color: var(--av-vprasalnik-accent);
	background: var(--av-vprasalnik-accent-soft);
}

.av-vprasalnik__choice:active { transform: scale(.99); }

/* Custom radio/checkbox — matches Avemed checkout styling.
   appearance:none kills browser's accent-color render (dark inner dot)
   and lets us paint our own clean ring + center. */
.av-vprasalnik__choice input[type="radio"],
.av-vprasalnik__choice input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	margin: 0;
	border: 2px solid rgba(0, 0, 0, .15);
	background: #fff;
	cursor: pointer;
	position: relative;
	flex-shrink: 0;
	transition: border-color .15s, background .15s;
}

.av-vprasalnik__choice input[type="radio"] {
	border-radius: 50%;
}

.av-vprasalnik__choice input[type="checkbox"] {
	border-radius: 4px;
}

.av-vprasalnik__choice input[type="radio"]:checked,
.av-vprasalnik__choice input[type="checkbox"]:checked {
	border-color: var(--av-vprasalnik-accent);
}

.av-vprasalnik__choice input[type="radio"]:checked::after {
	content: '';
	position: absolute;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	width: 10px; height: 10px;
	border-radius: 50%;
	background: var(--av-vprasalnik-accent);
}

.av-vprasalnik__choice input[type="checkbox"]:checked {
	background: var(--av-vprasalnik-accent);
}

.av-vprasalnik__choice input[type="checkbox"]:checked::after {
	content: '';
	position: absolute;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%) rotate(45deg);
	width: 5px; height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
}

.av-vprasalnik__choice input:checked + .av-vprasalnik__choice-label,
.av-vprasalnik__choice.is-checked .av-vprasalnik__choice-label { font-weight: 600; }

.av-vprasalnik__choice.is-checked {
	border-color: var(--av-vprasalnik-accent);
	background: var(--av-vprasalnik-accent-soft);
}

.av-vprasalnik__choice.is-hidden { display: none; }

.av-vprasalnik__choice-label { flex: 1; line-height: 1; }

/* ── consent ──────────────────────────────────────────── */

.av-vprasalnik__consents {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.av-vprasalnik__consent {
	display: grid;
	grid-template-columns: 22px 1fr;
	gap: 12px;
	align-items: start;
	padding: 14px;
	background: var(--av-vprasalnik-bg-soft);
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1.4;
}

.av-vprasalnik__consent input {
	width: 18px;
	height: 18px;
	margin: 0px;
	accent-color: var(--av-vprasalnik-accent);
}

.av-vprasalnik__consent.is-required { border-left: 3px solid var(--av-vprasalnik-accent); }

.av-vprasalnik__req {
	color: var(--av-vprasalnik-error);
	font-weight: 700;
}

.av-vprasalnik__consent a { color: var(--av-vprasalnik-accent); text-decoration: underline; }

/* ── footer / buttons ─────────────────────────────────── */

.av-vprasalnik__step-foot {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-top: 28px;
}

.av-vprasalnik__btn {
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	padding: 12px 24px;
	border-radius: 999px;
	border: 1.5px solid transparent;
	background: transparent;
	color: var(--av-vprasalnik-muted);
	cursor: pointer;
	transition: background .15s, color .15s, transform .1s, opacity .15s;
}

.av-vprasalnik__btn--primary {
	background: var(--av-vprasalnik-accent);
	color: #fff;
	margin-left: auto;
	min-width: 160px;
}

.av-vprasalnik__btn--primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.av-vprasalnik__btn--primary:active { transform: translateY(0); }
.av-vprasalnik__btn--primary[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.av-vprasalnik__btn--back:hover { color: var(--av-vprasalnik-ink); }

/* ── error message ────────────────────────────────────── */

.av-vprasalnik__error {
	margin: 12px 0 0;
	padding: 10px 14px;
	border-radius: 8px;
	background: rgba(197, 48, 48, .08);
	color: var(--av-vprasalnik-error);
	font-size: 14px;
}

/* ── thank-you / completed ────────────────────────────── */

.av-vprasalnik--completed {
	max-width: 1120px;
}

.av-vprasalnik__complete {
	background: var(--av-vprasalnik-bg);
	border-radius: 20px;
	box-shadow: 0 20px 60px rgba(15, 23, 42, .06);
	padding: 56px 48px;
	text-align: left;
	animation: avVprasalnikSwipeIn .5s cubic-bezier(.22, 1, .36, 1);
}

.av-vprasalnik__complete-greeting {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	border: 1.5px solid var(--av-vprasalnik-accent);
	color: var(--av-vprasalnik-accent);
	background: var(--av-vprasalnik-accent-soft);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	border-radius: 999px;
	margin-bottom: 20px;
}

.av-vprasalnik__complete-greeting::before {
	content: '';
	width: 6px; height: 6px;
	border-radius: 50%;
	background: var(--av-vprasalnik-accent);
}

.av-vprasalnik__complete h2 {
	font-size: 40px;
	line-height: 1.15;
	font-weight: 700;
	margin: 0 0 24px;
	color: var(--av-vprasalnik-ink);
}

.av-vprasalnik__complete h2 .av-vprasalnik__complete-name {
	color: var(--av-vprasalnik-accent);
}

.av-vprasalnik__complete-intro {
	max-width: 720px;
	color: var(--av-vprasalnik-muted);
	font-size: 16px;
	line-height: 1.7;
}

.av-vprasalnik__complete-intro p { margin: 0 0 14px; }

.av-vprasalnik__complete-divider {
	height: 1px;
	background: var(--av-vprasalnik-border);
	margin: 36px 0 32px;
	border: 0;
}

.av-vprasalnik__complete-section-title {
	font-size: 22px;
	font-weight: 700;
	color: var(--av-vprasalnik-ink);
	margin: 0 0 8px;
}

.av-vprasalnik__complete-section-lead {
	color: var(--av-vprasalnik-muted);
	font-size: 15px;
	line-height: 1.6;
	margin: 0 0 28px;
}

.av-vprasalnik__products-host {
	margin-top: 8px;
}

/* Tighten Flatsome ux_products inside our card */
.av-vprasalnik__products-host .row { margin-bottom: 0; }
.av-vprasalnik__products-host .products .product-small { margin-bottom: 0; }

.av-vprasalnik__why {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-top: 36px;
	padding: 22px 26px;
	background: var(--av-vprasalnik-bg-soft);
	border-radius: 14px;
	border: 1px solid var(--av-vprasalnik-border);
}

.av-vprasalnik__why-text {
	color: var(--av-vprasalnik-ink);
	font-weight: 600;
	font-size: 16px;
}

.av-vprasalnik__why-text small {
	display: block;
	color: var(--av-vprasalnik-muted);
	font-weight: 400;
	font-size: 13px;
	margin-top: 2px;
}

.av-vprasalnik__why-toggle {
	font-family: inherit;
	background: var(--av-vprasalnik-accent);
	color: #fff;
	border: 0;
	font-weight: 600;
	font-size: 14px;
	padding: 10px 22px;
	border-radius: 999px;
	cursor: pointer;
	transition: filter .15s, transform .1s;
}

.av-vprasalnik__why-toggle:hover { filter: brightness(1.05); transform: translateY(-1px); }

.av-vprasalnik__explanations {
	margin-top: 20px;
	display: none;
}

.av-vprasalnik__explanations[data-open="1"] { display: block; }

.av-vprasalnik__explanation {
	padding: 18px 22px;
	background: var(--av-vprasalnik-bg);
	border-left: 3px solid var(--av-vprasalnik-accent);
	border-radius: 10px;
	margin-bottom: 10px;
}

.av-vprasalnik__explanation strong { display: block; color: var(--av-vprasalnik-ink); font-size: 15px; }
.av-vprasalnik__explanation small  { color: var(--av-vprasalnik-muted); font-size: 13px; }

.av-vprasalnik__result-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 32px;
}

.av-vprasalnik__result-actions .av-vprasalnik__btn { margin: 0; }

.av-vprasalnik__result-actions .av-vprasalnik__btn--primary {
	min-width: 180px;
	text-align: center;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.av-vprasalnik--standalone {
	max-width: 1120px;
	padding-top: 60px;
	padding-bottom: 60px;
}

@media (max-width: 640px) {
	.av-vprasalnik__complete { padding: 32px 22px; border-radius: 14px; }
	.av-vprasalnik__complete h2 { font-size: 28px; }
	.av-vprasalnik__why { flex-direction: column; align-items: stretch; text-align: center; }
	.av-vprasalnik__result-actions .av-vprasalnik__btn { width: 100%; }
}

/* ── responsive ───────────────────────────────────────── */

@media (max-width: 640px) {
	.av-vprasalnik { padding: 16px 12px; }
	.av-vprasalnik__step { padding: 24px 18px; }
	.av-vprasalnik__step-title { font-size: 20px; }
	/* Stack Next on top, Back below — DOM order is [back, next] so column-reverse flips it. */
	.av-vprasalnik__step-foot {
		flex-direction: column-reverse;
		align-items: stretch;
		gap: 8px;
	}
	.av-vprasalnik__btn--primary { width: 100%; margin-left: 0; }
	.av-vprasalnik__btn--back { width: 100%; }
}
