/**
 * Birthday Invite — Paleta "Little Explorer" (outfit de la foto) + verde
 * Azul Real · Blanco Óptico · Rojo Deportivo · Gris Sombra · Amarillo Chispa · Verde
 */

:root {
	/* Tipografía masculina juvenil: display fuerte + sans moderna */
	--bi-font-display: 'Oswald', sans-serif;
	--bi-font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
	--bi-space: 1.75rem;
	--bi-radius: 1.5rem;
	--bi-radius-sm: 1rem;
	--bi-ease-out: cubic-bezier(0.33, 1, 0.68, 1);
	--bi-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
	--bi-ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
	--bi-duration: 0.5s;
	--bi-duration-slow: 1s;

	/* Paleta Little Explorer + verde de la foto */
	--bi-azul-real: #2B59C3;
	--bi-blanco-optico: #F2F4F7;
	--bi-rojo-deportivo: #D62828;
	--bi-gris-sombra: #333333;
	--bi-amarillo-chispa: #FFD166;
	--bi-verde: #589694;

	/* Fondos: el de antes (solo fondo) */
	--bi-bg-900: #0f172a;
	--bi-bg-800: #1e3a5f;
	--bi-bg-700: #1e40af;
	--bi-royal: #2B59C3;
	--bi-royal-dark: #1e3d8f;
	--bi-royal-glow: rgba(43, 89, 195, 0.28);
	--bi-cyan: #589694;
	--bi-cyan-soft: rgba(88, 150, 148, 0.2);
	--bi-stone-600: #4a5568;
	--bi-stone-500: #5a6578;
	--bi-stone-400: #8a95a8;
	--bi-text: #F2F4F7;
	--bi-text-soft: #c5cad4;
	--bi-text-muted: #8a95a8;

	/* Acento general (botones secundarios, etc.) */
	--bi-accent: #D62828;
	--bi-accent-soft: rgba(214, 40, 40, 0.28);
	--bi-accent-hover: #b91f1f;
	/* Hero: nombre con color que combina con el fondo */
	--bi-hero-name-color: #FFD166;
	--bi-hero-name-glow: rgba(255, 209, 102, 0.22);

	/* Glass & depth */
	--bi-glass: rgba(255, 255, 255, 0.05);
	--bi-glass-border: rgba(255, 255, 255, 0.08);
	--bi-shadow-soft: 0 32px 64px -24px rgba(0, 0, 0, 0.4);
	--bi-shadow-long: 0 60px 120px -40px rgba(0, 0, 0, 0.45);
	--bi-shadow-glow: 0 0 60px -12px var(--bi-royal-glow);

	/* Botones: azul real (Sí), gris sombra (No) */
	--bi-yes: #2B59C3;
	--bi-yes-glow: rgba(43, 89, 195, 0.45);
	--bi-yes-hover: #1e3d8f;
	--bi-no: #333333;
	--bi-no-hover: #4a4a4a;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	font-size: clamp(14px, 1.8vw, 18px);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body.birthday-invite-body {
	margin: 0;
	min-height: 100vh;
	height: 100%;
	font-family: var(--bi-font-sans);
	color: var(--bi-text);
	overflow: hidden;
	overflow-x: hidden;
}

/* —— Background: dark azul oscuro, navy, profundidad —— */
/* Altura con dvh en móvil para que el centrado use la pantalla visible (sin barra del navegador) */
.bi-wrap {
	--bi-wrap-v: clamp(1rem, 4vh, 2rem);
	position: relative;
	height: 100vh;
	height: 100dvh;
	min-height: 100vh;
	min-height: 100dvh;
	max-height: 100vh;
	max-height: 100dvh;
	overflow: auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding-top: var(--bi-wrap-v);
	padding-bottom: var(--bi-wrap-v);
	padding-left: clamp(1rem, 4vw, 1.5rem);
	padding-right: clamp(1rem, 4vw, 1.5rem);
	gap: clamp(1.25rem, 3.5vh, 2.25rem);
}

.bi-bg {
	position: fixed;
	inset: 0;
	z-index: 0;
	background: linear-gradient(
		165deg,
		var(--bi-bg-900) 0%,
		var(--bi-bg-800) 35%,
		var(--bi-bg-700) 65%,
		var(--bi-bg-800) 100%
	);
}

/* Blur layers — warm dark + toque terracotta */
.bi-bg-blur {
	position: fixed;
	z-index: 1;
	border-radius: 50%;
	filter: blur(80px);
	opacity: 0.4;
	pointer-events: none;
}
.bi-bg-blur--1 {
	width: min(90vw, 500px);
	height: min(90vw, 500px);
	top: -15%;
	left: -10%;
	background: var(--bi-bg-700);
}
.bi-bg-blur--2 {
	width: min(70vw, 380px);
	height: min(70vw, 380px);
	bottom: -10%;
	right: -5%;
	background: var(--bi-bg-700);
}

/* Glow radial — azul rey (outfit) */
.bi-bg-glow {
	position: fixed;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	opacity: 0.5;
}
.bi-bg-glow--top {
	background: radial-gradient(
		ellipse 100% 60% at 50% -20%,
		var(--bi-royal-glow) 0%,
		transparent 55%
	);
}
.bi-bg-glow--bottom {
	background: radial-gradient(
		ellipse 80% 50% at 50% 120%,
		rgba(30, 58, 95, 0.35) 0%,
		transparent 50%
	);
}
.bi-bg-glow--center {
	background: radial-gradient(
		ellipse 120% 80% at 50% 50%,
		rgba(37, 99, 235, 0.08) 0%,
		transparent 60%
	);
}

/* Noise texture premium (más sutil en dark) */
.bi-bg-noise {
	position: fixed;
	inset: 0;
	z-index: 3;
	opacity: 0.06;
	pointer-events: none;
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Contenido agrupado y centrado, con poco espacio entre bloques */
.bi-hero,
.bi-card-section,
.bi-actions {
	position: relative;
	z-index: 10;
	flex-shrink: 0;
}

.bi-card-section {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.bi-actions {
	flex-shrink: 0;
}

/* —— Hero: una sola tipografía, colores que combinan —— */
.bi-hero {
	text-align: center;
	margin: 0;
	letter-spacing: 0.04em;
}

.bi-hero-title {
	margin: 0;
	font-size: clamp(1.5rem, 5.5vh, 3.25rem);
	line-height: 1.2;
	font-family: var(--bi-font-sans);
	font-weight: 400;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: baseline;
	gap: 0.2em 0.15em;
	letter-spacing: 0.03em;
}

.bi-hero-line {
	font-weight: 400;
	color: var(--bi-text);
	letter-spacing: 0.05em;
	opacity: 0.95;
}

.bi-hero-name {
	font-weight: 700;
	color: var(--bi-hero-name-color);
	text-shadow: 0 0 32px var(--bi-hero-name-glow);
	letter-spacing: 0.02em;
}

.bi-hero-line--2 {
	opacity: 0.85;
}

.bi-hero-avatar {
	width: clamp(180px, 36vmin, 280px);
	height: clamp(180px, 36vmin, 280px);
	margin: 0 auto clamp(0.6rem, 1.5vh, 1.1rem);
	border-radius: 50%;
	overflow: hidden;
	border: 2px solid rgba(255, 255, 255, 0.12);
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
	flex-shrink: 0;
}

.bi-hero-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	vertical-align: middle;
}

/* —— Card: glassmorphism + floating, compacta para caber en viewport —— */
.bi-card-section {
	width: 100%;
	max-width: min(440px, 90vw);
	margin: 0;
}

.bi-card {
	background: rgba(255, 255, 255, 0.06);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: var(--bi-radius);
	padding: clamp(1rem, 2.5vh, 2rem);
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.bi-card-msg {
	margin: 0 0 clamp(0.5rem, 1.4vh, 0.9rem);
	font-size: clamp(0.9rem, 1.8vh, 1.1rem);
	line-height: 1.5;
	color: var(--bi-text);
	font-weight: 400;
	letter-spacing: 0.01em;
}

.bi-details {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.25rem clamp(0.75rem, 2vw, 1.75rem);
	margin: 0;
	font-size: clamp(0.8rem, 1.6vh, 0.95rem);
}

.bi-details dt {
	margin: 0;
	color: var(--bi-text-soft);
	font-weight: 500;
	font-size: 0.9em;
}

.bi-details dd {
	margin: 0;
	font-weight: 600;
	color: var(--bi-text);
}

.bi-card-extra {
	margin: 0.75rem 0 0;
	text-align: center;
	font-size: 0.87em;
	font-weight: 400;
	color: var(--bi-text);
	line-height: 1.4;
	opacity: 0.95;
}

/* —— Botones: compactos para caber en viewport —— */
.bi-actions {
	text-align: center;
	width: 100%;
	max-width: min(440px, 90vw);
}

.bi-actions-label {
	margin: 0 0 clamp(0.5rem, 1vh, 0.75rem);
	font-size: clamp(0.9rem, 1.8vh, 1.05rem);
	color: var(--bi-text);
	font-weight: 600;
	letter-spacing: 0.04em;
}

.bi-buttons {
	display: flex;
	flex-direction: column;
	gap: clamp(0.5rem, 1.2vh, 0.9rem);
}

.bi-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: clamp(0.65rem, 1.8vh, 1rem) 1.25rem;
	font-family: inherit;
	font-size: clamp(0.95rem, 1.8vh, 1.1rem);
	font-weight: 600;
	border: none;
	border-radius: 999px;
	cursor: pointer;
	transition: transform 0.4s var(--bi-ease-out), box-shadow 0.4s var(--bi-ease-out), background-color 0.3s var(--bi-ease-smooth);
	overflow: hidden;
	-webkit-tap-highlight-color: transparent;
}

.bi-btn:hover:not(:disabled) {
	transform: scale(1.03);
}

.bi-btn:active:not(:disabled) {
	transform: scale(0.99);
}

.bi-btn:focus-visible {
	outline: 2px solid var(--bi-accent);
	outline-offset: 3px;
}

.bi-btn-glow {
	position: absolute;
	inset: -30%;
	background: radial-gradient(circle, rgba(255,255,255,0.35) 0%, transparent 65%);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.4s var(--bi-ease-out);
}

.bi-btn-yes:hover .bi-btn-glow,
.bi-btn-yes:focus-visible .bi-btn-glow {
	opacity: 1;
}

.bi-btn-yes {
	background: var(--bi-yes);
	color: #fff;
	box-shadow: 0 8px 24px -4px var(--bi-yes-glow);
}

.bi-btn-yes:hover:not(:disabled) {
	box-shadow: 0 14px 36px -4px var(--bi-yes-glow), 0 0 0 1px rgba(255,255,255,0.08);
}

.bi-btn-no {
	background: rgba(255, 255, 255, 0.08);
	color: var(--bi-text-soft);
	border: 1px solid var(--bi-glass-border);
	backdrop-filter: blur(8px);
}

.bi-btn-no:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.12);
	color: var(--bi-text);
	box-shadow: var(--bi-shadow-soft);
}

.bi-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none;
}

/* —— tsParticles: contenedor principal (efecto suave continuo) —— */
.bi-tsparticles {
	position: fixed;
	inset: 0;
	z-index: 110;
	pointer-events: none;
}

/* Burst al clic "Sí, voy": overlay fullscreen encima de todo */
.bi-tsparticles-burst {
	position: fixed;
	inset: 0;
	z-index: 115;
	pointer-events: none;
}

/* Legacy (por si se usa #bi-confetti en algún sitio) */
.bi-confetti {
	position: fixed;
	inset: 0;
	z-index: 110;
	pointer-events: none;
}

/* Tiras y cuadrados tipo papel, sin sombra de “círculo” */
.bi-confetti-particle {
	position: absolute;
	will-change: transform;
	transform-origin: center center;
	box-shadow: none;
}

/* —— Modal respuesta: blur animado + scale + micro rebote —— */
.bi-response-overlay {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.5s var(--bi-ease-smooth), visibility 0.5s var(--bi-ease-smooth);
}

.bi-response-overlay[data-visible="true"] {
	opacity: 1;
	visibility: visible;
}

.bi-response-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	transition: backdrop-filter 0.5s var(--bi-ease-smooth);
}

.bi-response-overlay[data-visible="true"] .bi-response-backdrop {
	backdrop-filter: blur(16px);
}

.bi-response-box {
	position: relative;
	z-index: 1;
	background: rgba(15, 23, 42, 0.95);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--bi-glass-border);
	border-radius: var(--bi-radius);
	padding: 2.5rem 2.75rem;
	max-width: 380px;
	text-align: center;
	box-shadow: var(--bi-shadow-long);
	transform: scale(0.92);
	transition: transform 0.5s var(--bi-ease-bounce);
}

.bi-response-overlay[data-visible="true"] .bi-response-box {
	transform: scale(1);
}

.bi-response-message {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--bi-text);
	font-family: var(--bi-font-sans);
	line-height: 1.4;
}

.bi-response-overlay[data-visible="true"] .bi-response-message {
	color: var(--bi-text);
}

/* —— Pantalla "ya respondida": transición cinematográfica (no pantalla simple) —— */
.bi-wrap.bi-responded {
	opacity: 0;
}

.bi-wrap.bi-responded.bi-responded--visible {
	opacity: 1;
	transition: opacity 0.6s var(--bi-ease-out);
}

.bi-responded .bi-responded-inner {
	position: relative;
	z-index: 10;
	width: 100%;
	max-width: 480px;
	text-align: center;
}

.bi-responded-content {
	padding: 2.5rem 2rem;
}

.bi-responded-title {
	margin: 0 0 0.75rem;
	font-size: clamp(1.75rem, 5vw, 2.5rem);
	font-weight: 600;
	color: var(--bi-text);
	font-family: var(--bi-font-display);
	letter-spacing: 0.02em;
}

.bi-responded-sub {
	margin: 0;
	font-size: 1.15rem;
	color: var(--bi-text-soft);
	font-weight: 400;
}

.bi-responded-heart {
	display: block;
	text-align: center;
	margin-top: 1.25rem;
	font-size: 2rem;
	line-height: 1;
}

/* Slow reveal para contenido */
.bi-reveal {
	opacity: 0;
	transform: translateY(24px);
}

.bi-reveal.bi-reveal--visible {
	opacity: 1;
	transform: translateY(0);
	transition: opacity 1s var(--bi-ease-out), transform 1s var(--bi-ease-out);
}

/* —— 404 —— */
.bi-404 .bi-404-content {
	position: relative;
	z-index: 10;
	text-align: center;
	padding: 2.5rem 2rem;
}

.bi-404-title {
	margin: 0 0 0.75rem;
	font-size: clamp(1.75rem, 5vw, 2.25rem);
	font-weight: 600;
	color: var(--bi-text);
	font-family: var(--bi-font-display);
}

.bi-404-text {
	margin: 0;
	font-size: 1rem;
	color: var(--bi-text-soft);
}

/* —— Welcome —— */
.bi-welcome .bi-welcome-content {
	position: relative;
	z-index: 10;
	text-align: center;
	padding: 2.5rem 2rem;
}

.bi-welcome-title {
	margin: 0 0 0.5rem;
	font-size: clamp(1.75rem, 5vw, 2.25rem);
	font-weight: 600;
	color: var(--bi-text);
	font-family: var(--bi-font-display);
}

.bi-welcome-text {
	margin: 0 0 1.5rem;
	font-size: 1rem;
	color: var(--bi-text-soft);
}

.bi-welcome-link {
	display: inline-block;
	padding: 0.85rem 1.75rem;
	background: var(--bi-accent);
	color: #fff;
	text-decoration: none;
	border-radius: 999px;
	font-weight: 600;
	transition: transform 0.3s var(--bi-ease-out), background 0.3s var(--bi-ease-smooth), box-shadow 0.3s var(--bi-ease-smooth);
	box-shadow: 0 4px 20px -4px var(--bi-accent-soft);
}

.bi-welcome-link:hover {
	background: var(--bi-accent-hover);
	transform: scale(1.03);
	box-shadow: 0 8px 28px -4px var(--bi-accent-soft);
	color: #fff;
}

/* —— Mobile: ligera reducción del título, círculo de foto más grande —— */
@media (max-width: 480px) {
	.bi-hero-avatar {
		width: clamp(220px, 58vmin, 280px);
		height: clamp(220px, 58vmin, 280px);
	}
	.bi-hero-title {
		font-size: clamp(1.45rem, 5vh, 2.75rem);
	}
	.bi-btn {
		min-height: 44px;
	}

	@keyframes bi-float {
		0%, 100% { transform: translateY(0); }
		50% { transform: translateY(-4px); }
	}
}

@media (max-width: 360px) {
	.bi-hero-title {
		font-size: clamp(1.35rem, 4.8vh, 2.4rem);
	}
}

@media (max-height: 650px) {
	.bi-hero-title {
		font-size: clamp(1.2rem, 4.5vh, 2.5rem);
	}
	.bi-card {
		padding: clamp(0.6rem, 1.5vh, 1rem);
	}
	.bi-card-msg {
		margin-bottom: 0.4rem;
		font-size: clamp(0.8rem, 1.5vh, 1rem);
	}
	.bi-actions-label {
		margin-bottom: 0.3rem;
	}
	.bi-btn {
		padding: 0.55rem 1rem;
		font-size: clamp(0.85rem, 1.6vh, 1rem);
	}
}

/* Pantallas muy bajas: reducir aún más para que quepa todo */
@media (max-height: 500px) {
	.bi-hero-title {
		font-size: clamp(1.25rem, 4vh, 2rem);
	}

	.bi-card {
		padding: 0.75rem 1rem;
	}

	.bi-card-msg {
		margin-bottom: 0.35rem;
		font-size: 0.85rem;
	}

	.bi-details {
		font-size: 0.75rem;
		gap: 0.15rem 0.5rem;
	}

	.bi-actions-label {
		margin-bottom: 0.25rem;
		font-size: 0.8rem;
	}

	.bi-buttons {
		gap: 0.4rem;
	}

	.bi-btn {
		padding: 0.5rem 1rem;
		font-size: 0.9rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bi-btn,
	.bi-response-box,
	.bi-card {
		transition-duration: 0.2s;
	}
}
