/* =============================================================================
   RESPONDER — formulário do usuário final.
   Depende de cwd-vars + cwd-base. Tudo escopado sob .cwd-root.
   ============================================================================= */

/* ---- Perguntas ---- */
.cwd-root .cwd-pergunta {
	padding: 20px 0;
	border-bottom: 1px solid var(--cwd-border-suave);
}
.cwd-root .cwd-pergunta:first-child {
	padding-top: 4px;
}
.cwd-root .cwd-pergunta:last-child {
	border-bottom: 0;
	padding-bottom: 4px;
}

.cwd-root .cwd-pergunta-cabecalho {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 14px;
}

.cwd-root .cwd-pergunta-numero {
	flex-shrink: 0;
	width: 26px;
	height: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--cwd-acento-bg);
	border: 1px solid var(--cwd-acento-border);
	color: var(--cwd-acento-ink);
	font-size: 12px;
	font-weight: 700;
}

.cwd-root .cwd-pergunta-texto {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.cwd-root .cwd-pergunta-enunciado {
	font-size: 15px;
	font-weight: 600;
	color: var(--cwd-text-1);
	line-height: 1.4;
}

.cwd-root .cwd-obrigatoria {
	color: var(--cwd-acento-ink);
	margin-left: 2px;
	font-weight: 700;
}

.cwd-root .cwd-pergunta-ajuda {
	font-size: 12.5px;
	color: var(--cwd-text-3);
}

.cwd-root .cwd-pergunta-campo {
	padding-left: 38px;
}

/* ---- Texto livre ---- */
.cwd-root .cwd-input {
	width: 100%;
	font-family: inherit;
	font-size: 14px;
	color: var(--cwd-text-1);
	background: var(--cwd-poco);
	border: 1px solid var(--cwd-border);
	border-radius: var(--cwd-r-interno);
	padding: 12px 14px;
	transition: border-color 160ms var(--cwd-ease-out), background 160ms var(--cwd-ease-out);
}
.cwd-root .cwd-input::placeholder {
	color: var(--cwd-text-3);
}
.cwd-root .cwd-input:focus {
	outline: none;
	border-color: var(--cwd-destaque);
	background: var(--cwd-surface);
	box-shadow: 0 0 0 3px var(--cwd-acento-bg);
}
.cwd-root .cwd-input:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}
.cwd-root .cwd-textarea {
	resize: vertical;
	min-height: 96px;
	line-height: 1.55;
}

/* ---- Opções (radio / checkbox) ---- */
.cwd-root .cwd-opcoes {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cwd-root .cwd-opcao {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 11px 14px;
	border-radius: var(--cwd-r-interno);
	background: var(--cwd-item);
	border: 1px solid var(--cwd-border);
	cursor: pointer;
	transition: background 160ms var(--cwd-ease-out), border-color 160ms var(--cwd-ease-out);
}
.cwd-root .cwd-opcao:hover {
	background: var(--cwd-acento-bg);
	border-color: var(--cwd-acento-border);
}
.cwd-root .cwd-opcao.is-marcada {
	background: var(--cwd-acento-bg);
	border-color: var(--cwd-acento-border);
}

/* Input real fica acessível ao teclado/leitor, mas invisível. */
.cwd-root .cwd-opcao input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}

.cwd-root .cwd-opcao-marca {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	border: 2px solid var(--cwd-text-3);
	background: transparent;
	position: relative;
	transition: border-color 160ms, background 160ms;
}
/* Radio é redondo; checkbox é quadrado com cantos suaves. */
.cwd-root .cwd-opcao input[type="radio"] ~ .cwd-opcao-marca {
	border-radius: 50%;
}
.cwd-root .cwd-opcao input[type="checkbox"] ~ .cwd-opcao-marca {
	border-radius: 5px;
}

.cwd-root .cwd-opcao input:checked ~ .cwd-opcao-marca {
	border-color: var(--cwd-destaque);
	background: var(--cwd-destaque);
}
.cwd-root .cwd-opcao input[type="radio"]:checked ~ .cwd-opcao-marca::after {
	content: "";
	position: absolute;
	inset: 3px;
	border-radius: 50%;
	background: var(--cwd-primaria);
}
.cwd-root .cwd-opcao input[type="checkbox"]:checked ~ .cwd-opcao-marca::after {
	content: "";
	position: absolute;
	left: 4px;
	top: 0;
	width: 5px;
	height: 10px;
	border: solid var(--cwd-primaria);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.cwd-root .cwd-opcao input:focus-visible ~ .cwd-opcao-marca {
	box-shadow: 0 0 0 3px var(--cwd-acento-bg);
}

.cwd-root .cwd-opcao-rotulo {
	font-size: 14px;
	color: var(--cwd-text-2);
	line-height: 1.4;
}
.cwd-root .cwd-opcao.is-marcada .cwd-opcao-rotulo {
	color: var(--cwd-text-1);
}

/* ---- Ações ---- */
.cwd-root .cwd-responder-acoes {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--cwd-border);
}

.cwd-root .cwd-form-vazio {
	margin: 0;
	font-size: 13px;
	font-style: italic;
	color: var(--cwd-text-3);
}

/* ---- Meta da devolutiva (prazo etc.) ---- */
.cwd-root .cwd-responder-meta {
	display: flex;
	gap: 18px;
	flex-wrap: wrap;
	margin-top: 8px;
}
.cwd-root .cwd-responder-meta-item {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.cwd-root .cwd-responder-meta-valor {
	font-size: 13px;
	font-weight: 600;
	color: var(--cwd-text-1);
}

/* ---- Responsivo ---- */
@media (max-width: 560px) {
	.cwd-root .cwd-pergunta-campo {
		padding-left: 0;
	}
	.cwd-root .cwd-responder-acoes {
		flex-direction: column-reverse;
	}
	.cwd-root .cwd-responder-acoes .cwd-btn {
		width: 100%;
		justify-content: center;
	}
}
