/*
 * RIKKA Experience Quiz - public styles.
 * Mobile-first, wellness aesthetic. All colors, radii and fonts come from the
 * CSS custom properties set inline on the .rikka-quiz root (from settings).
 */

.rikka-quiz {
	/* Sensible fallbacks; the inline style on the root overrides these. */
	--rikka-bg: #f6f1ea;
	--rikka-card: #ffffff;
	--rikka-accent: #b98a5e;
	--rikka-secondary: #8a9a82;
	--rikka-text: #3a332c;
	--rikka-muted: #8c8377;
	--rikka-radius: 20px;
	--rikka-font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--rikka-font-heading: Georgia, "Times New Roman", serif;

	box-sizing: border-box;
	max-width: 520px;
	margin: 0 auto;
	padding: 24px 18px 36px;
	background: var(--rikka-bg);
	color: var(--rikka-text);
	font-family: var(--rikka-font-ui);
	font-size: 16px;
	line-height: 1.5;
	border-radius: var(--rikka-radius);
	-webkit-font-smoothing: antialiased;
}

.rikka-quiz *,
.rikka-quiz *::before,
.rikka-quiz *::after {
	box-sizing: border-box;
}

.rikka-quiz__inner {
	position: relative;
}

/* Progress dots ------------------------------------------------------ */
.rikka-quiz__progress {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin-bottom: 22px;
}

.rikka-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.12);
	transition: background 0.3s ease, transform 0.3s ease;
}

.rikka-dot.is-done {
	background: var(--rikka-secondary);
}

.rikka-dot.is-current {
	background: var(--rikka-accent);
	transform: scale(1.4);
}

/* Stage and screen transitions -------------------------------------- */
.rikka-quiz__stage {
	position: relative;
}

.rikka-screen {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 0.45s ease, transform 0.45s ease;
}

.rikka-screen.is-active {
	opacity: 1;
	transform: none;
}

.rikka-screen.is-leaving {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	opacity: 0;
	transform: translateY(-14px);
	pointer-events: none;
}

/* Intro -------------------------------------------------------------- */
.rikka-intro {
	text-align: center;
	padding: 28px 8px 12px;
}

.rikka-intro__mark {
	font-family: var(--rikka-font-heading);
	letter-spacing: 0.42em;
	font-size: 13px;
	color: var(--rikka-accent);
	margin-bottom: 28px;
	text-indent: 0.42em;
}

.rikka-intro__logo {
	display: block;
	width: auto;
	max-width: 200px;
	max-height: 56px;
	height: auto;
	margin: 0 auto 30px;
	object-fit: contain;
}

@media (min-width: 600px) {
	.rikka-intro__logo {
		max-width: 240px;
		max-height: 64px;
	}
}

.rikka-intro__title {
	font-family: var(--rikka-font-heading);
	font-size: 27px;
	line-height: 1.25;
	font-weight: 600;
	margin: 0 0 14px;
	color: var(--rikka-text);
}

.rikka-intro__subtitle {
	color: var(--rikka-muted);
	font-size: 16px;
	margin: 0 auto 30px;
	max-width: 30ch;
}

/* Questions ---------------------------------------------------------- */
.rikka-question__step {
	text-align: center;
	color: var(--rikka-muted);
	font-size: 13px;
	letter-spacing: 0.08em;
	margin: 0 0 10px;
}

.rikka-question__title {
	font-family: var(--rikka-font-heading);
	font-size: 23px;
	line-height: 1.3;
	font-weight: 600;
	text-align: center;
	margin: 0 0 8px;
}

.rikka-question__hint {
	text-align: center;
	color: var(--rikka-muted);
	font-size: 14px;
	margin: 0 0 18px;
}

.rikka-options {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 22px 0 26px;
}

/* Options ------------------------------------------------------------ */
.rikka-option {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	min-height: 60px;
	padding: 14px 18px;
	text-align: left;
	background: var(--rikka-card);
	border: 1.5px solid rgba(0, 0, 0, 0.06);
	border-radius: calc(var(--rikka-radius) * 0.8);
	color: var(--rikka-text);
	font-family: inherit;
	font-size: 16px;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(58, 51, 44, 0.05);
	transition: border-color 0.25s ease, box-shadow 0.25s ease,
		transform 0.15s ease, background 0.25s ease;
}

.rikka-option:hover {
	border-color: var(--rikka-secondary);
}

.rikka-option:active {
	transform: scale(0.99);
}

.rikka-option.is-selected {
	border-color: var(--rikka-accent);
	box-shadow: 0 4px 18px rgba(185, 138, 94, 0.22);
	background: #fff;
}

.rikka-option__icon {
	flex: 0 0 auto;
	font-size: 22px;
	line-height: 1;
}

.rikka-option__label {
	flex: 1 1 auto;
}

.rikka-option__check {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border-radius: 6px;
	border: 1.5px solid rgba(0, 0, 0, 0.18);
	position: relative;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.rikka-option.is-selected .rikka-option__check {
	background: var(--rikka-accent);
	border-color: var(--rikka-accent);
}

.rikka-option.is-selected .rikka-option__check::after {
	content: "";
	position: absolute;
	left: 7px;
	top: 3px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* Navigation row ----------------------------------------------------- */
.rikka-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
}

.rikka-nav .rikka-btn--primary {
	margin-left: auto;
}

/* Buttons ------------------------------------------------------------ */
.rikka-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 14px 26px;
	border: none;
	border-radius: 999px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.25s ease,
		background 0.25s ease, opacity 0.2s ease;
}

.rikka-btn:active {
	transform: translateY(1px);
}

.rikka-btn--primary {
	background: var(--rikka-accent);
	color: #fff;
	box-shadow: 0 6px 18px rgba(185, 138, 94, 0.32);
}

.rikka-btn--primary:hover {
	box-shadow: 0 8px 22px rgba(185, 138, 94, 0.4);
}

.rikka-btn--primary[disabled] {
	opacity: 0.45;
	cursor: not-allowed;
	box-shadow: none;
}

.rikka-btn--secondary {
	background: transparent;
	color: var(--rikka-text);
	border: 1.5px solid var(--rikka-secondary);
}

.rikka-btn--secondary:hover {
	background: rgba(138, 154, 130, 0.12);
}

.rikka-btn--ghost {
	background: transparent;
	color: var(--rikka-muted);
	min-height: 44px;
	padding: 10px 18px;
}

.rikka-btn--ghost:hover {
	color: var(--rikka-text);
}

/* Result ------------------------------------------------------------- */
.rikka-result {
	padding-top: 6px;
}

.rikka-result__heading {
	text-align: center;
	font-size: 16px;
	color: var(--rikka-muted);
	margin: 0 0 18px;
}

.rikka-card {
	background: var(--rikka-card);
	border-radius: var(--rikka-radius);
	padding: 22px 22px 24px;
	box-shadow: 0 10px 30px rgba(58, 51, 44, 0.08);
	margin-bottom: 22px;
}

.rikka-card__media {
	margin: -22px -22px 18px;
	border-radius: var(--rikka-radius) var(--rikka-radius) 0 0;
	overflow: hidden;
	aspect-ratio: 16 / 10;
}

.rikka-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rikka-card__title {
	font-family: var(--rikka-font-heading);
	font-size: 22px;
	letter-spacing: 0.02em;
	margin: 0 0 8px;
}

.rikka-card__subtitle {
	color: var(--rikka-muted);
	margin: 0 0 18px;
}

.rikka-card__includes {
	margin: 0 0 18px;
}

.rikka-card__includes-label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
}

.rikka-card__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.rikka-card__item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 5px 0;
}

.rikka-card__tick {
	color: var(--rikka-secondary);
	font-weight: 700;
	flex: 0 0 auto;
}

.rikka-card__price {
	font-size: 18px;
	margin: 0 0 20px;
}

.rikka-card__price-label {
	color: var(--rikka-muted);
}

.rikka-card__price-value {
	font-weight: 700;
}

.rikka-card__cta {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.rikka-card__cta .rikka-btn {
	width: 100%;
}

/* Alternative -------------------------------------------------------- */
.rikka-alt {
	margin-bottom: 22px;
}

.rikka-alt__heading {
	text-align: center;
	color: var(--rikka-muted);
	font-size: 15px;
	margin: 0 0 12px;
}

.rikka-card--alt {
	box-shadow: 0 6px 20px rgba(58, 51, 44, 0.06);
	text-align: center;
}

.rikka-card--alt .rikka-card__title {
	margin-bottom: 14px;
}

.rikka-alt__details {
	margin-top: 16px;
	text-align: left;
}

.rikka-alt__details .rikka-btn {
	width: 100%;
	margin-top: 8px;
}

/* Fallback ----------------------------------------------------------- */
.rikka-result--fallback {
	text-align: center;
}

.rikka-fallback__title {
	font-family: var(--rikka-font-heading);
	font-size: 23px;
	margin: 10px 0 12px;
}

.rikka-fallback__text {
	color: var(--rikka-muted);
	margin: 0 auto 24px;
	max-width: 32ch;
}

.rikka-result--fallback .rikka-manager,
.rikka-result--fallback > .rikka-btn--secondary {
	display: inline-flex;
	margin: 0 auto;
}

/* Manager form (mode B) --------------------------------------------- */
.rikka-manager {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.rikka-manager__form {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 4px;
	animation: rikka-fade 0.3s ease;
}

.rikka-input {
	width: 100%;
	min-height: 50px;
	padding: 12px 16px;
	border: 1.5px solid rgba(0, 0, 0, 0.12);
	border-radius: calc(var(--rikka-radius) * 0.7);
	font-family: inherit;
	font-size: 16px;
	color: var(--rikka-text);
	background: #fff;
}

.rikka-input:focus {
	outline: none;
	border-color: var(--rikka-accent);
}

.rikka-manager__note {
	margin: 4px 0 0;
	font-size: 14px;
}

.rikka-manager__note.is-success {
	color: var(--rikka-secondary);
}

.rikka-manager__note.is-error {
	color: #b4533f;
}

.rikka-result__restart {
	display: block;
	margin: 6px auto 0;
}

.rikka-noscript {
	text-align: center;
	color: var(--rikka-muted);
	padding: 20px;
}

@keyframes rikka-fade {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Wider screens: a touch more breathing room. ----------------------- */
@media (min-width: 600px) {
	.rikka-quiz {
		padding: 32px 28px 44px;
	}

	.rikka-intro__title {
		font-size: 31px;
	}
}

/* Respect reduced-motion preferences. ------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.rikka-screen,
	.rikka-dot,
	.rikka-option,
	.rikka-btn {
		transition: none;
	}

	.rikka-manager__form {
		animation: none;
	}
}
