/**
 * Hela Skincare Quiz - Premium Frontend Styles
 */

/* Container Setup */
.hsq-quiz-wrapper {
	position: relative;
	width: 100%;
	min-height: 80vh;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: var(--hsq-quiz-radius, 32px);
	font-family: inherit;
}

/* Backgrounds Layer */
.hsq-quiz-backgrounds {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
}

.hsq-bg-layer {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center center;
	opacity: 0;
	transition: opacity var(--hsq-speed) ease-in-out;
}

.hsq-bg-layer.hsq-active {
	opacity: 1; /* Note: inline data-bg-opacity will override this in JS */
}

/* Overlay Layer */
.hsq-quiz-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: var(--hsq-overlay, rgba(0,0,0,0.4));
	z-index: 2;
}

/* Content Container */
.hsq-quiz-container {
	position: relative;
	z-index: 3;
	width: 100%;
	max-width: var(--hsq-max-width, 600px);
	padding: var(--hsq-container-padding-v, 80px) var(--hsq-container-padding-h, 24px);
	color: var(--hsq-text, #fff);
	text-align: center;
}

/* Step Typography */
.hsq-quiz-wrapper .hsq-question-title {
    font-family: var(--hsq-title-font-family, inherit);
    font-size: var(--hsq-title-font-size, 32px);
    font-weight: var(--hsq-title-font-weight, 700);
    line-height: var(--hsq-title-line-height, 1.2);
    margin-bottom: var(--hsq-sp-title-prog, 20px);
    color: var(--hsq-text, #fff);
    text-shadow: var(--hsq-title-shadow, none);
}

/* Progress & Navigation */
.hsq-progress-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: var(--hsq-sp-prog-btns, 30px);
}

.hsq-progress-circles {
	display: flex;
	gap: var(--hsq-prog-spacing, 15px);
	align-items: center;
}

.hsq-progress-circle {
	width: var(--hsq-prog-size, 30px);
	height: var(--hsq-prog-size, 30px);
	border-radius: var(--hsq-prog-radius, 50%);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--hsq-ui-font-family, 'Jamonira', sans-serif);
	font-size: 0.8rem;
	font-weight: 600;
	transition: all 0.3s ease;
}

/* Inactive */
.hsq-prog-inactive {
	background: var(--hsq-prog-i-bg, transparent);
	color: var(--hsq-prog-i-text, #fff);
	border: var(--hsq-prog-i-border-w, 1px) solid var(--hsq-prog-i-border, rgba(255,255,255,0.65));
}

/* Active */
.hsq-prog-active {
	background: var(--hsq-prog-a-bg, #fff);
	color: var(--hsq-prog-a-text, #000);
	border: 1px solid var(--hsq-prog-a-border, #fff);
	transform: scale(1.15);
	box-shadow: 0 0 15px rgba(255,255,255,0.3);
}

/* Completed */
.hsq-prog-completed {
	background: var(--hsq-prog-c-bg, rgba(255,255,255,0.5));
	color: var(--hsq-prog-c-text, #fff);
	border: 1px solid var(--hsq-prog-c-border, rgba(255,255,255,0.8));
}

.hsq-step-nav {
	margin-top: 2rem;
	display: flex;
	justify-content: center;
}

.hsq-back-btn {
    display: inline-block;
    background: none;
    border: none;
    color: var(--hsq-back-color, #ffffff);
    font-family: var(--hsq-ui-font-family, inherit);
    font-size: var(--hsq-back-size, 16px);
    font-weight: var(--hsq-back-weight, 500);
    text-decoration: var(--hsq-back-underline, none);
    cursor: pointer;
    transition: opacity 0.3s ease;
    margin-top: var(--hsq-sp-btns-back, 24px);
    text-shadow: var(--hsq-back-shadow, none);
    opacity: 0.8;
}

.hsq-back-btn:hover {
	opacity: 1;
}

/* Answers Grid */
.hsq-answers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--hsq-sp-between-btns, 16px);
    margin-bottom: 1.5rem;
}

.hsq-answer-btn {
	background: var(--hsq-btn-bg, transparent);
	border: var(--hsq-btn-border-width, 1px) solid var(--hsq-btn-border, #fff);
	color: var(--hsq-btn-text, #fff);
	padding: 15px 25px;
	font-family: var(--hsq-ui-font-family, 'Jamonira', sans-serif);
	font-size: var(--hsq-ui-font-size, 18px);
	font-weight: var(--hsq-ui-font-weight, 400);
	line-height: var(--hsq-ui-line-height, 1.5);
	border-radius: var(--hsq-btn-radius, 14px);
	cursor: pointer;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	width: 100%;
	text-align: center;
	outline: none;
}

.hsq-answer-btn:hover {
	background: var(--hsq-btn-hover-bg, rgba(255,255,255,0.2));
	color: var(--hsq-btn-hover-text, #fff);
	border-color: var(--hsq-btn-hover-border, #fff);
	transform: scale(1.02);
}

.hsq-answer-btn:active, .hsq-answer-btn.hsq-selected {
	background: var(--hsq-btn-active-bg, rgba(255,255,255,0.25));
	color: var(--hsq-btn-active-text, #fff);
	border-color: var(--hsq-btn-active-border, #fff);
	transform: scale(0.98);
	box-shadow: inset 0 2px 5px rgba(0,0,0,0.15);
}

/* Email Capture Screen */
.hsq-ec-content {
	display: flex;
	flex-direction: column;
	max-width: var(--hsq-ec-max-width, 450px);
	margin: 0 auto;
	width: 100%;
	background: var(--hsq-ec-bg, rgba(255,255,255,0.1));
	padding: var(--hsq-ec-padding, 40px);
	border-radius: var(--hsq-ec-radius, 24px);
	box-sizing: border-box;
}

.hsq-ec-title {
	font-family: var(--hsq-ec-title-font, var(--hsq-title-font-family));
	font-size: var(--hsq-ec-title-size, 32px);
	font-weight: var(--hsq-ec-title-weight, 700);
	color: var(--hsq-ec-title-color, var(--hsq-text));
	margin-bottom: var(--hsq-ec-sp-title-desc, 12px);
	line-height: 1.2;
	text-shadow: var(--hsq-ec-title-shadow, none);
}

.hsq-ec-desc {
	font-family: var(--hsq-ec-desc-font, var(--hsq-ui-font-family));
	font-size: var(--hsq-ec-desc-size, 16px);
	font-weight: var(--hsq-ec-desc-weight, 400);
	color: var(--hsq-ec-desc-color, rgba(255,255,255,0.8));
	margin-bottom: var(--hsq-ec-sp-desc-fields, 30px);
	line-height: 1.5;
}

.hsq-ec-fields {
	display: flex;
	flex-direction: column;
	gap: 15px;
	margin-bottom: var(--hsq-ec-sp-fields-btn, 25px);
	width: 100%;
}

.hsq-ec-input {
	width: 100%;
	background: var(--hsq-ec-input-bg, rgba(255,255,255,0.1));
	border: var(--hsq-ec-input-border, 1px solid rgba(255,255,255,0.3));
	color: var(--hsq-ec-input-color, #fff);
	padding: var(--hsq-ec-input-padding, 15px);
	border-radius: var(--hsq-ec-input-radius, 8px);
	font-family: var(--hsq-ec-input-font, var(--hsq-ui-font-family));
	font-size: var(--hsq-ec-input-size, 16px);
	outline: none;
	transition: border-color 0.3s ease, background 0.3s ease;
	box-sizing: border-box;
}

.hsq-ec-input::placeholder {
	color: var(--hsq-ec-placeholder-color, #fff);
	opacity: 0.7;
}

.hsq-ec-input:focus {
	border-color: var(--hsq-ec-input-color, #fff);
	background: var(--hsq-ec-input-bg, rgba(255,255,255,0.1));
	filter: brightness(1.1);
}

.hsq-ec-error {
	color: #ff6b6b;
	font-size: 14px;
	text-align: left;
	margin-top: -5px;
	margin-bottom: 15px;
}

/* Marketing Consent Styles */
.hsq-ec-consent {
	margin-bottom: 24px;
	text-align: left;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.hsq-ec-checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	cursor: pointer;
	font-family: var(--hsq-ec-desc-font, var(--hsq-ui-font-family));
	font-size: 14px;
	line-height: 1.4;
	color: var(--hsq-ec-desc-color, rgba(255,255,255,0.9));
	transition: opacity 0.2s ease;
}

.hsq-ec-checkbox-label:hover {
	opacity: 0.8;
}

.hsq-ec-checkbox {
	width: 18px;
	height: 18px;
	margin-top: 2px;
	flex-shrink: 0;
	cursor: pointer;
	accent-color: var(--hsq-ec-btn-bg, #fff);
}

.hsq-ec-privacy {
	font-family: var(--hsq-ec-desc-font, var(--hsq-ui-font-family));
	font-size: 13px;
	opacity: 0.75;
	line-height: 1.4;
	padding-left: 30px; /* Align with text after checkbox */
}

.hsq-privacy-link {
	color: inherit;
	text-decoration: underline;
	font-weight: 600;
	transition: opacity 0.2s ease;
}

.hsq-privacy-link:hover {
	opacity: 0.6;
}

.hsq-ec-btn {
	width: 100%;
	background: var(--hsq-ec-btn-bg, #fff);
	color: var(--hsq-ec-btn-color, #000);
	border: var(--hsq-ec-btn-border, none);
	padding: var(--hsq-ec-btn-padding, 16px);
	border-radius: var(--hsq-ec-btn-radius, 8px);
	font-family: var(--hsq-ec-btn-font, var(--hsq-ui-font-family));
	font-size: var(--hsq-ec-btn-size, 18px);
	font-weight: var(--hsq-ec-btn-weight, 600);
	cursor: pointer;
	transition: transform 0.2s ease, background-color 0.3s ease, filter 0.3s ease;
}

.hsq-ec-btn:hover {
	background-color: var(--hsq-ec-btn-hover-bg, #f0f0f0);
	transform: scale(1.01);
}

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

.hsq-email-capture-screen .hsq-back-btn {
	margin-top: var(--hsq-back-margin, 15px);
}

/* Result Screen */
.hsq-result-content {
    background: transparent;
    padding: var(--hsq-res-padding-v, 40px) 20px;
    border-radius: var(--hsq-res-container-radius, 32px);
    color: var(--hsq-text, #ffffff);
    max-width: var(--hsq-res-max-width, 600px);
    margin: 0 auto;
    text-align: var(--hsq-res-align, center);
}

.hsq-result-title {
    font-family: var(--hsq-res-title-font, var(--hsq-title-font-family));
    font-size: var(--hsq-res-title-size, 32px);
    font-weight: var(--hsq-res-title-weight, 700);
    line-height: var(--hsq-res-title-lh, 1.2);
    color: var(--hsq-res-title-color, var(--hsq-text));
    margin-bottom: var(--hsq-res-sp-title, 16px);
    text-shadow: var(--hsq-res-title-shadow, none);
}

.hsq-result-description {
    font-family: var(--hsq-res-desc-font, var(--hsq-ui-font-family));
    font-size: var(--hsq-res-desc-size, 18px);
    font-weight: var(--hsq-res-desc-weight, 400);
    line-height: var(--hsq-res-desc-lh, 1.6);
    color: var(--hsq-res-desc-color, var(--hsq-text));
    margin-bottom: var(--hsq-res-sp-routine, 24px);
}

/* Personalized Summary Block */
.hsq-summary-block {
    background: rgba(255, 255, 255, 0.08); /* Premium subtle glass */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px; /* Smooth corners */
    padding: 20px 24px;
    margin-bottom: var(--hsq-res-sp-routine, 32px);
    display: flex;
    flex-direction: column;
    gap: var(--hsq-res-summary-spacing, 12px);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); /* Soft depth */
}

.hsq-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--hsq-res-desc-font, var(--hsq-ui-font-family));
    font-size: clamp(14px, 4vw, 16px); /* Responsive sizing */
    border-bottom: 1px solid rgba(255, 255, 255, 0.07); /* subtle separator */
    padding-bottom: var(--hsq-res-summary-spacing, 12px);
}

.hsq-summary-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hsq-summary-label {
    color: var(--hsq-res-summary-label-color, #dddddd);
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

.hsq-summary-value {
    color: var(--hsq-res-summary-value-color, #ffffff);
    font-weight: 600;
    text-align: right;
    max-width: 60%;
}


.hsq-spf-notice {
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	padding: 24px;
	margin-bottom: var(--hsq-res-sp-routine, 32px);
	border-radius: var(--hsq-res-container-radius, 32px);
	text-align: center;
	max-width: 100%;
	backdrop-filter: blur(5px);
	font-family: var(--hsq-res-desc-font, var(--hsq-ui-font-family));
	font-size: 16px;
	line-height: 1.5;
	color: var(--hsq-res-desc-color, var(--hsq-text));
}

/* Routines Display */
.hsq-routines-wrapper {
	text-align: left;
}

.hsq-routine-section {
    margin-bottom: var(--hsq-res-sp-actions, 40px);
}

.hsq-routine-segment {
	margin-bottom: var(--hsq-res-sp-routine, 2rem);
	background: rgba(255, 255, 255, 0.1);
	border-radius: var(--hsq-res-container-radius, 32px);
	padding: 20px;
	backdrop-filter: blur(10px);
}

.hsq-routine-segment h3 {
	font-size: 1.5rem;
	margin-top: 0;
	margin-bottom: 1.5rem;
	border-bottom: 1px solid rgba(255,255,255,0.2);
	padding-bottom: 10px;
	color: var(--hsq-text, #fff);
}

/* Products Grid */
.hsq-products-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 15px;
}

.hsq-product-card {
	background: #fff;
	color: #333;
	border-radius: var(--hsq-res-container-radius, 32px);
	padding: 10px;
	text-align: center;
	text-decoration: none;
	transition: transform 0.3s ease;
}

.hsq-product-card:hover {
	transform: translateY(-5px);
}

.hsq-product-card img {
	max-width: 100%;
	height: auto;
	margin-bottom: 10px;
	border-radius: var(--hsq-res-container-radius, 32px);
}

.hsq-product-title {
	font-size: 0.9rem;
	font-weight: 600;
	margin-bottom: 5px;
	display: block;
	color: #333;
}

.hsq-product-price {
	font-size: 0.85rem;
	color: #666;
}

/* Actions */
.hsq-result-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: var(--hsq-res-sp-actions, 40px);
}

.hsq-result-microcopy {
	font-family: var(--hsq-res-desc-font, var(--hsq-ui-font-family));
	font-size: 14px;
	opacity: 0.8;
	margin: 0;
	line-height: 1.4;
	text-align: center;
}

.hsq-btn-primary {
	background: var(--hsq-res-btn-bg, #000);
	color: var(--hsq-res-btn-color, #fff);
	border: var(--hsq-res-btn-border-w, 0) solid var(--hsq-res-btn-border, #000);
	padding: var(--hsq-res-btn-padding, 18px 40px);
	font-family: var(--hsq-res-btn-font, 'Jamonira', sans-serif);
	font-size: var(--hsq-res-btn-size, 1.2rem);
	font-weight: var(--hsq-res-btn-weight, 400);
	text-transform: uppercase;
	letter-spacing: 1px;
	border-radius: var(--hsq-res-btn-radius, 14px);
	cursor: pointer;
	transition: opacity 0.3s ease;
	width: 100%;
	max-width: 400px;
}

.hsq-btn-primary:hover {
	opacity: 0.8;
}

.hsq-btn-secondary {
	background: transparent;
	color: var(--hsq-res-rst-color, #fff);
	border: none;
	padding: 10px;
	font-size: var(--hsq-res-rst-size, 1rem);
	font-weight: var(--hsq-res-rst-weight, 400);
	text-shadow: var(--hsq-res-rst-shadow, none);
	cursor: pointer;
	text-decoration: underline;
	margin-top: var(--hsq-res-rst-margin, 20px);
}

/* Transitions & States */
.hsq-hidden {
	display: none !important;
}

@media (max-width: 600px) {
    .hsq-quiz-container {
        padding: 40px 15px;
    }

    .hsq-quiz-wrapper .hsq-question-title {
        font-size: var(--hsq-title-font-size-mobile, 24px);
    }
}

/* Animations */
@keyframes hsqSlideOutLeft {
    to { opacity: 0; transform: translateX(-30px); }
}
@keyframes hsqSlideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes hsqSlideOutRight {
    to { opacity: 0; transform: translateX(30px); }
}
@keyframes hsqSlideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.hsq-anim-out-left { animation: hsqSlideOutLeft 0.4s ease forwards !important; }
.hsq-anim-in-right { animation: hsqSlideInRight 0.5s ease forwards !important; }
.hsq-anim-out-right { animation: hsqSlideOutRight 0.4s ease forwards !important; }
.hsq-anim-in-left { animation: hsqSlideInLeft 0.5s ease forwards !important; }

/* Staggered buttons entrance */
.hsq-anim-in-right .hsq-answer-btn,
.hsq-anim-in-left .hsq-answer-btn {
    opacity: 0;
    animation: hsqSlideInRight 0.5s ease forwards;
}
.hsq-anim-in-right .hsq-answer-btn:nth-child(1), .hsq-anim-in-left .hsq-answer-btn:nth-child(1) { animation-delay: 0.05s; }
.hsq-anim-in-right .hsq-answer-btn:nth-child(2), .hsq-anim-in-left .hsq-answer-btn:nth-child(2) { animation-delay: 0.1s; }
.hsq-anim-in-right .hsq-answer-btn:nth-child(3), .hsq-anim-in-left .hsq-answer-btn:nth-child(3) { animation-delay: 0.15s; }
.hsq-anim-in-right .hsq-answer-btn:nth-child(4), .hsq-anim-in-left .hsq-answer-btn:nth-child(4) { animation-delay: 0.2s; }
.hsq-anim-in-right .hsq-answer-btn:nth-child(5), .hsq-anim-in-left .hsq-answer-btn:nth-child(5) { animation-delay: 0.25s; }
.hsq-anim-in-right .hsq-answer-btn:nth-child(6), .hsq-anim-in-left .hsq-answer-btn:nth-child(6) { animation-delay: 0.3s; }


/* Spinner */
.hsq-spinner {
	width: 50px;
	height: 50px;
	border: 3px solid rgba(255,255,255,0.3);
	border-radius: 50%;
	border-top-color: var(--hsq-text, #fff);
	animation: spin 1s ease-in-out infinite;
	margin: 0 auto 20px;
}

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

/* --- Theme Inherited Products (Grid 3 Columns) --- */
.hsq-theme-products {
	display: grid !important;
	grid-template-columns: repeat(3, 1fr) !important;
	gap: 24px !important;
	list-style: none !important;
	padding: 0 !important;
	margin: 30px 0 !important;
	width: 100% !important;
}

.hsq-theme-products li.product {
	width: 100% !important;
	margin: 0 !important;
	float: none !important;
	background: rgba(255, 255, 255, 0.05);
	border-radius: 12px;
	padding: 15px;
	transition: transform 0.3s ease;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	box-sizing: border-box;
}

.hsq-theme-products li.product:hover {
	transform: translateY(-5px);
	background: rgba(255, 255, 255, 0.08);
}

.hsq-theme-products li.product img {
	max-width: 100% !important;
	height: auto !important;
	margin-bottom: 15px !important;
	border-radius: 8px;
}

.hsq-theme-products li.product .woocommerce-loop-product__title {
	font-size: 1.1rem !important;
	margin: 10px 0 !important;
	color: var(--hsq-text, #fff) !important;
	font-family: inherit;
}

.hsq-theme-products li.product .price {
	font-weight: 600 !important;
	margin-bottom: 15px !important;
	color: var(--hsq-text, #fff) !important;
}

.hsq-theme-products li.product .button {
	margin-top: auto !important;
	width: 100% !important;
	background-color: var(--hsq-btn-bg, #000) !important;
	color: var(--hsq-btn-text, #fff) !important;
	border: 1px solid var(--hsq-btn-border, #fff) !important;
	border-radius: 30px !important;
	padding: 10px 20px !important;
	text-transform: uppercase;
	font-size: 0.85rem;
	letter-spacing: 1px;
	text-align: center;
	display: inline-block;
}

@media (max-width: 900px) {
	.hsq-theme-products {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

@media (max-width: 600px) {
	.hsq-theme-products {
		grid-template-columns: 1fr !important;
	}
}
