/* ==========================================================================
   FEP Franchise Form — Styles
   Matches Figma: Polar-Franquiciados-Prog node 2002:1497
   Base: 1440px canvas, form area 954px centered
   ========================================================================== */

/* --- Reset WordPress block constraints --- */
.fep-page-conviertete {
	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-form-page br,
.fep-form p:empty {
	display: none;
}

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

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

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

.fep-form-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-form-page__back-link:hover {
	text-decoration: underline;
}

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

/* --- Main title --- */
.fep-form-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 60px;
	padding: 0;
}

/* --- Error summary --- */
.fep-form-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-form-page__errors ul {
	margin: 8px 0 0;
	padding-left: 20px;
	list-style: disc;
}

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

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

/* --- Sections (fieldset) --- */
.fep-form .fep-form__section {
	border: none;
	padding: 0;
	margin: 0 0 32px;
	min-width: 0;
}

/* --- Section titles (legend) --- */
.fep-form .fep-form__section-title {
	display: block;
	width: 100%;
	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: 0 0 20px;
	padding: 0 0 8px;
	border: none;
	border-bottom: 2px solid var(--wp--preset--color--azul-polar, #003B71);
	float: none;
}

/* --- Subsection titles --- */
.fep-form .fep-form__subsection-title {
	font-family: 'Nunito Sans', sans-serif;
	font-weight: 400;
	font-size: 16px;
	line-height: 1.6;
	color: var(--wp--preset--color--azul-polar, #003B71);
	margin: 8px 0 16px;
	padding: 0;
}

/* --- Rows --- */
.fep-form .fep-form__row {
	margin-bottom: 16px;
}

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

/* Birthdate + Estado Civil + Email — proportional columns */
.fep-form .fep-form__row--birthdate-civil-email {
	display: grid;
	grid-template-columns: 25fr 23fr 49fr;
	gap: 20px;
}

/* Urbanización (fills ~361px) + Código Postal (141px) + Tel Fijo (196px) + Tel Celular (196px) */
.fep-form .fep-form__row--address {
	display: grid;
	grid-template-columns: 1fr 141px 196px 196px;
	gap: 20px;
}

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

/* --- Labels --- */
.fep-form .fep-form__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-form .fep-form__required {
	color: var(--wp--preset--color--azul-claro, #1895F9);
}

/* --- Inputs & Selects --- */
.fep-form input[type="text"],
.fep-form input[type="email"],
.fep-form 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-form input[type="text"]::placeholder,
.fep-form input[type="email"]::placeholder {
	color: #A4A4A4;
}

.fep-form input[type="text"]:focus,
.fep-form input[type="email"]:focus,
.fep-form select: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-form .fep-form__field--error input,
.fep-form .fep-form__field--error select {
	border-color: #E53E3E !important;
}

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

/* --- Select dropdown arrow --- */
.fep-form 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-form select:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* --- Birthdate dropdowns --- */
.fep-form .fep-form__birthdate-group {
	display: flex;
	gap: 8px;
}

.fep-form .fep-form__birthdate-group select {
	flex: 0 0 auto;
	width: auto;
	padding: 0 22px 0 8px;
	background-position: right 6px center;
}

/* --- Phone group --- */
.fep-form .fep-form__phone-group {
	display: flex;
	gap: 8px;
}

.fep-form .fep-form__phone-group select {
	width: auto;
	min-width: 80px;
	flex: none;
	padding: 0 8px;
	font-size: 13px;
}

.fep-form .fep-form__phone-group input {
	flex: 1;
	min-width: 0;
}

/* --- Radio buttons --- */
.fep-form .fep-form__radio-group {
	display: flex;
	gap: 20px;
	margin-top: 8px;
	flex-wrap: wrap;
}

.fep-form .fep-form__radio {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-family: Inter, sans-serif;
	font-size: 16px;
	font-weight: 400;
	color: #565656;
	line-height: 1;
	margin: 0;
	padding: 0;
}

.fep-form .fep-form__radio input[type="radio"] {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
}

.fep-form .fep-form__radio-custom {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 15px;
	height: 15px;
	min-width: 15px;
	min-height: 15px;
	border-radius: 50%;
	border: 1.5px solid #CBCBCB;
	background: #fff;
	flex-shrink: 0;
	transition: border-color 0.2s ease;
}

.fep-form .fep-form__radio input[type="radio"]:checked ~ .fep-form__radio-custom {
	border-color: var(--wp--preset--color--azul-claro, #1895F9);
}

.fep-form .fep-form__radio input[type="radio"]:checked ~ .fep-form__radio-custom::after {
	content: "";
	display: block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background-color: var(--wp--preset--color--azul-claro, #1895F9);
}

.fep-form .fep-form__radio input[type="radio"]:focus-visible ~ .fep-form__radio-custom {
	box-shadow: 0 0 0 2px rgba(24, 149, 249, 0.3);
}

/* --- Checkboxes --- */
.fep-form .fep-form__row--checkboxes {
	align-items: flex-start;
	margin-top: 16px;
}

.fep-form .fep-form__checkbox {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	font-family: Inter, sans-serif;
	font-weight: 500;
	font-size: 12px;
	letter-spacing: 0.6px;
	color: #565656;
	line-height: 1.6;
	margin: 0;
	padding: 0;
}

.fep-form .fep-form__checkbox input[type="checkbox"] {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
}

.fep-form .fep-form__checkbox-custom {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 12px;
	height: 12px;
	min-width: 12px;
	min-height: 12px;
	border: 1px solid #565656;
	border-radius: 2px;
	background: #fff;
	flex-shrink: 0;
	margin-top: 3px;
	transition: all 0.2s ease;
}

.fep-form .fep-form__checkbox input[type="checkbox"]:checked ~ .fep-form__checkbox-custom {
	background-color: var(--wp--preset--color--azul-claro, #1895F9);
	border-color: var(--wp--preset--color--azul-claro, #1895F9);
}

.fep-form .fep-form__checkbox input[type="checkbox"]:checked ~ .fep-form__checkbox-custom::after {
	content: "";
	display: block;
	width: 6px;
	height: 4px;
	border-left: 1.5px solid #fff;
	border-bottom: 1.5px solid #fff;
	transform: rotate(-45deg) translateY(-1px);
}

.fep-form .fep-form__checkbox input[type="checkbox"]:focus-visible ~ .fep-form__checkbox-custom {
	box-shadow: 0 0 0 2px rgba(24, 149, 249, 0.3);
}

/* --- Submit button --- */
.fep-form .fep-form__submit {
	margin-top: 16px;
}

.fep-form .fep-form__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-form .fep-form__btn:hover {
	background-color: var(--wp--preset--color--azul-polar, #003B71);
}

.fep-form .fep-form__btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.fep-form__btn-spinner {
	animation: fep-spin 1s linear infinite;
}

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

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

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

.fep-form-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-form-page__success p {
	font-family: Inter, sans-serif;
	font-size: 16px;
	color: #565656;
	margin: 0;
}

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

@media (max-width: 960px) {
	.fep-form .fep-form__row--birthdate-civil-email {
		grid-template-columns: 1fr 1fr;
	}

	.fep-form .fep-form__field--email {
		grid-column: 1 / -1;
	}

	.fep-form .fep-form__row--address {
		grid-template-columns: 1fr 1fr;
	}

	.fep-form .fep-form__field--urbanizacion {
		grid-column: 1 / -1;
	}
}

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

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

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

	.fep-form .fep-form__section-title {
		font-size: 18px;
	}

	.fep-form .fep-form__row--2col,
	.fep-form .fep-form__row--birthdate-civil-email,
	.fep-form .fep-form__row--address {
		grid-template-columns: 1fr;
	}

	.fep-form .fep-form__field--email,
	.fep-form .fep-form__field--urbanizacion {
		grid-column: auto;
	}

	.fep-form .fep-form__birthdate-group {
		width: 100%;
	}

	.fep-form .fep-form__birthdate-group select {
		flex: 1;
		width: auto !important;
	}

	.fep-form .fep-form__phone-group {
		width: 100%;
	}

	.fep-form .fep-form__phone-group select {
		min-width: 70px;
	}

	.fep-form .fep-form__section {
		margin-bottom: 32px;
	}

	.fep-form .fep-form__btn {
		width: 100%;
	}
}

/* --- Currency input (Capital disponible para invertir) --- */
.fep-form .fep-form__currency {
	position: relative;
	display: flex;
	align-items: stretch;
	height: 39px;
	background: linear-gradient(180deg, #FAFAFA 0%, #F4F4F4 100%);
	border: 1px solid #CBCBCB;
	border-radius: 6px;
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.fep-form .fep-form__currency:hover {
	border-color: #A8A8A8;
}

.fep-form .fep-form__currency:focus-within {
	border-color: var(--wp--preset--color--azul-claro, #1895F9);
	box-shadow: 0 0 0 3px rgba(24, 149, 249, 0.12);
	background: #FFFFFF;
}

.fep-form .fep-form__currency-prefix {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	padding: 0 4px 0 12px;
	font-family: Inter, sans-serif;
	font-weight: 600;
	font-size: 17px;
	color: var(--wp--preset--color--azul-polar, #003B71);
	pointer-events: none;
	user-select: none;
}

.fep-form .fep-form__currency-suffix {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 14px;
	margin: 6px 0;
	border-left: 1px solid #DCDCDC;
	font-family: Inter, sans-serif;
	font-weight: 600;
	font-size: 11px;
	letter-spacing: 1px;
	color: #6B6B6B;
	pointer-events: none;
	user-select: none;
}

.fep-form .fep-form__currency input[type="number"] {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	height: 100%;
	background: transparent;
	border: none;
	padding: 0 6px;
	font-family: Inter, sans-serif;
	font-size: 16px;
	font-weight: 500;
	color: #1A1A1A;
	outline: none;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.2px;
	-moz-appearance: textfield;
	appearance: textfield;
	margin: 0;
	line-height: 37px;
}

.fep-form .fep-form__currency input[type="number"]::-webkit-outer-spin-button,
.fep-form .fep-form__currency input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.fep-form .fep-form__currency input[type="number"]::placeholder {
	color: #B5B5B5;
	font-weight: 400;
}

.fep-form .fep-form__field--error .fep-form__currency {
	border-color: #E53E3E !important;
	background: #FFF5F5;
}
