/* Cuestionario a pantalla completa: página propia de AMFE (negro + dorado) */
html { background: #050505; -webkit-text-size-adjust: 100%; }
body.amfe-pagina {
	--amfe-titulos: "Arial Narrow", "Barlow Condensed", "Roboto Condensed", Impact, sans-serif;
	--amfe-oro: #d4a53a;
	--amfe-oro-claro: #f2ca6b;
	--amfe-texto: #f2f2f2;
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: #050505;
	color: #f2f2f2;
	font-family: Inter, Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	-webkit-font-smoothing: antialiased;
}
.amfe-pagina *, .amfe-pagina *::before, .amfe-pagina *::after { box-sizing: border-box; }

/* Todo va en una misma columna centrada: cabecera, título, progreso y preguntas alineados */
.amfe-p-columna { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* Cabecera */
.amfe-p-cabecera { padding: 18px 0; padding-top: max(18px, env(safe-area-inset-top)); border-bottom: 1px solid #1f1f1f; }
.amfe-p-cabecera .amfe-p-columna { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
/* Logo: igual que el de amfegestion.com (AMFE en serif muy grueso, dorado, con dos rayas inclinadas a cada lado) */
.amfe-p-marca { display: inline-flex; flex-direction: column; align-items: center; gap: 5px; padding: 0 30px; text-decoration: none; }
.amfe-p-logo {
	position: relative; color: #f2ca6b; font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 900;
	letter-spacing: -.08em; line-height: .85; padding-right: .08em; text-shadow: 0 0 16px rgba(242, 202, 107, .25);
}
.amfe-p-logo::before, .amfe-p-logo::after {
	content: ""; position: absolute; top: 50%; width: 21px; height: 6px; margin-top: -3px;
	border-top: 1px solid #f2ca6b; border-bottom: 1px solid #f2ca6b; opacity: .9;
}
.amfe-p-logo::before { right: calc(100% + 6px); transform: skewX(-25deg); }
.amfe-p-logo::after { left: calc(100% + 6px); transform: skewX(25deg); }
.amfe-p-descriptor { color: #fff; font-family: var(--amfe-titulos); font-size: 11px; font-weight: 700; letter-spacing: .22em; line-height: 1; text-transform: uppercase; }
.amfe-p-etiqueta { font-family: var(--amfe-titulos); font-size: 14px; font-weight: 700; color: #b8b8b8; letter-spacing: .08em; text-transform: uppercase; }

/* Título, con estelas de luz de coches de fondo (como una foto nocturna de autopista) */
.amfe-p-hero {
	position: relative; overflow: hidden; isolation: isolate;
	padding: 34px 0 26px;
	background:
		radial-gradient(ellipse 70% 120% at 50% 0%, rgba(212, 165, 58, .16), transparent 70%),
		linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px) 0 0 / 100% 44px;
}
/* Foto de la web de AMFE (paseo marítimo de Málaga) con zoom lento tipo cine, oscurecida para leer el texto */
.amfe-p-foto {
	position: absolute; inset: 0; z-index: -3;
	background: #050505 no-repeat 70% 60% / cover;
	animation: amfe-ken-burns 26s ease-in-out infinite alternate;
}
.amfe-p-hero::before {
	content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
	background:
		linear-gradient(180deg, rgba(5, 5, 5, .55) 0%, rgba(5, 5, 5, .62) 55%, #050505 100%),
		radial-gradient(ellipse 60% 70% at 50% 45%, rgba(5, 5, 5, .55), transparent 75%);
}
.amfe-p-luces {
	position: absolute; inset: -20% -10%; z-index: -1; pointer-events: none;
	transform: rotate(-9deg);
	-webkit-mask-image: linear-gradient(180deg, transparent, #000 25%, #000 70%, transparent);
	mask-image: linear-gradient(180deg, transparent, #000 25%, #000 70%, transparent);
	opacity: .7;
}
.amfe-p-luces span {
	position: absolute; left: 0; height: 2px; width: 34%; border-radius: 2px;
	background: linear-gradient(90deg, transparent, rgba(242, 202, 107, .9) 70%, #fff);
	filter: drop-shadow(0 0 6px rgba(242, 202, 107, .8));
	transform: translateX(-120%);
	animation: amfe-estela 7s linear infinite;
	opacity: .55;
}
.amfe-p-luces span:nth-child(1) { top: 22%; animation-duration: 6.5s; }
.amfe-p-luces span:nth-child(2) { top: 30%; animation-duration: 9s; animation-delay: -3s; width: 22%; opacity: .35; }
.amfe-p-luces span:nth-child(3) { top: 38%; animation-duration: 5.5s; animation-delay: -1.5s; }
.amfe-p-luces span:nth-child(4) { top: 47%; animation-duration: 8s; animation-delay: -5s; width: 46%; opacity: .4; }
.amfe-p-luces span:nth-child(5) { top: 55%; animation-duration: 6s; animation-delay: -2.2s; }
.amfe-p-luces span:nth-child(6) { top: 63%; animation-duration: 10s; animation-delay: -7s; width: 26%; opacity: .3; }
/* Las de abajo van en sentido contrario y en rojo, como las luces traseras */
.amfe-p-luces span:nth-child(7),
.amfe-p-luces span:nth-child(8),
.amfe-p-luces span:nth-child(9) {
	background: linear-gradient(270deg, transparent, rgba(229, 72, 58, .85) 70%, #ff9a8f);
	filter: drop-shadow(0 0 6px rgba(229, 72, 58, .7));
	animation-name: amfe-estela-vuelta; opacity: .35;
}
.amfe-p-luces span:nth-child(7) { top: 72%; animation-duration: 8.5s; animation-delay: -4s; }
.amfe-p-luces span:nth-child(8) { top: 79%; animation-duration: 11s; animation-delay: -1s; width: 24%; }
.amfe-p-luces span:nth-child(9) { top: 86%; animation-duration: 7.5s; animation-delay: -6s; width: 40%; opacity: .25; }

.amfe-p-antetitulo { margin: 0 0 10px; color: #d4a53a; font-family: var(--amfe-titulos); font-size: 15px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.amfe-p-hero h1 { margin: 0 0 14px; font-family: var(--amfe-titulos); font-size: clamp(44px, 8vw, 84px); line-height: .98; font-weight: 800; color: #fff; letter-spacing: .015em; text-transform: uppercase; }
.amfe-p-linea { display: block; overflow: hidden; padding-bottom: .06em; }
.amfe-p-linea > span { display: inline-block; animation: amfe-subir .9s cubic-bezier(.2, .8, .2, 1) both; }
.amfe-p-linea + .amfe-p-linea > span { animation-delay: .12s; }
.amfe-p-brillo {
	background: linear-gradient(100deg, #b8862b 0%, #f2ca6b 30%, #fff6dc 45%, #f2ca6b 60%, #b8862b 100%) 0 0 / 250% 100%;
	-webkit-background-clip: text; background-clip: text; color: transparent;
	animation: amfe-subir .9s cubic-bezier(.2, .8, .2, 1) .12s both, amfe-oro 5s ease-in-out 1s infinite !important;
}
.amfe-p-intro { margin: 0 0 18px; font-size: 16px; line-height: 1.55; color: #c9c9c9; max-width: 560px; }

.amfe-p-datos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.amfe-p-datos li {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 8px 14px 8px 11px; border-radius: 999px;
	border: 1px solid #2d2618; background: rgba(20, 17, 10, .75); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
	font-size: 14px; color: #e9e2d0;
}
.amfe-p-datos svg { width: 18px; height: 18px; fill: none; stroke: #d4a53a; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Entrada escalonada */
.amfe-p-entra { animation: amfe-aparecer .7s cubic-bezier(.2, .8, .2, 1) both; }
.amfe-p-antetitulo.amfe-p-entra { animation-delay: 0s; }
.amfe-p-intro.amfe-p-entra { animation-delay: .3s; }
.amfe-p-datos li:nth-child(1) { animation-delay: .45s; }
.amfe-p-datos li:nth-child(2) { animation-delay: .55s; }
.amfe-p-datos li:nth-child(3) { animation-delay: .65s; }

/* Progreso: se queda fijo arriba al bajar (sticky + respaldo con JS: .esta-fija) */
.amfe-p-progreso {
	position: sticky; top: 0; z-index: 10;
	padding: 12px 0;
	background: rgba(5, 5, 5, .9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
	border-top: 1px solid #1f1f1f; border-bottom: 1px solid #1f1f1f;
}
.amfe-p-progreso.esta-fija { position: fixed; top: 0; left: 0; right: 0; animation: amfe-bajar .25s ease-out; }
@keyframes amfe-bajar { from { transform: translateY(-100%); } to { transform: none; } }
.amfe-p-progreso-texto { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: #a8a8a8; margin-bottom: 7px; }
.amfe-p-progreso-texto strong { color: #f2ca6b; font-family: var(--amfe-titulos); font-size: 17px; }
.amfe-p-progreso-msg { font-family: var(--amfe-titulos); letter-spacing: .04em; text-transform: uppercase; }
.amfe-p-listo { font-family: var(--amfe-titulos); font-size: 15px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #f2ca6b; animation: amfe-aparecer .4s ease-out; }
.amfe-p-listo.es-listo { color: #4fe08d; }
.amfe-p-listo[hidden], [data-progreso-cuenta][hidden] { display: none; }
.amfe-p-progreso-msg { color: #f2ca6b; font-weight: 600; text-align: right; }
.amfe-p-progreso-msg:not(:empty) { animation: amfe-aparecer .4s ease-out; }
.amfe-p-barra {
	position: relative; height: 6px; border-radius: 999px; overflow: hidden;
	background: #222 repeating-linear-gradient(90deg, rgba(255, 255, 255, .22) 0 8px, transparent 8px 16px) no-repeat 0 50% / 100% 1px;
}
.amfe-p-barra span {
	position: relative; display: block; height: 100%; width: 0; border-radius: inherit; overflow: hidden;
	background: linear-gradient(90deg, #b8862b, #f2ca6b);
	box-shadow: 0 0 12px rgba(242, 202, 107, .6);
	transition: width .5s cubic-bezier(.2, .8, .2, 1);
}
.amfe-p-barra span::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent) 0 0 / 50% 100% no-repeat;
	animation: amfe-barrido 2.2s linear infinite;
}
.amfe-p-barra.esta-completa span { background: linear-gradient(90deg, #d4a53a, #fff1c4, #d4a53a); }

/* La barra es una carretera: un cochecito avanza según respondes hasta la bandera de meta */
.amfe-p-pista { position: relative; padding-top: 20px; padding-right: 26px; }
.amfe-p-cochecito {
	position: absolute; bottom: 3px; width: 44px;
	left: calc((100% - 70px) * var(--progreso, 0) / 100);
	transition: left .7s cubic-bezier(.3, .7, .2, 1);
	filter: drop-shadow(0 0 6px rgba(242, 202, 107, .45));
}
.amfe-p-cochecito svg { display: block; width: 100%; height: auto; overflow: visible; }
.amfe-rueda-mini { transform-box: fill-box; transform-origin: center; }
.en-marcha .amfe-rueda-mini { animation: amfe-girar .25s linear infinite; }
.en-marcha .amfe-p-cochecito { animation: amfe-bache .25s ease-in-out infinite alternate; }
.amfe-p-meta { position: absolute; right: 0; bottom: 0; width: 20px; }
.amfe-p-meta svg { display: block; width: 100%; height: auto; overflow: visible; }
.amfe-p-bandera { transform-box: fill-box; transform-origin: left center; }
.en-meta .amfe-p-bandera { animation: amfe-ondear .5s ease-in-out infinite alternate; }
.en-meta .amfe-p-cochecito { filter: drop-shadow(0 0 10px rgba(34, 179, 94, .8)); }
.en-meta .amfe-p-barra span { background: linear-gradient(90deg, #1d9e52, #4fe08d); box-shadow: 0 0 12px rgba(34, 179, 94, .6); }

@keyframes amfe-ken-burns { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.16) translate(-2.5%, -1.5%); } }
@keyframes amfe-bache { from { transform: translateY(0); } to { transform: translateY(-1px); } }
@keyframes amfe-ondear { from { transform: skewY(0deg) scaleX(1); } to { transform: skewY(-6deg) scaleX(.9); } }
@keyframes amfe-estela { from { transform: translateX(-120%); } to { transform: translateX(330%); } }
@keyframes amfe-estela-vuelta { from { transform: translateX(330%); } to { transform: translateX(-120%); } }
@keyframes amfe-subir { from { transform: translateY(105%); } to { transform: none; } }
@keyframes amfe-aparecer { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes amfe-oro { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
@keyframes amfe-barrido { from { background-position: -100% 0; } to { background-position: 200% 0; } }

/* Preguntas */
.amfe-p-main { flex: 1 0 auto; padding: 22px 0 56px; }
.amfe-pagina .amfe-cuestionario { max-width: none; padding: 0; border-radius: 0; background: transparent; }

.amfe-p-pie {
	padding: 22px 16px calc(22px + env(safe-area-inset-bottom));
	border-top: 1px solid #1f1f1f;
	text-align: center; font-size: 13px; color: #7a7a7a;
}
.amfe-p-pie a { color: #a8a8a8; }

@media (max-width: 640px) {
	.amfe-p-etiqueta { display: none; }
}

/* Ordenador */
@media (min-width: 900px) {
	.amfe-p-columna { padding: 0 32px; }
	/* En ordenador el título va centrado (en móvil, a la izquierda) */
	.amfe-p-hero { padding: 80px 0 52px; text-align: center; }
	.amfe-p-intro { font-size: 18px; margin: 0 auto 24px; }
	.amfe-p-datos { justify-content: center; }
	.amfe-p-listo { flex: 1 1 auto; text-align: center; font-size: 17px; }
	.amfe-p-main { padding: 32px 0 88px; }
	.amfe-pagina .amfe-form { gap: 16px; }
	.amfe-pagina .amfe-pregunta { padding: 24px 28px 20px; }
	.amfe-pagina .amfe-enviar { max-width: 420px; }
}

@media (max-width: 640px) {
	.amfe-p-progreso-msg { display: none; }
	.amfe-p-datos li { font-size: 13px; padding: 7px 12px 7px 9px; }
}

@media (prefers-reduced-motion: reduce) {
	.amfe-pagina *, .amfe-pagina *::before, .amfe-pagina *::after { animation: none !important; transition: none !important; }
	.amfe-p-luces { display: none; }
}
