/* CIRES Survey — lightweight Typeform-style single-question frontend.
   Self-contained: this page never loads the theme's stylesheet, so brand
   colors are inlined here rather than relying on the theme's CSS variables. */

:root {
	--cs-primary: #003975;      /* cires-color-primary / cires-blue-7 */
	--cs-primary-dark: #002246; /* cires-blue-9 */
	--cs-tint: #e6ecf1;         /* cires-blue-0 */
	--cs-border: #9CB4CC;       /* cires-color-border-footer */
	--cs-text: #2B2B2B;
	--cs-error: #C0392B;
	--cs-bg: #ffffff;
}

* {
	box-sizing: border-box;
}

html, body {
	margin: 0;
	padding: 0;
	height: 100%;
	background: var(--cs-bg);
	color: var(--cs-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.cs-app {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* ─── Progress bar ─────────────────────────────────────────────── */

.cs-progress {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: var(--cs-tint);
	z-index: 10;
}

.cs-progress__fill {
	height: 100%;
	width: 0%;
	background: var(--cs-primary);
	transition: width 0.3s ease;
}

/* ─── Header / logo ─────────────────────────────────────────────── */

.cs-header {
	display: flex;
	justify-content: center;
	padding: 28px 16px 8px;
}

.cs-logo {
	max-height: 40px;
	max-width: 220px;
	object-fit: contain;
	/* The site's custom_logo is a white PNG meant for a dark/transparent
	   header — same filter the theme applies (style.css: ".site-header
	   .custom-logo") to turn it navy for display on a white background,
	   which is what this standalone page always has. */
	filter: brightness(0) saturate(100%) invert(17%) sepia(97%) saturate(1694%) hue-rotate(196deg) brightness(49%) contrast(106%);
}

.cs-logo--text {
	font-weight: 700;
	font-size: 18px;
	color: var(--cs-primary);
	letter-spacing: 0.02em;
}

/* ─── Main / question stage ─────────────────────────────────────── */

.cs-main {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 20px 60px;
}

.cs-screen {
	width: 100%;
	max-width: 640px;
	animation: cs-fade-in 0.35s ease;
}

@keyframes cs-fade-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

.cs-eyebrow {
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--cs-primary);
	margin: 0 0 10px;
}

.cs-title {
	font-size: 28px;
	line-height: 1.3;
	font-weight: 700;
	margin: 0 0 12px;
	color: var(--cs-text);
}

.cs-welcome .cs-title {
	font-size: 32px;
}

.cs-description {
	font-size: 16px;
	color: #555;
	margin: 0 0 24px;
}

.cs-required-mark {
	color: var(--cs-primary);
}

.cs-preset-banner {
	display: inline-block;
	font-size: 13px;
	font-weight: 600;
	color: var(--cs-primary);
	background: var(--cs-tint);
	padding: 6px 14px;
	border-radius: 999px;
	margin: 0 0 16px;
}

/* ─── Inputs ────────────────────────────────────────────────────── */

.cs-text-input {
	width: 100%;
	font-size: 20px;
	padding: 12px 4px;
	border: none;
	border-bottom: 2px solid var(--cs-border);
	background: transparent;
	color: var(--cs-text);
	outline: none;
	transition: border-color 0.2s;
}

.cs-text-input:focus {
	border-bottom-color: var(--cs-primary);
}

/* short_text uses a <textarea>, not <input>, specifically because a
   placeholder inside an <input> never wraps — on a narrow phone a longer
   placeholder (e.g. "Tuliskan saran, hal, atau fasilitas yang perlu
   ditingkatkan...") would just get clipped with no way to read the rest. */
.cs-textarea {
	display: block;
	width: 100%;
	font-family: inherit;
	font-size: 18px;
	line-height: 1.5;
	padding: 14px 16px;
	border: 2px solid var(--cs-border);
	border-radius: 10px;
	background: var(--cs-bg);
	color: var(--cs-text);
	outline: none;
	resize: none;
	min-height: 96px;
	max-height: 240px;
	overflow-y: auto;
	transition: border-color 0.2s;
}

.cs-textarea:focus {
	border-color: var(--cs-primary);
}

.cs-autocomplete {
	position: relative;
}

.cs-autocomplete__list {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	margin: 4px 0 0;
	padding: 6px 0;
	list-style: none;
	background: var(--cs-bg);
	border: 1px solid var(--cs-border);
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0, 34, 70, 0.12);
	max-height: 260px;
	overflow-y: auto;
	z-index: 5;
	display: none;
}

.cs-autocomplete__list.is-open {
	display: block;
}

.cs-autocomplete__item {
	padding: 10px 16px;
	font-size: 16px;
	cursor: pointer;
}

.cs-autocomplete__item:hover,
.cs-autocomplete__item.is-active {
	background: var(--cs-tint);
	color: var(--cs-primary);
}

.cs-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 8px;
}

/* ─── NPS scale ─────────────────────────────────────────────────── */

.cs-nps-scale {
	display: flex;
	flex-wrap: nowrap;   /* always one row, even on the smallest phones — buttons shrink instead */
	gap: 8px;
	margin-bottom: 8px;
}

.cs-nps-btn {
	appearance: none;
	flex: 1 1 0;
	min-width: 0;   /* let flex shrink buttons below their content size to fit 11-in-a-row */
	height: 48px;
	padding: 0;     /* no horizontal padding — width is already tight on mobile */
	border: 2px solid var(--cs-border);
	border-radius: 8px;
	background: var(--cs-bg);
	color: var(--cs-text);
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.cs-nps-btn:hover {
	border-color: var(--cs-primary);
	background: var(--cs-tint);
}

.cs-nps-btn.is-selected {
	border-color: var(--cs-primary);
	background: var(--cs-primary);
	color: #fff;
}

.cs-nps-labels {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
	color: #888;
}

.cs-option {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	border: 2px solid var(--cs-border);
	border-radius: 10px;
	cursor: pointer;
	font-size: 16px;
	transition: border-color 0.15s, background 0.15s;
	background: var(--cs-bg);
}

.cs-option:hover {
	border-color: var(--cs-primary);
	background: var(--cs-tint);
}

.cs-option.is-selected {
	border-color: var(--cs-primary);
	background: var(--cs-tint);
}

.cs-option__badge {
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	border-radius: 6px;
	border: 2px solid var(--cs-border);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	color: #777;
}

.cs-option.is-selected .cs-option__badge {
	border-color: var(--cs-primary);
	background: var(--cs-primary);
	color: #fff;
}

.cs-option__label {
	flex: 1;
}

.cs-option__other-input {
	margin-top: 8px;
	width: 100%;
	font-size: 15px;
	padding: 8px 10px;
	border: 2px solid var(--cs-border);
	border-radius: 8px;
	outline: none;
}

.cs-option__other-input:focus {
	border-color: var(--cs-primary);
}

/* ─── Actions / buttons ─────────────────────────────────────────── */

.cs-actions {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: 24px;
}

.cs-actions--center {
	justify-content: center;
}

.cs-btn {
	display: inline-block;
	appearance: none;
	border: none;
	border-radius: 8px;
	padding: 13px 28px;
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	background: var(--cs-primary);
	color: #fff;
	transition: background 0.15s;
}

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

.cs-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.cs-btn-back {
	background: transparent;
	color: #777;
	padding: 13px 10px;
}

.cs-btn-back:hover {
	background: transparent;
	color: var(--cs-primary);
}

.cs-hint {
	font-size: 13px;
	color: #888;
}

.cs-error {
	color: var(--cs-error);
	font-size: 14px;
	margin-top: 10px;
	display: none;
}

.cs-error.is-visible {
	display: block;
}

/* ─── Closing / not-found ───────────────────────────────────────── */

.cs-closing,
.cs-notfound {
	text-align: center;
}

.cs-closing .cs-title {
	font-size: 30px;
}

.cs-checkmark {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--cs-primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	margin: 0 auto 20px;
}

/* ─── Mobile ────────────────────────────────────────────────────── */

@media (max-width: 480px) {
	.cs-title {
		font-size: 22px;
	}
	.cs-welcome .cs-title {
		font-size: 26px;
	}
	.cs-main {
		padding: 16px 16px 40px;
	}
	.cs-nps-scale {
		gap: 4px;
	}
	.cs-nps-btn {
		height: 40px;
		font-size: 13px;
		border-radius: 6px;
	}
	/* 16px is the floor, not lower — iOS Safari auto-zooms the page on
	   focus for any text input under 16px, which is worse than a slightly
	   tight fit. */
	.cs-text-input,
	.cs-textarea {
		font-size: 16px;
	}
	.cs-textarea {
		min-height: 84px;
	}
}
