/**
 * Warehouse Vendedores: formulario de registro y pantallas de resultado.
 * Mobile-first, sin frameworks. La tipografía se hereda del tema.
 * Los colores se pueden cambiar desde el tema pisando las variables de .whv-registro.
 */

.whv-registro {
	--whv-accent: #f9520b;
	--whv-dark: #1a1a1a;
	--whv-ink: #1e1810;
	--whv-muted: #6b6560;
	--whv-line: #cfc9c5;
	--whv-surface: #ffffff;
	--whv-soft: #f8f5f4;
	--whv-error: #b3261e;
	--whv-ok: #1f7a4d;
	--whv-radius: 3px;

	box-sizing: border-box;
	max-width: 760px;
	margin: 0 auto;
	color: var(--whv-ink);
	font-size: 16px;
	line-height: 1.5;
	scroll-margin-top: 96px;
}

.whv-registro *,
.whv-registro *::before,
.whv-registro *::after {
	box-sizing: inherit;
}

/* ---------- Formulario ---------- */

.whv-form {
	position: relative;
	margin: 0;
}

.whv-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 18px;
}

.whv-field {
	min-width: 0;
}

.whv-label {
	display: block;
	margin: 0 0 6px;
	color: var(--whv-muted);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.whv-registro .whv-input {
	display: block;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 12px 13px;
	border: 1px solid var(--whv-line);
	border-radius: var(--whv-radius);
	background-color: var(--whv-surface);
	color: var(--whv-ink);
	font: inherit;
	font-size: 16px; /* Con menos de 16px, iOS hace zoom al enfocar. */
	line-height: 1.3;
	box-shadow: none;
}

.whv-registro select.whv-input {
	padding-right: 36px;
}

.whv-registro .whv-input:focus-visible,
.whv-registro .whv-check__input:focus-visible,
.whv-registro .whv-button:focus-visible,
.whv-registro a:focus-visible {
	outline: 2px solid var(--whv-dark);
	outline-offset: 2px;
}

.whv-registro .whv-input:focus {
	border-color: var(--whv-dark);
}

.whv-hint,
.whv-error,
.whv-small {
	margin: 6px 0 0;
	font-size: 14px;
	line-height: 1.45;
}

.whv-hint,
.whv-small {
	color: var(--whv-muted);
}

.whv-error {
	color: var(--whv-error);
	font-weight: 600;
}

.whv-field--error .whv-input[aria-invalid="true"] {
	border-color: var(--whv-error);
	border-width: 2px;
}

/* ---------- Localidad escrita a mano (funciona sin JavaScript) ---------- */

.whv-field--city .whv-check__input {
	margin-top: 12px;
}

.whv-field--city .whv-check__label {
	margin-top: 10px;
}

.whv-city-other {
	display: none;
	clear: both;
	margin-top: 12px;
}

.whv-city-toggle:checked ~ .whv-city-other {
	display: block;
}

/* ---------- Casillas ---------- */

.whv-checks {
	display: grid;
	gap: 14px;
	margin-top: 24px;
}

.whv-check__input {
	float: left;
	width: 20px;
	height: 20px;
	margin: 2px 0 0;
	accent-color: var(--whv-accent);
}

.whv-check__label {
	display: block;
	margin-left: 32px;
	font-size: 15px;
	line-height: 1.5;
	cursor: pointer;
}

.whv-check .whv-error {
	margin-left: 32px;
}

.whv-check::after {
	content: "";
	display: table;
	clear: both;
}

.whv-registro a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Botón ---------- */

.whv-actions {
	margin-top: 26px;
}

.whv-registro .whv-button {
	display: block;
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 14px 26px;
	border: 0;
	border-radius: var(--whv-radius);
	background-color: var(--whv-accent);
	background-image: none;
	color: #ffffff;
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.2;
	text-align: center;
	text-transform: uppercase;
	cursor: pointer;
}

.whv-registro .whv-button:hover {
	background-color: var(--whv-dark);
}

.whv-registro .whv-button[disabled] {
	opacity: 0.6;
	cursor: default;
}

/* Botón de envío del formulario: centrado, hasta 320 px, en celular y en escritorio. */

.whv-actions--submit {
	display: flex;
	justify-content: center;
}

.whv-registro .whv-actions--submit .whv-button {
	display: block;
	flex: 0 1 320px;
	width: 100%;
	max-width: 320px;
	min-width: 0;
	margin: 0 auto;
	text-align: center;
	text-transform: uppercase;
}

.whv-actions + .whv-small {
	margin-top: 16px;
}

/* ---------- Avisos y pantallas de resultado ---------- */

.whv-note {
	margin: 0 0 18px;
	padding: 12px 14px;
	border-left: 3px solid var(--whv-muted);
	background-color: var(--whv-soft);
	font-size: 14px;
	line-height: 1.5;
}

.whv-note--warn {
	border-left-color: var(--whv-error);
	color: var(--whv-error);
	font-weight: 600;
}

.whv-note--admin {
	border-left-color: var(--whv-dark);
}

.whv-screen {
	padding: 24px 20px;
	border: 1px solid var(--whv-line);
	border-top: 3px solid var(--whv-muted);
	border-radius: var(--whv-radius);
	background-color: var(--whv-surface);
}

.whv-screen--ok {
	border-top-color: var(--whv-ok);
}

.whv-screen--warn {
	border-top-color: var(--whv-accent);
}

.whv-screen__title {
	margin: 0 0 12px;
	font-size: 24px;
	line-height: 1.2;
}

.whv-screen p {
	margin: 0 0 10px;
}

.whv-screen .whv-note {
	margin-top: 16px;
}

.whv-form--resend {
	margin-top: 18px;
}

/* ---------- Pantallas anchas ---------- */

@media (min-width: 640px) {
	.whv-grid {
		grid-template-columns: 1fr 1fr;
		gap: 18px 16px;
	}

	.whv-field--full {
		grid-column: 1 / -1;
	}

	.whv-registro .whv-button {
		display: inline-block;
		width: auto;
		min-width: 240px;
	}

	.whv-screen {
		padding: 30px 28px;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.whv-registro .whv-button {
		transition: background-color 0.15s ease;
	}
}
