/**
 * Plain-form presentation for chatbot flows.
 *
 * Borrows the card the price calculator already uses — same white panel,
 * 24px radius, fluid padding and green uppercase legends — so a form dropped
 * onto a page sits beside the laskuri without looking like a different
 * product. Tokens are redeclared rather than imported because laskuri.css is
 * only enqueued on pages that use the calculator.
 */

.stcb-plain {
	--stcb-green: #507f41;
	--stcb-dark: #2c2c2c;
	--stcb-line: rgba(44, 44, 44, 0.18);
	--stcb-bg: #fff;
	--stcb-muted: rgba(44, 44, 44, 0.7);

	background: var(--stcb-bg);
	border-radius: 24px;
	padding: clamp(1.5rem, 4vw, 3rem);
	color: var(--stcb-dark);
	max-width: 780px;
}

.stcb-plain__title {
	margin: 0 0 2rem;
}

/* --- layout ----------------------------------------------------------- */

/* Two columns so short answers pair up instead of stacking into a long
   ribbon. Fields opt in with .is-half; everything else spans both. */
.stcb-plain__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.25rem;
	align-items: start;
}

.stcb-plain__field {
	grid-column: 1 / -1;
	min-width: 0;
}

.stcb-plain__field.is-half {
	grid-column: span 1;
}

@media (max-width: 600px) {
	.stcb-plain__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.stcb-plain__field.is-half {
		grid-column: 1 / -1;
	}
}

/* A hidden conditional field must leave the grid entirely, or it still
   occupies a track and opens a gap in the layout. */
.stcb-plain__field[hidden] {
	display: none !important;
}

.stcb-plain__optional {
	margin: 2.25rem 0 0;
	padding-top: 1.75rem;
	border-top: 1px solid var(--stcb-line);
}

/* --- labels and inputs ------------------------------------------------ */

/* Larger than the laskuri's 12px legend: that one labels a single option
   group, this divides the form in two. Sentence case rather than the laskuri's
   uppercase — at 26px it reads as a heading, and caps at that size shout.
   Tracking goes with it; letter-spacing exists to open up uppercase.
   Fluid between 16px and 26px, hitting 26px at 1920px and holding there. */
.stcb-plain__legend {
	color: var(--stcb-green);
	font-size: clamp(1rem, 0.716rem + 0.758vi, 1.625rem);
	margin: 0 0 0.75rem;
	padding: 0;
}

.stcb-plain__label {
	display: block;
	font-size: 13px;
	margin-bottom: 4px;
}

.stcb-plain__input {
	width: 100%;
	border: 1px solid var(--stcb-line);
	border-radius: 8px;
	padding: 10px 12px;
	background: #fff;
	color: inherit;
	font: inherit;
}

.stcb-plain__input:focus-visible {
	border-color: var(--stcb-green);
	outline: 2px solid var(--stcb-green);
	outline-offset: 1px;
}

textarea.stcb-plain__input {
	resize: vertical;
}

.stcb-plain__choices {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.stcb-plain__choice {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 10px 14px;
	border: 1px solid var(--stcb-line);
	border-radius: 8px;
	font-size: 13px;
	cursor: pointer;
}

.stcb-plain__choice:has(input:checked) {
	border-color: var(--stcb-green);
	box-shadow: inset 0 0 0 1px var(--stcb-green);
}

.stcb-plain__consent {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	font-size: 12px;
	line-height: 1.4;
	margin: 1.75rem 0 1rem;
	cursor: pointer;
}

.stcb-plain__hint {
	margin: 0.4rem 0 0;
	font-size: 13px;
	color: var(--stcb-muted);
}

.stcb-plain__optional > .stcb-plain__hint {
	margin: 0 0 1.5rem;
}

/* --- feedback --------------------------------------------------------- */

.stcb-plain__error {
	margin: 0.35rem 0 0;
	font-size: 13px;
	color: #b3261e;
}

.stcb-plain__field.is-invalid .stcb-plain__input {
	border-color: #b3261e;
}

.stcb-plain__status {
	margin: 0 0 1rem;
	font-size: 13px;
	color: var(--stcb-muted);
}

.stcb-plain__status:empty {
	display: none;
}

/* --- submit ----------------------------------------------------------- */

/* Matches the theme's .button.green — see the note in chatbot.css. */
.stcb-plain__submit {
	background-color: #507f41;
	border: 1px solid #507f41;
	border-radius: 28px;
	color: #f3f0ee;
	cursor: pointer;
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 1px;
	padding: 12px 20px;
	text-transform: uppercase;
	transition: all ease-in-out 300ms;
}

.stcb-plain__submit:hover,
.stcb-plain__submit:focus-visible {
	background-color: #37592c;
	color: #f3f0ee;
}

.stcb-plain__submit[disabled] {
	opacity: 0.6;
	cursor: progress;
}

/* --- done ------------------------------------------------------------- */

.stcb-plain__downloads {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 1.5rem 0 0;
}

/* Same pill as the send button, but these are links with full sentences for
   labels, so they wrap instead of forcing the card wider. */
.stcb-plain__download {
	display: inline-block;
	text-align: center;
	text-decoration: none;
	max-width: 100%;
}

.stcb-plain__download:hover,
.stcb-plain__download:focus-visible {
	color: #f3f0ee;
}

.stcb-plain__done:focus {
	outline: none;
}

/* Off-screen rather than display:none — a bot that skips hidden inputs would
   otherwise sail past the honeypot. */
.stcb-plain__hp {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
