/*
 * UNIPAC – Formulario de contacto (Contact Form 7)
 * Autor: VisorLab en unión con Claude
 */

.unipac-cf7 {
	--up-purple: #7e4292;
	--up-border: #b48cc2;
	--up-orange: #ee7326;
	--up-orange-dark: #d45f15;
	--up-text: #4a4a4a;
	--up-placeholder: #c4c4c4;
	--up-error: #d63638;
	--up-ok: #198043;

	width: 100%;
	max-width: 1000px;
	margin: 0 auto;
	font-family: "Roboto", Arial, sans-serif;
	color: var(--up-text);
}

/* Cuadrícula: 2 columnas en escritorio, 1 en móvil */
.unipac-cf7__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 16px;
	row-gap: 28px;
}

.unipac-cf7__field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.unipac-cf7__field--full { grid-column: 1 / -1; }

.unipac-cf7 label,
.unipac-cf7__label {
	font-size: 16px;
	font-weight: 700;
	line-height: 150%;
	color: var(--up-purple);
	margin: 0;
	letter-spacing:2%;
}

.unipac-cf7 .wpcf7-form-control-wrap { display: block; width: 100%; }

/* Campos */
.unipac-cf7 input[type="text"],
.unipac-cf7 input[type="tel"],
.unipac-cf7 input[type="email"],
.unipac-cf7 select,
.unipac-cf7 textarea {
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 15px 30px;
	font: 400 14px/1.4 "Roboto", Arial, sans-serif;
	color: var(--up-text);
	background: #fff;
	border: 1px solid var(--up-border);
	border-radius: 0;
	box-shadow: none;
	transition: border-color .2s ease, box-shadow .2s ease;
	-webkit-appearance: none;
	appearance: none;
	font-size:16px;
}

.unipac-cf7 textarea {
	height: 150px;
	min-height: 120px;
	resize: vertical;
	padding-top: 12px;
}

.unipac-cf7 ::placeholder { color: var(--up-placeholder); opacity: 1; }

.unipac-cf7 input:focus,
.unipac-cf7 select:focus,
.unipac-cf7 textarea:focus {
	outline: none;
	border-color: var(--up-purple);
	box-shadow: 0 0 0 3px rgba(126, 66, 146, .15);
}

/* Select con flecha morada */
.unipac-cf7 select {
	padding-right: 44px;
	font-size: 16px;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%237e4292' stroke-width='1.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 13px 8px;
}
/* Placeholder del select (primera opción vacía) en gris */
.unipac-cf7 select:has(option[value=""]:checked) { color: var(--up-placeholder); }
.unipac-cf7 select option { color: var(--up-text); }

/* Aceptación de términos */
.unipac-cf7__terms { margin-top: 4px; }
.unipac-cf7 .wpcf7-acceptance .wpcf7-list-item { margin: 0; }
.unipac-cf7 .wpcf7-acceptance label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 400;
	color: var(--up-text);
	cursor: pointer;
}
.unipac-cf7 .wpcf7-acceptance input[type="checkbox"] {
	-webkit-appearance: none;
	appearance: none;
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	margin: 0;
	border: 1px solid var(--up-purple);
	background: #fff;
	cursor: pointer;
	position: relative;
}
.unipac-cf7 .wpcf7-acceptance input[type="checkbox"]:checked { background: var(--up-purple); }
.unipac-cf7 .wpcf7-acceptance input[type="checkbox"]:checked::after {
	content: "";
	position: absolute;
	left: 3px; top: 0;
	width: 3px; height: 7px;
	border: solid #fff;
	border-width: 0 1.5px 1.5px 0;
	transform: rotate(45deg);
}
.unipac-cf7 .wpcf7-acceptance input[type="checkbox"]:focus-visible { outline: 2px solid var(--up-purple); outline-offset: 2px; }
.unipac-cf7__terms a { color: var(--up-orange); font-weight: 700; text-decoration: none; }
.unipac-cf7__terms a:hover { text-decoration: underline; }

/* Botón */
.unipac-cf7__actions {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 52px;
}
.unipac-cf7 input[type="submit"].unipac-cf7__btn,
.unipac-cf7 .unipac-cf7__btn {
display: inline-block;
	/* min-width: 160px; */
	height: auto;
	padding: 25px 30px;
	color: #fff;
	background: var(--up-orange);
	border: 0;
	border-radius: 0;
	cursor: pointer;
	transition: background-color .2s ease, transform .1s ease;
	font-size: 16px;
	font-weight: 600;
	font-family: 'Montserrat';
	letter-spacing: 2%;
	line-height: 100%;
}
.unipac-cf7 .unipac-cf7__btn:hover,
.unipac-cf7 .unipac-cf7__btn:focus-visible { background: var(--up-ok) !important; }
.unipac-cf7 .unipac-cf7__btn:active { transform: translateY(1px); }
.unipac-cf7 .unipac-cf7__btn:disabled { opacity: .6; cursor: not-allowed; }
.unipac-cf7 .wpcf7-spinner { margin: 0; }

/* Validación y respuestas */
.unipac-cf7 .wpcf7-not-valid { border-color: var(--up-error) !important; }
.unipac-cf7 .wpcf7-not-valid-tip {
	margin-top: 6px;
	font-size: 14px;
	color: var(--up-error);
}
.wpcf7 form:has(.unipac-cf7) .wpcf7-response-output {
	max-width: 1000px;
	margin: 24px auto 0;
	padding: 12px 16px;
	font: 400 13px/1.5 "Roboto", Arial, sans-serif;
	border-width: 1px;
	border-radius: 0;
	text-align: center;
}
.wpcf7 form.sent:has(.unipac-cf7) .wpcf7-response-output { border-color: #2e7d32; color: #2e7d32; background: #eef7ee; }
.wpcf7 form.invalid:has(.unipac-cf7) .wpcf7-response-output,
.wpcf7 form.unaccepted:has(.unipac-cf7) .wpcf7-response-output { border-color: #ee7326; color: #8a3f0e; background: #fff4ec; }
.wpcf7 form.failed:has(.unipac-cf7) .wpcf7-response-output,
.wpcf7 form.spam:has(.unipac-cf7) .wpcf7-response-output { border-color: #d63638; color: #a12223; background: #fdeeee; }

/* Móvil */
@media (max-width: 767px) {
	.unipac-cf7__grid { grid-template-columns: 1fr; row-gap: 20px; }
	.unipac-cf7__actions { margin-top: 32px; }
	.unipac-cf7 .unipac-cf7__btn { width: 100%; }
	.unipac-cf7 input[type="text"],
	.unipac-cf7 input[type="tel"],
	.unipac-cf7 input[type="email"],
	.unipac-cf7 select,
	.unipac-cf7 textarea { height: 44px; font-size: 16px; } /* 16px evita el zoom en iOS */
	.unipac-cf7 textarea { height: 160px; }
}
