/**
 * Forms Átomo — Calculadora de ROI.
 *
 * Complementa o CSS do formulário (mesmas variáveis --atomo-*), então a
 * calculadora herda as cores, a tipografia e o container já configurados.
 * Todos os seletores são novos: nada do formulário é redefinido aqui.
 */

.atomo-roi__question {
	margin-bottom: 6px;
}

.atomo-roi__optional {
	display: inline-block;
	margin-bottom: 10px;
	padding: 3px 10px;
	border: 1px dashed var(--atomo-card-border);
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--atomo-muted);
}

.atomo-roi__micro {
	margin-bottom: 22px;
}


/* ------------------------------------------------------------- estrutura */

/*
 * A calculadora não herda a largura do formulário: é uma ferramenta de página
 * inteira. Em "total" ela ocupa toda a linha da seção onde foi inserida, e o
 * conteúdo respeita a largura máxima configurada — assim a faixa arrastável
 * fica longa o bastante para ser confortável de arrastar em qualquer tela.
 */
.atomo-form.atomo-roi {
	width: 100%;
	max-width: var(--atomo-roi-width, 100%);
	margin-inline: var(--atomo-roi-align, auto);
}

.atomo-roi .atomo-shell {
	max-width: var(--atomo-roi-max, 1100px);
	margin-inline: auto;
	padding: clamp(20px, 3.2vw, var(--atomo-roi-pad, 40px));
}

.atomo-roi__intro-title {
	margin-bottom: 4px;
}

.atomo-roi__intro-sub {
	margin-bottom: 22px;
	max-width: 68ch;
}

/* Progresso em uma linha só: barra à esquerda, contador à direita. */
.atomo-roi__progress {
	display: flex;
	align-items: center;
	gap: 18px;
	margin-bottom: 26px;
}

.atomo-roi__progress .atomo-progress__track {
	flex: 1;
	min-width: 0;
}

.atomo-roi__progress .atomo-progress__label {
	margin: 0;
	flex: none;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* A etapa ocupa a largura toda; só o texto tem limite de leitura. */
.atomo-roi .atomo-step {
	max-width: none;
}

.atomo-roi__question {
	max-width: 24ch;
	font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.15rem);
}

.atomo-roi__micro {
	max-width: 62ch;
}

/* ---------------------------------------------------------------- slider */

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

.atomo-roi__value {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 18px;
	font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.2rem);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: var(--atomo-text);
}

.atomo-roi__value span {
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--atomo-muted);
	letter-spacing: 0;
}

.atomo-roi__range {
	--atomo-range-fill: 0%;

	display: block;
	width: 100%;
	height: 30px;
	margin: 0;
	padding: 0;
	background: none;
	appearance: none;
	cursor: pointer;
}

.atomo-roi__range:focus {
	outline: none;
}

.atomo-roi__range::-webkit-slider-runnable-track {
	height: 8px;
	border-radius: 999px;
	background: linear-gradient(
		to right,
		var(--atomo-accent) 0%,
		var(--atomo-accent) var(--atomo-range-fill),
		var(--atomo-card-border) var(--atomo-range-fill),
		var(--atomo-card-border) 100%
	);
}

.atomo-roi__range::-moz-range-track {
	height: 6px;
	border-radius: 999px;
	background: var(--atomo-card-border);
}

.atomo-roi__range::-moz-range-progress {
	height: 6px;
	border-radius: 999px;
	background: var(--atomo-accent);
}

.atomo-roi__range::-webkit-slider-thumb {
	appearance: none;
	width: 28px;
	height: 28px;
	margin-top: -10px;
	border: 3px solid var(--atomo-accent);
	border-radius: 50%;
	background: var(--atomo-input-bg);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
	transition: transform 120ms ease;
}

.atomo-roi__range::-moz-range-thumb {
	width: 22px;
	height: 22px;
	border: 3px solid var(--atomo-accent);
	border-radius: 50%;
	background: var(--atomo-input-bg);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.atomo-roi__range:active::-webkit-slider-thumb {
	transform: scale(1.08);
}

.atomo-roi__range:focus-visible::-webkit-slider-thumb {
	outline: 2px solid var(--atomo-secondary);
	outline-offset: 3px;
}

.atomo-roi__limits {
	display: flex;
	justify-content: space-between;
	margin-top: 8px;
	font-size: 0.8125rem;
	color: var(--atomo-muted);
}

/* --------------------------------------------------------------- opções */

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

.atomo-roi__options .atomo-range__label {
	font-size: 1rem;
	padding: 14px 22px;
}

/* -------------------------------------------------------------- dinheiro */

.atomo-roi__currency {
	margin-bottom: 28px;
	max-width: 420px;
}

/*
 * Campo único: quem desenha a borda, o fundo e o foco é o container. O input
 * por dentro é transparente e sem contorno nenhum, para o "R$" e o número
 * parecerem o mesmo campo — nada de input dentro de input.
 *
 * Os !important aqui existem porque temas e o Elementor estilizam input por
 * seletor próprio, e sem eles a borda do tema reaparece quando o campo recebe
 * foco. É o único lugar do plugin em que isso é necessário.
 */
.atomo-roi__money {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 18px;
	background: var(--atomo-input-bg);
	border: 1px solid var(--atomo-border);
	border-radius: var(--atomo-field-radius);
	transition: border-color 160ms ease, box-shadow 160ms ease;
	overflow: hidden;
}

.atomo-roi__money > span {
	flex: none;
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--atomo-muted);
}

.atomo-roi__money .atomo-input,
.atomo-roi__money input[type="text"] {
	flex: 1;
	min-width: 0;
	margin: 0;
	padding: 15px 0;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	outline: 0 !important;
	color: var(--atomo-input-text);
	font-size: 1.35rem;
	font-weight: 600;
	line-height: 1.2;
	appearance: none;
}

.atomo-roi__money .atomo-input:hover,
.atomo-roi__money .atomo-input:focus,
.atomo-roi__money .atomo-input:focus-visible,
.atomo-roi__money .atomo-input:active {
	border: 0 !important;
	box-shadow: none !important;
	outline: 0 !important;
	background: transparent !important;
}

/* O preenchimento automático do navegador também pinta o fundo do input. */
.atomo-roi__money .atomo-input:-webkit-autofill {
	-webkit-box-shadow: 0 0 0 60px var(--atomo-input-bg) inset !important;
	-webkit-text-fill-color: var(--atomo-input-text);
}

.atomo-roi__unit {
	flex: none;
	white-space: nowrap;
	color: var(--atomo-muted);
}

/* Só o container reage ao foco. */
.atomo-roi__money:focus-within {
	border-color: var(--atomo-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--atomo-accent) 28%, transparent);
}

/* ------------------------------------------------------------- resultado */

.atomo-roi__result {
	animation: atomo-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.atomo-roi__primary {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: clamp(22px, 3vw, 34px);
	margin: 20px 0 16px;
	background: var(--atomo-card-bg);
	border: 1px solid var(--atomo-card-border);
	border-radius: var(--atomo-field-radius);
}

.atomo-roi__primary-label {
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--atomo-muted);
}

.atomo-roi__primary-value {
	font-size: clamp(2.2rem, 1.6rem + 3vw, 3.4rem);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.03em;
	color: var(--atomo-accent);
}

.atomo-roi__primary-period {
	font-size: 0.9rem;
	color: var(--atomo-muted);
}

.atomo-roi__notice {
	margin: 0 0 20px;
	padding: 12px 16px;
	border-radius: var(--atomo-field-radius);
	border: 1px dashed var(--atomo-card-border);
	font-size: 0.85rem;
	color: var(--atomo-muted);
}

/* ------------------------------------------------ sem cálculo publicado */

.atomo-roi__pending {
	margin-bottom: 22px;
	padding: 18px 20px;
	border: 1px dashed var(--atomo-card-border);
	border-radius: var(--atomo-field-radius);
}

.atomo-roi__pending strong {
	display: block;
	margin-bottom: 4px;
	font-size: 0.95rem;
}

.atomo-roi__pending p {
	margin: 0;
	font-size: 0.875rem;
	color: var(--atomo-muted);
}

/* --------------------------------------------------- indicadores travados */

.atomo-roi__locked {
	margin-bottom: 22px;
}

.atomo-roi__locked-head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
	font-size: 0.95rem;
}

.atomo-roi__lock {
	display: inline-flex;
	color: var(--atomo-muted);
}

.atomo-roi__locked.is-open .atomo-roi__locked-head,
.atomo-roi__locked.is-open .atomo-roi__locked-note {
	display: none;
}

.atomo-roi__locked-note {
	margin: 0 0 16px;
	font-size: 0.875rem;
	color: var(--atomo-muted);
}

.atomo-roi__indicators {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 14px;
}

.atomo-roi__indicator {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 18px;
	background: var(--atomo-card-bg);
	border: 1px solid var(--atomo-card-border);
	border-radius: var(--atomo-field-radius);
	transition: border-color 260ms ease, transform 260ms ease;
}

.atomo-roi__indicator-label {
	font-size: 0.8125rem;
	color: var(--atomo-muted);
}

.atomo-roi__indicator-value {
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--atomo-text);
}

/* O valor bloqueado nem chega ao navegador: o placeholder é o próprio conteúdo. */
.atomo-roi__indicator.is-locked .atomo-roi__indicator-value {
	letter-spacing: 0.18em;
	color: var(--atomo-muted);
	filter: blur(3px);
	user-select: none;
}

.atomo-roi__indicator.is-unlocked {
	border-color: var(--atomo-accent);
	animation: atomo-roi-unlock 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes atomo-roi-unlock {
	from {
		opacity: 0.4;
		transform: translateY(6px) scale(0.985);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* ----------------------------------------------------------------- C1 */

.atomo-roi__c1 {
	padding: clamp(20px, 2.6vw, 30px);
	margin-bottom: 20px;
	background: var(--atomo-card-bg);
	border: 1px solid var(--atomo-card-border);
	border-radius: var(--atomo-field-radius);
}

.atomo-roi__c1-title {
	margin: 0 0 4px;
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--atomo-text);
}

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

.atomo-roi__c1 .atomo-fields {
	margin-bottom: 18px;
}

.atomo-roi__c1 .atomo-btn--submit {
	width: 100%;
	max-width: 340px;
	margin-top: 18px;
}

/* --------------------------------------------------------- detalhamento */

.atomo-roi__detail {
	animation: atomo-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.atomo-roi__unlocked {
	margin: 0 0 18px;
	color: var(--atomo-muted);
	font-size: 0.9rem;
}

.atomo-roi__lines-title {
	margin: 0 0 10px;
	font-size: 1rem;
	font-weight: 600;
	color: var(--atomo-text);
}

.atomo-roi__lines {
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
}

.atomo-roi__lines li {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding: 13px 0;
	border-bottom: 1px solid var(--atomo-card-border);
	font-size: 0.95rem;
}

.atomo-roi__lines li span {
	color: var(--atomo-muted);
}

.atomo-roi__lines li strong {
	color: var(--atomo-text);
	white-space: nowrap;
}

/* ---------------------------------------------------------- metodologia */

.atomo-roi__method {
	margin-top: 36px;
	padding-top: 28px;
	border-top: 1px solid var(--atomo-card-border);
}

.atomo-roi__method-title {
	margin: 0 0 8px;
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--atomo-text);
}

.atomo-roi__method-blocks {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 4px 32px;
}

.atomo-roi__method-block {
	margin-top: 20px;
}

.atomo-roi__method-block p,
.atomo-roi__method-block ul {
	max-width: 62ch;
}

.atomo-roi__method-block h4 {
	margin: 0 0 6px;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--atomo-text);
}

.atomo-roi__method-block p,
.atomo-roi__method-block li {
	margin: 0 0 6px;
	color: var(--atomo-muted);
	font-size: 0.875rem;
	line-height: 1.6;
}

.atomo-roi__method-block ul {
	margin: 0;
	padding-left: 18px;
}

.atomo-roi__method-block em {
	font-style: normal;
	opacity: 0.75;
}

.atomo-roi__method-pending {
	padding: 10px 14px;
	border: 1px dashed var(--atomo-card-border);
	border-radius: var(--atomo-field-radius);
}

.atomo-roi__method-updated {
	margin-top: 20px;
	font-size: 0.8rem;
	color: var(--atomo-muted);
}

/* ------------------------------------------------------------ acessível */

.atomo-roi .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 860px) {
	.atomo-roi__progress {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
	}

	.atomo-roi__progress .atomo-progress__label {
		text-align: right;
	}
}

@media (max-width: 640px) {
	.atomo-roi__question {
		max-width: none;
	}

	.atomo-roi__primary {
		padding: 22px;
	}

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

	.atomo-roi__c1 {
		padding: 18px;
	}
}
