/* ==========================================================================
   FEP Contact Form — Styles
   Matches Figma: Polar-Franquiciados-Prog node 2002:1665
   Base: 1440px canvas, form area 954px (243px to 1197px)
   ========================================================================== */

/* --- Reset WordPress block constraints --- */
.fep-page-contacto-form {
	max-width: 100% !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* --- Kill wpautop-injected <br> and empty <p> tags --- */
.fep-contact-page br,
.fep-cform p:empty {
	display: none;
}

/* --- Page wrapper --- */
.fep-contact-page {
	box-sizing: border-box;
	max-width: 1440px;
	margin: 0 auto;
	padding: 0 40px 60px;
}

.fep-contact-page *,
.fep-contact-page *::before,
.fep-contact-page *::after {
	box-sizing: border-box;
}

/* --- Back link --- */
.fep-contact-page__back {
	text-align: center;
	margin-bottom: clamp(20px, 2.08vw, 30px);
}

.fep-contact-page__back-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--wp--preset--font-family--nunito-sans, 'Nunito Sans', sans-serif);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.6;
	color: var(--wp--preset--color--azul-polar, #003B71);
	text-decoration: none;
}

.fep-contact-page__back-link:hover {
	text-decoration: underline;
}

.fep-contact-page__back-link img {
	width: 5px;
	height: 8px;
}

/* --- Main title --- */
.fep-contact-page__title {
	font-family: Inter, sans-serif;
	font-weight: 800;
	font-size: clamp(32px, 4.86vw, 70px);
	line-height: 1.1;
	letter-spacing: -1.4px;
	color: var(--wp--preset--color--azul-polar, #003B71);
	text-align: center;
	max-width: 1176px;
	margin: 0 auto clamp(40px, 4.17vw, 60px);
	padding: 0;
}

/* --- Error summary --- */
.fep-contact-page__errors {
	max-width: 954px;
	margin: 0 auto 24px;
	padding: 16px 20px;
	background-color: #FFF0F0;
	border: 1px solid #E53E3E;
	border-radius: 4px;
	color: #C53030;
	font-family: Inter, sans-serif;
	font-size: 14px;
	line-height: 1.5;
}

.fep-contact-page__errors ul {
	margin: 8px 0 0;
	padding-left: 20px;
	list-style: disc;
}

.fep-contact-page__errors p {
	margin: 0;
	font-weight: 600;
}

/* --- Form container --- */
.fep-cform {
	max-width: 954px;
	margin: 0 auto;
}

/* --- Rows --- */
.fep-cform .fep-cform__row {
	margin-bottom: 20px;
}

/* 2-column: 467px + 20px gap + 467px = 954px */
.fep-cform .fep-cform__row--2col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

/* Doc + Phone row: Tipo doc (262) + Nro doc (266) + Tel tipo (103) + Nro tel (263) + gaps(60) = 954 */
.fep-cform .fep-cform__row--doc-phone {
	display: grid;
	grid-template-columns: 262fr 266fr 103fr 263fr;
	gap: 20px;
}

/* Location row: Estado (262) + Municipio (266) + Dirección (386) + gaps(40) = 954 */
.fep-cform .fep-cform__row--location {
	display: grid;
	grid-template-columns: 262fr 266fr 386fr;
	gap: 20px;
}

/* --- Fields --- */
.fep-cform .fep-cform__field {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

/* --- Labels --- */
.fep-cform .fep-cform__field > label {
	font-family: Inter, sans-serif;
	font-weight: 500;
	font-size: 12px;
	letter-spacing: 0.6px;
	color: #565656;
	margin-bottom: 5px;
	line-height: 1.25;
}

.fep-cform .fep-cform__req {
	color: var(--wp--preset--color--azul-claro, #1895F9);
}

/* --- Tipo de consulta (radios) --- */
.fep-cform .fep-cform__field--tipo {
	margin-top: clamp(24px, 3.1vw, 45px);
}

.fep-cform .fep-cform__field--tipo > label {
	font-family: 'Nunito Sans', sans-serif;
	font-weight: 400;
	font-size: 22px;
	line-height: 1.6;
	color: var(--wp--preset--color--azul-polar, #003B71);
	margin-bottom: 16px;
}

.fep-cform .fep-cform__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 36px;
}

.fep-cform .fep-cform__chip {
	position: relative;
	cursor: pointer;
}

.fep-cform .fep-cform__chip input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.fep-cform .fep-cform__chip-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: #565656;
	font-family: Inter, sans-serif;
	font-weight: 400;
	font-size: 16px;
	line-height: 1;
	white-space: nowrap;
	transition: color 0.2s ease;
}

/* Outer radio ring (unselected). */
.fep-cform .fep-cform__chip-label::before {
	content: '';
	width: 15px;
	height: 15px;
	border-radius: 50%;
	border: 1.5px solid #CBD8E6;
	background: transparent;
	box-sizing: border-box;
	flex-shrink: 0;
	transition: border-color 0.2s ease, background 0.2s ease;
}

.fep-cform .fep-cform__chip:hover .fep-cform__chip-label::before {
	border-color: var(--wp--preset--color--azul-claro, #1895F9);
}

/* Selected: blue ring + blue inner dot.
   :has() is used (not the `+` adjacent selector) because wpautop injects a
   hidden <br> between the <input> and the <span>, which would break `input + span`. */
.fep-cform .fep-cform__chip:has(input[type="radio"]:checked) .fep-cform__chip-label::before {
	border-color: var(--wp--preset--color--azul-claro, #1895F9);
	background: radial-gradient(var(--wp--preset--color--azul-claro, #1895F9) 0 3.5px, transparent 4px);
}

.fep-cform .fep-cform__chip:has(input[type="radio"]:focus-visible) .fep-cform__chip-label::before {
	outline: 2px solid var(--wp--preset--color--azul-claro, #1895F9);
	outline-offset: 2px;
}

/* --- Inputs, Selects, Textarea --- */
.fep-cform input[type="text"],
.fep-cform input[type="email"],
.fep-cform select {
	width: 100%;
	height: 39px;
	min-height: 39px;
	max-height: 39px;
	background-color: #F6F6F6;
	border: 1px solid #CBCBCB;
	border-radius: 4px;
	padding: 0 13px;
	font-family: Inter, sans-serif;
	font-size: 16px;
	font-weight: 400;
	color: #333;
	outline: none;
	transition: border-color 0.2s ease;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	line-height: 37px;
	margin: 0;
}

.fep-cform textarea {
	width: 100%;
	min-height: 260px;
	background-color: #F6F6F6;
	border: 1px solid #CBCBCB;
	border-radius: 4px;
	padding: 12px 13px;
	font-family: Inter, sans-serif;
	font-size: 16px;
	font-weight: 400;
	color: #333;
	outline: none;
	transition: border-color 0.2s ease;
	resize: vertical;
	margin: 0;
	line-height: 1.5;
}

.fep-cform input[type="text"]::placeholder,
.fep-cform input[type="email"]::placeholder,
.fep-cform textarea::placeholder {
	color: #A4A4A4;
}

.fep-cform input[type="text"]:focus,
.fep-cform input[type="email"]:focus,
.fep-cform select:focus,
.fep-cform textarea:focus {
	border-color: var(--wp--preset--color--azul-claro, #1895F9);
	box-shadow: 0 0 0 2px rgba(24, 149, 249, 0.15);
}

/* --- Error state --- */
.fep-cform .fep-cform__field--error input,
.fep-cform .fep-cform__field--error select,
.fep-cform .fep-cform__field--error textarea {
	border-color: #E53E3E !important;
}

.fep-cform .fep-cform__field-error {
	font-family: Inter, sans-serif;
	font-size: 12px;
	color: #E53E3E;
	margin-top: 4px;
	line-height: 1.3;
}

/* --- Select dropdown arrow --- */
.fep-cform select {
	background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23565656' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 13px center;
	background-size: 10px 6px;
	padding-right: 32px;
	cursor: pointer;
}

.fep-cform select:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* --- Submit button --- */
.fep-cform .fep-cform__submit {
	margin-top: 24px;
}

.fep-cform .fep-cform__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 95px;
	height: 42px;
	padding: 0 20px;
	background-color: var(--wp--preset--color--azul-claro, #1895F9);
	color: var(--wp--preset--color--gris-claro, #F3F3F3);
	font-family: Inter, sans-serif;
	font-size: 14px;
	font-weight: 400;
	letter-spacing: -0.28px;
	text-transform: uppercase;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.2s ease;
	line-height: 1;
}

.fep-cform .fep-cform__btn:hover {
	background-color: var(--wp--preset--color--azul-polar, #003B71);
}

.fep-cform .fep-cform__btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.fep-cform__btn-spinner {
	animation: fep-cspin 1s linear infinite;
}

.fep-cform__btn-spinner svg {
	display: block;
}

@keyframes fep-cspin {
	to { transform: rotate(360deg); }
}

/* --- Success message --- */
.fep-contact-page__success {
	max-width: 954px;
	margin: 60px auto;
	padding: 40px;
	text-align: center;
	background-color: #F0FFF4;
	border: 1px solid #38A169;
	border-radius: 8px;
}

.fep-contact-page__success h2 {
	font-family: 'Nunito Sans', sans-serif;
	font-size: 28px;
	font-weight: 600;
	color: var(--wp--preset--color--azul-polar, #003B71);
	margin: 0 0 12px;
}

.fep-contact-page__success p {
	font-family: Inter, sans-serif;
	font-size: 16px;
	color: #565656;
	margin: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
	.fep-cform .fep-cform__row--doc-phone {
		grid-template-columns: 1fr 1fr;
	}

	.fep-cform .fep-cform__row--location {
		grid-template-columns: 1fr 1fr;
	}

	.fep-cform .fep-cform__field--direccion {
		grid-column: 1 / -1;
	}
}

@media (max-width: 768px) {
	.fep-contact-page {
		padding: 0 20px 40px;
	}

	.fep-contact-page__back-link {
		font-size: 14px;
		margin-bottom: 16px;
	}

	.fep-contact-page__title {
		font-size: 28px;
		letter-spacing: -0.56px;
		margin-bottom: 32px;
	}

	.fep-cform .fep-cform__row--2col,
	.fep-cform .fep-cform__row--doc-phone,
	.fep-cform .fep-cform__row--location {
		grid-template-columns: 1fr;
	}

	.fep-cform .fep-cform__field--direccion {
		grid-column: auto;
	}

	.fep-cform textarea {
		min-height: 180px;
	}

	.fep-cform .fep-cform__btn {
		width: 100%;
	}
}
