/**
 * CW Survey Form styles.
 * Everything is scoped to .cwsf; fonts are inherited from the theme.
 */

.cwsf {
	--cwsf-primary: #146a77;
	--cwsf-primary-hover: #000;
	--cwsf-primary-light: #cae9ec;
	--cwsf-gray-100: #f3f4f6;
	--cwsf-gray-200: #e5e7eb;
	--cwsf-gray-300: #d1d5db;
	--cwsf-error: #dc2626;

	padding: 2rem 1.25rem;
	background-color: #fff;
	border-radius: 0.25rem;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

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

.cwsf [hidden] {
	display: none !important;
}

.cwsf p {
	margin: 0;
}

/* Honeypot */
.cwsf .cwsf-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Question steps */
.cwsf-question {
	padding-bottom: 1.5rem;
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.333;
	text-align: center;
}

.cwsf-options {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
}

.cwsf-option {
	position: relative;
	display: block;
	max-width: 100%;
	margin: 0;
}

.cwsf-option input[type="radio"] {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.cwsf-option-label {
	position: relative;
	display: block;
	width: 16.875rem;
	max-width: 100%;
	padding: 0.75rem;
	border: 2px solid var(--cwsf-gray-200);
	border-radius: 9999px;
	background-color: var(--cwsf-gray-200);
	font-weight: 500;
	line-height: 1.5;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s;
}

@media (hover: hover) {
	.cwsf-option-label:hover {
		border-color: var(--cwsf-gray-300);
		background-color: var(--cwsf-gray-300);
	}
}

.cwsf-option input:checked + .cwsf-option-label {
	border-color: var(--cwsf-primary);
}

.cwsf-option input:focus-visible + .cwsf-option-label {
	outline: 2px solid var(--cwsf-primary);
	outline-offset: 2px;
}

.cwsf .cwsf-option-check {
	position: absolute;
	top: 50%;
	right: -0.75rem;
	display: none;
	width: 30px;
	max-width: none;
	height: 30px;
	transform: translateY(-50%);
}

.cwsf-option input:checked + .cwsf-option-label .cwsf-option-check {
	display: block;
}

/* Contact step */
.cwsf-title {
	padding-bottom: 0.5rem;
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.333;
	text-align: center;
}

.cwsf-subtitle,
.cwsf-lead {
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.555;
	text-align: center;
}

.cwsf-subtitle {
	padding-bottom: 1rem;
}

.cwsf-lead {
	padding: 2rem 0 1.5rem;
}

.cwsf .cwsf-success-icon {
	display: block;
	width: 5rem;
	height: auto;
	margin: 0 auto;
}

.cwsf-row {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-bottom: 1rem;
}

.cwsf-field--email {
	margin-bottom: 1.5rem;
}

.cwsf .cwsf-input {
	width: 100%;
	margin: 0;
	padding: 0.5rem 1rem;
	border: 1px solid var(--cwsf-gray-200);
	border-bottom-width: 2px;
	border-radius: 0.25rem 0.25rem 0 0;
	background-color: #fff;
	box-shadow: none;
	color: inherit;
	font: inherit;
	font-size: 1rem;
	line-height: 1.5;
}

.cwsf .cwsf-input:focus {
	border-color: var(--cwsf-gray-200);
	border-bottom-color: var(--cwsf-primary);
	background-color: #fff;
	color: inherit;
	outline: 0;
}

.cwsf .has-error .cwsf-input {
	border-bottom-color: var(--cwsf-error);
}

.cwsf .cwsf-error {
	margin-top: 0.25rem;
	color: var(--cwsf-error);
	font-size: 0.9em;
}

.cwsf .has-error label {
	color: var(--cwsf-error);
}

.cwsf-consents {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	font-size: 0.8em;
}

.cwsf-consent {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
}

.cwsf-consent input[type="checkbox"] {
	flex: 0 0 auto;
	margin: 0;
}

.cwsf-consent label {
	margin: 0;
	cursor: pointer;
}

/* Consent tooltips */
.cwsf-tooltip {
	position: relative;
	display: inline-block;
	font-weight: 600;
	text-decoration: underline;
	cursor: help;
}

.cwsf-tooltip-text {
	position: absolute;
	bottom: 125%;
	left: 50%;
	z-index: 10;
	width: 180px;
	margin-left: -90px;
	padding: 0.5rem 0.3rem;
	border-radius: 8px;
	background-color: #000;
	color: #fff;
	font-weight: 400;
	line-height: 1.35;
	text-align: center;
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.3s;
}

.cwsf-tooltip-text::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	margin-left: -5px;
	border-width: 5px;
	border-style: solid;
	border-color: #000 transparent transparent transparent;
}

.cwsf-tooltip:hover .cwsf-tooltip-text,
.cwsf-tooltip:focus .cwsf-tooltip-text {
	visibility: visible;
	opacity: 1;
}

/* Status */
.cwsf-spinner {
	display: flex;
	justify-content: center;
	padding: 1.5rem 0;
}

.cwsf-spinner::after {
	content: "";
	width: 80px;
	height: 80px;
	border: 2px solid #f3f3f3;
	border-top: 3px solid var(--cwsf-primary);
	border-radius: 50%;
	animation: cwsf-spin 1s linear infinite;
}

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

.cwsf-info {
	padding-top: 1.5rem;
	font-size: 1.25rem;
	line-height: 1.4;
	text-align: center;
}

.cwsf-info .cwsf-success-icon {
	margin-bottom: 1rem;
}

.cwsf-info--error {
	color: var(--cwsf-error);
}

/* Buttons */
.cwsf-buttons {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 1.5rem 0.5rem;
	margin: 2rem 0 1rem;
}

.cwsf .cwsf-btn {
	margin: 0;
	padding: 0.75rem 4rem;
	border: 0;
	border-radius: 0;
	font: inherit;
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.75rem;
	text-transform: none;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s;
}

.cwsf .cwsf-btn--next {
	background-color: var(--cwsf-primary);
	color: #fff;
}

.cwsf .cwsf-btn--next:hover,
.cwsf .cwsf-btn--next:focus {
	background-color: var(--cwsf-primary-hover);
	color: #fff;
}

.cwsf .cwsf-btn--next.is-disabled,
.cwsf .cwsf-btn--next.is-disabled:hover,
.cwsf .cwsf-btn--next.is-disabled:focus {
	background-color: var(--cwsf-primary-light);
	color: var(--cwsf-primary);
	cursor: not-allowed;
}

.cwsf .cwsf-btn--prev {
	background-color: var(--cwsf-gray-100);
	color: #000;
}

.cwsf .cwsf-btn--prev:hover,
.cwsf .cwsf-btn--prev:focus {
	background-color: var(--cwsf-gray-200);
	color: #000;
}

@media (min-width: 640px) {
	.cwsf {
		padding: 2.5rem;
	}

	.cwsf-tab--question {
		min-height: 31.5625rem;
	}

	.cwsf-option-label {
		width: 22.5rem;
		font-size: 1.25rem;
		line-height: 1.75rem;
	}

	.cwsf-row {
		flex-direction: row;
	}

	.cwsf-row > .cwsf-field {
		flex: 1 1 0;
		min-width: 0;
	}

	.cwsf-buttons {
		flex-direction: row-reverse;
	}
}
