/* ==========================================================================
   4.25.94 — Verificación OTP con efecto de vidrio (glassmorphism)
   Solo capa visual. El campo real `mcg_otp_codigo` sigue siendo el mismo
   input (autocompletado del SMS/correo, pegar y teclado nativo); el JS de
   mcg-login-ux.js solo dibuja las casillas encima. Sin JS, el campo se ve
   como un input grande de vidrio.
   ========================================================================== */
.mcg-shell.mcg-shell-angosto.mcg-otp-escena,
.mcg-shell.mcg-shell-angosto.mcg-otp-escena:has(.mcg-auth-card) {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	margin: 24px auto;
	padding: 44px 18px 48px !important;
	border-radius: 28px;
	background:
		radial-gradient(120% 80% at 100% 0%, rgba(27, 98, 128, 0.55) 0%, transparent 55%),
		linear-gradient(160deg, #06121d 0%, #0b2840 52%, #060f18 100%);
}
/* Esferas de luz que se desplazan detrás del vidrio. */
.mcg-otp-escena::before,
.mcg-otp-escena::after {
	content: "";
	position: absolute;
	z-index: -1;
	border-radius: 50%;
	filter: blur(46px);
	pointer-events: none;
}
.mcg-otp-escena::before {
	width: 240px; height: 240px;
	top: -50px; left: -60px;
	background: radial-gradient(circle, #e8c47c 0%, rgba(212, 168, 79, 0) 70%);
	opacity: 0.55;
	animation: mcg-otp-deriva-a 14s ease-in-out infinite alternate;
}
.mcg-otp-escena::after {
	width: 280px; height: 280px;
	bottom: -80px; right: -70px;
	background: radial-gradient(circle, #2a8fb5 0%, rgba(27, 98, 128, 0) 70%);
	opacity: 0.6;
	animation: mcg-otp-deriva-b 17s ease-in-out infinite alternate;
}
@keyframes mcg-otp-deriva-a { to { transform: translate(90px, 120px) scale(1.15); } }
@keyframes mcg-otp-deriva-b { to { transform: translate(-80px, -110px) scale(1.1); } }

/* Tarjeta de vidrio */
.mcg-shell .mcg-auth-card.mcg-auth-card-otp {
	position: relative;
	padding: 0 24px 26px !important;
	border: 1px solid rgba(255, 255, 255, 0.2) !important;
	border-radius: 22px !important;
	background: rgba(14, 38, 60, 0.72) !important;
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.28),
		0 30px 60px -24px rgba(0, 0, 0, 0.7) !important;
	color: #fff;
	animation: mcg-otp-entra 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
	.mcg-shell .mcg-auth-card.mcg-auth-card-otp {
		background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)) !important;
		-webkit-backdrop-filter: blur(20px) saturate(150%);
		backdrop-filter: blur(20px) saturate(150%);
	}
}
/* Destello que recorre el vidrio una vez al aparecer. */
.mcg-auth-card-otp::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.16) 50%, transparent 65%);
	transform: translateX(-120%);
	animation: mcg-otp-destello 1.6s 0.5s ease-out forwards;
	pointer-events: none;
}
@keyframes mcg-otp-entra { from { opacity: 0; transform: translateY(18px) scale(0.97); } }
@keyframes mcg-otp-destello { to { transform: translateX(120%); } }

.mcg-shell .mcg-auth-card.mcg-auth-card-otp:not(.mcg-auth-card-tienda) .mcg-auth-brand {
	background: transparent !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
}

/* Insignia de llave */
.mcg-otp-llave {
	display: grid;
	place-items: center;
	width: 48px; height: 48px;
	margin: 4px auto 12px;
	border-radius: 14px;
	color: #e8c47c;
	background: rgba(212, 168, 79, 0.12);
	border: 1px solid rgba(232, 196, 124, 0.45);
	box-shadow: 0 0 24px rgba(212, 168, 79, 0.28);
	animation: mcg-otp-latido 3.2s ease-in-out infinite;
}
.mcg-otp-llave svg { width: 24px; height: 24px; }
@keyframes mcg-otp-latido { 50% { box-shadow: 0 0 34px rgba(232, 196, 124, 0.5); } }

/* Textos sobre el vidrio */
.mcg-auth-card-otp .mcg-auth-nota { color: rgba(255, 255, 255, 0.78) !important; }
.mcg-auth-card-otp .mcg-auth-nota strong { color: #e8c47c; }
.mcg-auth-card-otp .mcg-campo label,
.mcg-auth-card-otp .mcg-auth-recordar { color: rgba(255, 255, 255, 0.82) !important; }
.mcg-auth-card-otp .mcg-campo > label { display: block; text-align: center; margin: 14px 0 10px; }
.mcg-auth-card-otp .mcg-link-cancelar-plan { color: #e8c47c !important; }
.mcg-auth-card-otp .mcg-link-volver { color: rgba(255, 255, 255, 0.7) !important; }
.mcg-auth-card-otp .mcg-link-volver:hover { color: #fff !important; }
.mcg-auth-card-otp .mcg-flash {
	background: rgba(255, 255, 255, 0.1) !important;
	border: 1px solid rgba(255, 255, 255, 0.22) !important;
	color: #fff !important;
}
.mcg-auth-card-otp .mcg-flash-error { border-color: rgba(255, 120, 100, 0.6) !important; }
.mcg-auth-card-otp .mcg-flash-exito { border-color: rgba(120, 220, 160, 0.6) !important; }

/* Campo (sin JS): input de vidrio */
.mcg-shell .mcg-auth-card.mcg-auth-card-otp .mcg-auth-form .mcg-campo input.mcg-otp-input {
	background: rgba(255, 255, 255, 0.1) !important;
	border: 1.5px solid rgba(232, 196, 124, 0.45) !important;
	color: #fff !important;
	border-radius: 14px !important;
}

/* Casillas (las dibuja el JS; el input real queda encima, invisible) */
.mcg-otp-zona { position: relative; }
.mcg-otp-cajas {
	display: flex;
	justify-content: center;
	gap: 10px;
}
.mcg-otp-caja {
	flex: 1 1 0;
	max-width: 52px;
	height: 60px;
	display: grid;
	place-items: center;
	border-radius: 15px;
	font-size: 26px;
	font-weight: 700;
	color: #fff;
	background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
	border: 1.5px solid rgba(212, 168, 79, 0.38);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 10px 20px -10px rgba(0, 0, 0, 0.7);
	transition: border-color 0.2s, box-shadow 0.25s, transform 0.25s;
	animation: mcg-otp-flota 4s ease-in-out infinite;
	animation-delay: calc(var(--i, 0) * 0.25s);
}
@keyframes mcg-otp-flota { 50% { transform: translateY(-3px); } }
.mcg-otp-caja.llena { border-color: #d4a84f; }
.mcg-otp-caja.activa {
	border-color: #e8c47c;
	box-shadow: 0 0 0 3px rgba(232, 196, 124, 0.18), 0 0 24px rgba(212, 168, 79, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.mcg-otp-caja.activa:empty::after {
	content: "";
	width: 2px; height: 26px;
	background: #e8c47c;
	animation: mcg-otp-cursor 1s steps(1) infinite;
}
@keyframes mcg-otp-cursor { 50% { opacity: 0; } }
.mcg-otp-caja.pop span { display: inline-block; animation: mcg-otp-pop 0.32s cubic-bezier(0.2, 1.7, 0.4, 1); }
@keyframes mcg-otp-pop { from { transform: scale(0.2) rotate(-18deg); opacity: 0; } }

/* Con casillas activas, el input real es transparente y cubre la zona */
.mcg-otp-js .mcg-otp-zona input.mcg-otp-input {
	position: absolute !important;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: transparent !important;
	-webkit-text-fill-color: transparent;
	caret-color: transparent;
	opacity: 0.01;
	letter-spacing: 0;
	z-index: 2;
}

/* Código incorrecto: vibra y se tiñe */
.mcg-otp-zona.mcg-otp-error .mcg-otp-cajas { animation: mcg-otp-vibra 0.5s; }
.mcg-otp-zona.mcg-otp-error .mcg-otp-caja { border-color: rgba(255, 120, 100, 0.8); }
@keyframes mcg-otp-vibra {
	20%, 60% { transform: translateX(-8px); }
	40%, 80% { transform: translateX(8px); }
}

/* Botón dorado y estado "Verificando…" */
.mcg-shell .mcg-auth-card.mcg-auth-card-otp .mcg-btn-ancho:not(.mcg-btn-secundario) {
	background: linear-gradient(135deg, #d4a84f 0%, #f0d08e 100%) !important;
	color: #1a1405 !important;
	font-weight: 700;
	box-shadow: 0 12px 26px -10px rgba(212, 168, 79, 0.7) !important;
}
.mcg-auth-card-otp .mcg-btn-ancho:hover { filter: brightness(1.06); }
.mcg-otp-verificando .mcg-btn-ancho { pointer-events: none; opacity: 0.9; }
.mcg-otp-verificando .mcg-btn-ancho::before {
	content: "";
	display: inline-block;
	width: 14px; height: 14px;
	margin-right: 10px;
	vertical-align: -2px;
	border: 2px solid rgba(26, 20, 5, 0.3);
	border-top-color: #1a1405;
	border-radius: 50%;
	animation: mcg-otp-gira 0.7s linear infinite;
}
.mcg-otp-verificando .mcg-otp-caja { animation: mcg-otp-onda 0.9s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 0.09s); }
@keyframes mcg-otp-gira { to { transform: rotate(360deg); } }
@keyframes mcg-otp-onda { 50% { transform: translateY(-8px); border-color: #f0d08e; } }

@media (max-width: 400px) {
	.mcg-otp-cajas { gap: 6px; }
	.mcg-otp-caja { height: 52px; font-size: 22px; border-radius: 12px; }
}
@media (prefers-reduced-motion: reduce) {
	.mcg-otp-escena::before, .mcg-otp-escena::after,
	.mcg-auth-card-otp, .mcg-auth-card-otp::before,
	.mcg-otp-llave, .mcg-otp-caja, .mcg-otp-verificando .mcg-otp-caja { animation: none !important; }
}

/* Botón «Pegar código» (portapapeles) */
.mcg-otp-pegar {
	display: block;
	margin: 10px auto 0;
	padding: 6px 14px;
	border-radius: 999px;
	border: 1px solid rgba(232, 196, 124, 0.5);
	background: rgba(255, 255, 255, 0.08);
	color: #e8c47c;
	font-size: 13px;
	cursor: pointer;
}
.mcg-otp-pegar:hover { background: rgba(255, 255, 255, 0.16); }
