/**
 * Associação 1p36 Brasil - Formulários
 * CSS isolado com namespace .p36-form
 */

.p36-form-wrapper {
	--p36-primary: var(--1p36-primary, currentColor);
	--p36-secondary: var(--1p36-secondary, #555);
	--p36-text: var(--1p36-text, inherit);
	--p36-border: var(--1p36-border, #ccc);
	--p36-radius: var(--1p36-radius, 4px);
	--p36-error: #b32d2e;
	--p36-success: #007017;
	--p36-bg-section: transparent;

	max-width: 100%;
	margin: 0 auto 2rem;
	color: var(--p36-text);
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	box-sizing: border-box;
}

.p36-form-wrapper *,
.p36-form-wrapper *::before,
.p36-form-wrapper *::after {
	box-sizing: border-box;
}

.p36-form {
	width: 100%;
}

.p36-form__header {
	margin-bottom: 2rem;
}

.p36-form__title {
	margin: 0 0 0.5rem;
	font-size: 1.75rem;
	font-weight: inherit;
	line-height: 1.3;
}

.p36-form__intro,
.p36-form__help {
	margin: 0 0 1rem;
	opacity: 0.85;
}

.p36-form__subtitle {
	margin: 1.5rem 0 0.75rem;
	font-size: 1.1rem;
	font-weight: 600;
}

.p36-form__section {
	border: 1px solid var(--p36-border);
	border-radius: var(--p36-radius);
	padding: 1.5rem;
	margin-bottom: 1.5rem;
	background: var(--p36-bg-section);
}

.p36-form__section-title {
	font-size: 1.25rem;
	font-weight: 600;
	padding: 0 0.5rem;
	margin-bottom: 1rem;
}

.p36-form__row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
}

@media (min-width: 768px) {
	.p36-form__row {
		grid-template-columns: repeat(2, 1fr);
	}

	.p36-form__row:has(.p36-form__field:nth-child(3)) {
		grid-template-columns: repeat(3, 1fr);
	}
}

.p36-form__field {
	margin-bottom: 1.25rem;
}

.p36-form__field--error .p36-form__input,
.p36-form__field--error .p36-form__select {
	border-color: var(--p36-error);
}

.p36-form__label {
	display: block;
	margin-bottom: 0.4rem;
	font-weight: 500;
}

.p36-form__required {
	color: var(--p36-error);
}

.p36-form__input,
.p36-form__select {
	display: block;
	width: 100%;
	max-width: 100%;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--p36-border);
	border-radius: var(--p36-radius);
	background: transparent;
	color: inherit;
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.5;
	transition: border-color 0.2s;
}

.p36-form__input:focus,
.p36-form__select:focus {
	outline: 2px solid var(--p36-primary);
	outline-offset: 1px;
	border-color: var(--p36-primary);
}

.p36-form__radio-group,
.p36-form__checkbox-group {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.p36-form__radio,
.p36-form__checkbox {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	cursor: pointer;
	padding: 0.35rem 0;
	min-height: 44px;
}

.p36-form__radio input,
.p36-form__checkbox input {
	flex-shrink: 0;
	width: 1.15rem;
	height: 1.15rem;
	margin-top: 0.15rem;
	accent-color: var(--p36-primary);
}

.p36-form__checkbox--consent {
	align-items: flex-start;
	padding: 0.75rem;
	border: 1px solid var(--p36-border);
	border-radius: var(--p36-radius);
}

.p36-form__legal {
	padding: 1rem;
	margin-bottom: 1rem;
	border-left: 3px solid var(--p36-border);
	font-size: 0.95rem;
}

.p36-form__legal ul {
	margin: 0.5rem 0;
	padding-left: 1.25rem;
}

.p36-form__legal li {
	margin-bottom: 0.25rem;
}

.p36-form__error {
	display: block;
	margin-top: 0.35rem;
	color: var(--p36-error);
	font-size: 0.875rem;
}

.p36-form__message {
	padding: 1rem 1.25rem;
	margin-bottom: 1.5rem;
	border-radius: var(--p36-radius);
	border: 1px solid;
}

.p36-form__message--success {
	background: #edfaef;
	border-color: var(--p36-success);
	color: var(--p36-success);
}

.p36-form__message--error {
	background: #fcf0f1;
	border-color: var(--p36-error);
	color: var(--p36-error);
}

.p36-form__actions {
	margin-top: 2rem;
}

.p36-form__submit {
	display: inline-block;
	min-width: 200px;
	width: 100%;
	max-width: 100%;
	padding: 0.85rem 1.5rem;
	border: none;
	border-radius: var(--p36-radius);
	background: var(--p36-primary);
	color: #fff;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	min-height: 48px;
	transition: opacity 0.2s;
}

@media (min-width: 480px) {
	.p36-form__submit {
		width: auto;
	}
}

.p36-form__submit:hover:not(:disabled) {
	opacity: 0.9;
}

.p36-form__submit:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

.p36-form__submit:focus {
	outline: 2px solid var(--p36-primary);
	outline-offset: 2px;
}

.p36-form__conditional {
	display: none;
}

.p36-form__conditional.is-visible {
	display: block;
}

.p36-form__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
}

@media (max-width: 767px) {
	.p36-form__section {
		padding: 1rem;
	}

	.p36-form__title {
		font-size: 1.4rem;
	}
}
