/**
 * Telyqo Enquête - frontend styles.
 *
 * Thema-kleuren aanpassen? Wijzig de variabelen hieronder.
 */

.telyqo-survey {
	/* ==== Thema ==== */
	--tq-accent: #16a34a;        /* hoofdkleur (groen) */
	--tq-accent-dark: #15803d;   /* hover op knoppen */
	--tq-tint: #f0fdf4;          /* zachte groene tint (hover) */
	--tq-tint-strong: #dcfce7;   /* geselecteerde optie */
	--tq-text: #1f2328;
	--tq-text-soft: #6b7280;
	--tq-border: #e5e7eb;
	--tq-bg: #ffffff;
	--tq-radius: 12px;

	position: fixed;
	inset: 0;
	z-index: 99999;
	background: var(--tq-bg);
	color: var(--tq-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		"Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	line-height: 1.5;
}

.telyqo-survey *,
.telyqo-survey *::before,
.telyqo-survey *::after {
	box-sizing: border-box;
}

/* ==== Voortgang bovenin ==== */
.tq-topbar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	padding: 16px 20px;
	display: flex;
	align-items: center;
	gap: 14px;
	z-index: 2;
}

.tq-progress-track {
	flex: 1;
	height: 4px;
	border-radius: 2px;
	background: var(--tq-border);
	overflow: hidden;
}

.tq-progress-fill {
	height: 100%;
	width: 100%;
	border-radius: 2px;
	background: var(--tq-accent);
	/* Voortgang via scaleX (geen layout-animatie) */
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 300ms ease;
}

.tq-counter {
	font-size: 13px;
	font-weight: 500;
	color: var(--tq-text-soft);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* ==== Vraag-scherm ==== */
.tq-stage {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 72px 20px 96px;
	overflow-y: auto;
}

.tq-card {
	width: 100%;
	max-width: 620px;
}

/* Slide/fade-animatie tussen vragen */
.tq-card.tq-anim-in-next   { animation: tq-in-next 320ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.tq-card.tq-anim-in-prev   { animation: tq-in-prev 320ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.tq-card.tq-anim-out-next  { animation: tq-out-next 200ms ease both; }
.tq-card.tq-anim-out-prev  { animation: tq-out-prev 200ms ease both; }

@keyframes tq-in-next  { from { opacity: 0; transform: translateY(40px); }  to { opacity: 1; transform: none; } }
@keyframes tq-in-prev  { from { opacity: 0; transform: translateY(-40px); } to { opacity: 1; transform: none; } }
@keyframes tq-out-next { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-40px); } }
@keyframes tq-out-prev { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(40px); } }

/* Geen animaties voor wie dat liever niet heeft */
@media (prefers-reduced-motion: reduce) {
	.telyqo-survey * {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}

.tq-qnum {
	font-size: 14px;
	font-weight: 500;
	color: var(--tq-accent);
	margin-bottom: 10px;
}

.tq-question {
	font-size: clamp(22px, 4.5vw, 30px);
	font-weight: 600;
	letter-spacing: -0.01em;
	margin: 0 0 6px;
}

.tq-hint {
	font-size: 14px;
	color: var(--tq-text-soft);
	margin: 0 0 26px;
}

/* ==== Opties ==== */
.tq-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.tq-option {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 14px 16px;
	background: var(--tq-bg);
	border: 1px solid var(--tq-border);
	border-radius: var(--tq-radius);
	font-size: 16px;
	font-family: inherit;
	color: var(--tq-text);
	text-align: left;
	cursor: pointer;
	transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.tq-option:hover {
	background: var(--tq-tint);
	border-color: #bbf7d0;
}

.tq-option:focus-visible {
	outline: 2px solid var(--tq-accent);
	outline-offset: 2px;
}

.tq-option.is-selected {
	background: var(--tq-tint-strong);
	border-color: var(--tq-accent);
}

/* Sneltoets-badge (A, B, C… of 1, 2, 3…) */
.tq-key {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border: 1px solid var(--tq-border);
	border-radius: 6px;
	background: #fafafa;
	font-size: 12px;
	font-weight: 600;
	color: var(--tq-text-soft);
}

.tq-option.is-selected .tq-key {
	background: var(--tq-accent);
	border-color: var(--tq-accent);
	color: #fff;
}

/* Vinkje bij multiple choice */
.tq-check {
	margin-left: auto;
	color: var(--tq-accent);
	font-weight: 700;
	opacity: 0;
	transition: opacity 140ms ease;
}

.tq-option.is-selected .tq-check {
	opacity: 1;
}

/* ==== Open vraag ==== */
.tq-textarea {
	width: 100%;
	min-height: 110px;
	padding: 14px 16px;
	border: 1px solid var(--tq-border);
	border-radius: var(--tq-radius);
	background: var(--tq-bg);
	color: var(--tq-text);
	font-family: inherit;
	font-size: 16px;
	resize: vertical;
}

.tq-textarea:focus {
	outline: none;
	border-color: var(--tq-accent);
	box-shadow: 0 0 0 3px var(--tq-tint-strong);
}

/* ==== Navigatie onderin ==== */
.tq-nav {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 12px;
	background: linear-gradient(to top, var(--tq-bg) 65%, transparent);
	z-index: 2;
}

.tq-btn {
	appearance: none;
	border: none;
	border-radius: 10px;
	padding: 12px 26px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background 140ms ease, transform 100ms ease;
}

.tq-btn:active { transform: scale(0.98); }

.tq-btn-primary {
	background: var(--tq-accent);
	color: #fff;
}

.tq-btn-primary:hover { background: var(--tq-accent-dark); }

.tq-btn-primary:disabled {
	background: var(--tq-border);
	color: var(--tq-text-soft);
	cursor: not-allowed;
}

.tq-btn-back {
	background: transparent;
	color: var(--tq-text-soft);
	border: 1px solid var(--tq-border);
	padding: 12px 16px;
}

.tq-btn-back:hover { background: var(--tq-tint); }

.tq-enter-hint {
	font-size: 13px;
	color: var(--tq-text-soft);
}

@media (max-width: 640px) {
	.tq-enter-hint { display: none; }
}

/* ==== Eind-/blokkeer-scherm ==== */
.tq-done {
	text-align: center;
	max-width: 480px;
}

.tq-done-icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 20px;
	border-radius: 50%;
	background: var(--tq-tint-strong);
	color: var(--tq-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 30px;
}

.tq-done h2 {
	font-size: 26px;
	font-weight: 600;
	margin: 0 0 8px;
}

.tq-done p {
	color: var(--tq-text-soft);
	margin: 0;
}

.tq-error {
	margin-top: 14px;
	font-size: 14px;
	color: #dc2626;
}
