/**
 * Forms Átomo — frontend.
 *
 * Todos os seletores começam com .atomo- e todas as cores saem de variáveis
 * definidas no painel, então o tema e o Elementor não interferem no resultado.
 */

.atomo-form {
	--atomo-gap: 18px;

	/* O container não pinta nada e não reserva espaço: sem fundo, sem altura
	   mínima e sem margem. Ele ocupa apenas o que o conteúdo precisa, então
	   somar o formulário a uma seção do Elementor não altera o layout dela. */
	box-sizing: border-box;
	display: block;
	width: 100%;
	max-width: var(--atomo-max-width);
	margin-inline: var(--atomo-align);
	padding: 0;
	background: none;
	color: var(--atomo-text);
	font-family: var(--atomo-font);
	font-size: var(--atomo-font-size);
	line-height: 1.6;
	text-align: left;
}

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

.atomo-shell {
	width: 100%;
	padding: var(--atomo-surface-pad);
	background: var(--atomo-surface);
	border: var(--atomo-surface-line);
	border-radius: var(--atomo-surface-radius);
	box-shadow: var(--atomo-shadow);
}

/* ------------------------------------------------------------------ marca */

.atomo-brand {
	margin-bottom: 28px;
}

.atomo-brand__logo {
	display: block;
	width: var(--atomo-logo-width);
	height: auto;
	max-width: 100%;
}

.atomo-brand__text {
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: -0.01em;
}

/* --------------------------------------------------------------- progresso */

.atomo-progress {
	margin-bottom: 28px;
}

.atomo-progress__track {
	height: 4px;
	border-radius: 999px;
	background: var(--atomo-card-border);
	overflow: hidden;
}

.atomo-progress__bar {
	display: block;
	height: 100%;
	width: 33.33%;
	border-radius: 999px;
	background: var(--atomo-accent);
	transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.atomo-progress__label {
	margin: 10px 0 0;
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--atomo-muted);
}

/* ------------------------------------------------------------------ etapas */

.atomo-step {
	display: none;
}

.atomo-step.is-active {
	display: block;
	animation: atomo-in 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes atomo-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.atomo-title {
	margin: 0 0 8px;
	font-family: inherit;
	font-size: var(--atomo-title-size);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.02em;
	color: var(--atomo-text);
}

.atomo-subtitle {
	margin: 0 0 28px;
	color: var(--atomo-muted);
	font-size: 0.95rem;
}

/* ------------------------------------------------------------------ campos */

.atomo-fields {
	/* Grade de 6 colunas: cada campo escolhe quanto ocupa, então dá para pôr
	   dois ou três lado a lado sem tocar em CSS. */
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: var(--atomo-gap);
	margin-bottom: 28px;
}

.atomo-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
	grid-column: span 6;
}

.atomo-field--half {
	grid-column: span 3;
}

.atomo-field--third {
	grid-column: span 2;
}

.atomo-select {
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: calc(100% - 20px) calc(50% + 2px), calc(100% - 15px) calc(50% + 2px);
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	padding-right: 40px;
	cursor: pointer;
}

textarea.atomo-input {
	min-height: 110px;
	resize: vertical;
	line-height: 1.5;
}

.atomo-label {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--atomo-text);
}

.atomo-required {
	color: var(--atomo-accent);
	margin-left: 2px;
}

.atomo-input {
	width: 100%;
	margin: 0;
	padding: 15px 18px;
	background: var(--atomo-input-bg);
	color: var(--atomo-input-text);
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.4;
	border: 1px solid var(--atomo-border);
	border-radius: var(--atomo-field-radius);
	outline: none;
	transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
	appearance: none;
}

.atomo-input::placeholder {
	color: var(--atomo-muted);
	opacity: 0.7;
}

.atomo-input:hover {
	border-color: var(--atomo-muted);
}

.atomo-input:focus {
	border-color: var(--atomo-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--atomo-accent) 28%, transparent);
}

.atomo-field.has-error .atomo-input {
	border-color: var(--atomo-error);
}

.atomo-field.has-error .atomo-input:focus {
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--atomo-error) 30%, transparent);
}

.atomo-error {
	display: none;
	margin: 0;
	font-size: 0.8125rem;
	color: var(--atomo-error);
}

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

.atomo-error--form {
	margin-top: 14px;
}

/* ------------------------------------------------------------- cards etapa 2 */

.atomo-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 14px;
	margin-bottom: 8px;
}

.atomo-card {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 22px;
	background: var(--atomo-card-bg);
	border: 1px solid var(--atomo-card-border);
	border-radius: var(--atomo-field-radius);
	cursor: pointer;
	transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.atomo-card:hover {
	border-color: var(--atomo-muted);
	transform: translateY(-2px);
}

.atomo-card__input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.atomo-card__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
}

.atomo-card__label {
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.2;
}

.atomo-card__desc {
	font-size: 0.85rem;
	color: var(--atomo-muted);
}

.atomo-card__check {
	width: 22px;
	height: 22px;
	flex: none;
	border: 2px solid var(--atomo-card-border);
	border-radius: 50%;
	transition: border-color 160ms ease, background 160ms ease;
}

.atomo-card:has(.atomo-card__input:checked),
.atomo-card.is-selected {
	border-color: var(--atomo-card-selected);
	background: color-mix(in srgb, var(--atomo-card-selected) 10%, var(--atomo-card-bg));
}

.atomo-card.is-selected .atomo-card__check,
.atomo-card:has(.atomo-card__input:checked) .atomo-card__check {
	border-color: var(--atomo-card-selected);
	background: var(--atomo-card-selected);
	box-shadow: inset 0 0 0 4px var(--atomo-card-bg);
}

.atomo-card:has(.atomo-card__input:focus-visible) {
	outline: 2px solid var(--atomo-accent);
	outline-offset: 3px;
}

/* ------------------------------------------------------------ faixas etapa 3 */

.atomo-ranges {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 24px;
}

.atomo-range {
	position: relative;
	display: inline-flex;
	cursor: pointer;
}

.atomo-range__input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.atomo-range__label {
	display: inline-block;
	padding: 12px 20px;
	background: var(--atomo-card-bg);
	border: 1px solid var(--atomo-card-border);
	border-radius: var(--atomo-btn-radius);
	font-size: 0.95rem;
	transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.atomo-range:hover .atomo-range__label {
	border-color: var(--atomo-muted);
}

.atomo-range__input:checked + .atomo-range__label {
	background: var(--atomo-accent);
	border-color: var(--atomo-accent);
	color: var(--atomo-accent-text);
	font-weight: 600;
}

.atomo-range__input:focus-visible + .atomo-range__label {
	outline: 2px solid var(--atomo-accent);
	outline-offset: 3px;
}

/* ----------------------------------------------------------------- aceites */

.atomo-consents {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 8px 0 24px;
}

.atomo-check {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	cursor: pointer;
	font-size: 0.9rem;
	color: var(--atomo-muted);
}

.atomo-check input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}

.atomo-check__box {
	width: 22px;
	height: 22px;
	flex: none;
	margin-top: 1px;
	border: 1px solid var(--atomo-card-border);
	border-radius: 6px;
	background: var(--atomo-card-bg);
	position: relative;
	transition: background 160ms ease, border-color 160ms ease;
}

.atomo-check__box::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 6px;
	height: 11px;
	border: solid var(--atomo-accent-text);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg) translate(-1px, -1px);
	opacity: 0;
	transition: opacity 120ms ease;
}

.atomo-check input:checked + .atomo-check__box {
	background: var(--atomo-accent);
	border-color: var(--atomo-accent);
}

.atomo-check input:checked + .atomo-check__box::after {
	opacity: 1;
}

.atomo-check input:focus-visible + .atomo-check__box {
	outline: 2px solid var(--atomo-accent);
	outline-offset: 3px;
}

.atomo-check__text a {
	color: var(--atomo-text);
	text-decoration: underline;
}

.atomo-captcha {
	margin-bottom: 20px;
}

/* ------------------------------------------------------------------ botões */

.atomo-actions {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.atomo-actions--submit {
	flex-direction: column;
	align-items: stretch;
	gap: 16px;
}

.atomo-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 16px 30px;
	min-height: 54px;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	border: 1px solid transparent;
	border-radius: var(--atomo-btn-radius);
	cursor: pointer;
	transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

.atomo-btn--primary {
	background: var(--atomo-accent);
	color: var(--atomo-accent-text);
}

.atomo-btn--primary:hover {
	transform: translateY(-1px);
	opacity: 0.92;
}

.atomo-btn--ghost {
	background: transparent;
	color: var(--atomo-text);
	border-color: var(--atomo-border);
}

.atomo-btn--ghost:hover {
	border-color: var(--atomo-muted);
}

.atomo-btn:focus-visible {
	outline: 2px solid var(--atomo-secondary);
	outline-offset: 3px;
}

.atomo-btn[disabled] {
	cursor: progress;
	opacity: 0.75;
	transform: none;
}

.atomo-link {
	background: none;
	border: 0;
	padding: 0;
	color: var(--atomo-muted);
	font-family: inherit;
	font-size: 0.9rem;
	text-decoration: underline;
	cursor: pointer;
	align-self: center;
}

.atomo-link:hover {
	color: var(--atomo-text);
}

.atomo-spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid color-mix(in srgb, var(--atomo-accent-text) 35%, transparent);
	border-top-color: var(--atomo-accent-text);
	border-radius: 50%;
	animation: atomo-spin 700ms linear infinite;
}

.atomo-btn.is-loading .atomo-spinner {
	display: inline-block;
}

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

/* ----------------------------------------------------------------- sucesso */

.atomo-success {
	text-align: center;
	padding: 12px 0;
	animation: atomo-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
	outline: none;
}

.atomo-success__icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--atomo-accent);
	color: var(--atomo-accent-text);
}

.atomo-success .atomo-subtitle {
	margin-bottom: 20px;
}

/* --------------------------------------------------------------- honeypot */

.atomo-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ------------------------------------------------------------- responsivo */

@media (max-width: 640px) {
	.atomo-form--card .atomo-shell {
		padding: clamp(18px, 5vw, var(--atomo-surface-pad));
	}

	.atomo-cards {
		grid-template-columns: 1fr;
	}

	/* No celular todo campo ocupa a linha inteira, seja qual for a largura. */
	.atomo-field,
	.atomo-field--half,
	.atomo-field--third {
		grid-column: span 6;
	}

	.atomo-actions {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.atomo-btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.atomo-form *,
	.atomo-form *::before,
	.atomo-form *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
