@font-face {
	font-family: "FEFont";
	src: url("./font/FE-FONT.TTF") format("truetype");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

:root {
	/* Caja donde va el texto dentro de la imagen (porcentajes sobre el contenedor) */
	--overlay-top: 34%;
	--overlay-bottom: 14%;
	--overlay-left: 7%;
	--overlay-right: 7%;

	/* Espaciado entre grupos "AB 123 CD" (se puede ajustar si tu plantilla difiere) */
	--group-gap-em: 0.55em;

	/* Color y sombra del texto para simular relieve */
	--text-color: #101010;
	--text-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", "Apple Color Emoji",
		"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
	color: #0f172a;
	background: #f6f7fb;
}

.page {
	max-width: 1100px;
	margin: 24px auto;
	padding: 0 16px;
}

.header {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 16px;
}

.header h1 {
	font: 800 20px/1.2 Montserrat, system-ui, sans-serif;
	margin: 0;
	color: #0b1221;
}

.controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 12px;
}

.divider {
	width: 1px;
	height: 22px;
	background: #cbd5e1;
	display: inline-block;
	margin: 0 6px;
}

.control {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
}

.control input[type="number"],
.control input[type="text"] {
	height: 34px;
	padding: 4px 10px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	background: white;
	font-size: 14px;
	min-width: 120px;
}

.btn {
	height: 36px;
	padding: 0 14px;
	border-radius: 8px;
	border: 1px solid #cbd5e1;
	background: white;
	cursor: pointer;
	font-weight: 600;
}
.btn.primary {
	background: #2563eb;
	border-color: #2563eb;
	color: white;
}
.btn:active {
	transform: translateY(1px);
}

.file-name {
	font-size: 12px;
	color: #64748b;
	max-width: 220px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Contenedor de la placa */
.plate {
	position: relative;
	display: inline-block;
	max-width: 100%;
}
.plate-img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* Overrides para modo MOTO */
.plate--moto {
	--overlay-top: 23%;
	--overlay-bottom: 12%;
	--overlay-left: 8%;
	--overlay-right: 8%;
	/* Separación vertical entre renglones (ajustable) */
	--moto-line-gap: 1.14;
	/* Reducir al 50% del ancho disponible actual */
	width: 50%;
}

/* Capa del texto */
.overlay {
	position: absolute;
	left: var(--overlay-left);
	right: var(--overlay-right);
	top: var(--overlay-top);
	bottom: var(--overlay-bottom);
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	/* Evita que el texto sobresalga del área blanca */
	overflow: hidden;
	z-index: 0;
}
/* Máscara blanca para tapar los caracteres impresos en la imagen base */
.overlay::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--overlay-mask-color, #ffffff);
	z-index: 0;
}

.plate-text {
	/* Usamos una tipografía pesada; Montserrat 900 emula bastante bien */
	font-family: "FEFont", Montserrat, "Arial Black", Impact, system-ui, sans-serif;
	font-weight: 900;
	color: var(--text-color);
	/* El tamaño lo ajusta JS según el alto de la caja para calzar con la imagen */
	font-size: 40px;
	line-height: 1;
	text-shadow: var(--text-shadow);
	letter-spacing: 0.02em;
	/* Tres palabras: "AB 123 CD" → este espaciado maneja los cortes entre grupos */
	word-spacing: var(--group-gap-em);
	user-select: none;
	/* Permitir salto de línea entre grupos y mantener centrado */
	display: inline-block;
	max-width: 100%;
	text-align: center;
	white-space: pre-line; /* soporta \n para modo moto */
	text-wrap: balance;
	hyphens: none;
	position: relative;
	z-index: 1;
}

/* Afinado para modo moto */
.plate--moto .plate-text {
	letter-spacing: 0.01em;
	word-spacing: 0;
	line-height: var(--moto-line-gap);
}

/* En modo auto, forzar exactamente un espacio entre grupos */
.plate--auto .plate-text {
	word-spacing: 0; /* no añadir espacio extra al espacio tipográfico */
}

/* Overrides para modo Auto 1994 (negro, texto blanco) */
.plate--auto1994 {
	--overlay-top: 28%;
	--overlay-bottom: 18%;
	--overlay-left: 3.5%;
	--overlay-right: 3.5%;
	--overlay-mask-color: transparent; /* mantener el rectángulo negro del fondo */
	--text-color: #ffffff;
	--text-shadow: 0 3px 10px rgba(0, 0, 0, 0.55);
	/* Reducir al 50% del tamaño actual */
	width: 50%;
}
.plate--auto1994 .plate-text {
	word-spacing: 0; /* exactamente un espacio entre grupos */
	letter-spacing: 0.04em;
}

.plate-text.is-hidden {
	opacity: 0;
}

.footer {
	margin-top: 16px;
	color: #475569;
	font-size: 13px;
}

/* Responsivo mínimo para pantallas chicas */
@media (max-width: 520px) {
	.page {
		margin: 12px auto;
	}
	.header h1 {
		font-size: 16px;
	}
}

