/* Login INFI — modo claro, glassmorphism estilo Apple, optimizado para Zebra TC21 (~360px CSS)
   Diseño limpio, animaciones sutiles, atención al detalle. */

:root{
	--texto: #1D1D1F;
	--texto-suave: #6C6C70;
	--placeholder: #8E8E93;
	--linea: rgba(60,60,67,0.18);
	--linea-foco: #007AFF;
	--azul: #007AFF;
	--rojo: #FF3B30;
	--rojo-fondo: rgba(255,59,48,0.10);
}

*{ box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body{ height: 100%; }

/* Color base de respaldo bajo todo (última línea de defensa en cualquier navegador) */
html{ background: #E8ECF0; }

body{
	margin: 0;
	color: var(--texto);
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
	-webkit-font-smoothing: antialiased;
	/* sin rebote elástico: evita que Safari muestre lo que hay detrás de la página */
	overscroll-behavior: none;
}

/* El degradado vive en una capa fija que cubre TODO el viewport,
   incluidas las safe areas del iPhone (notch y barra home) */
body::before{
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	background:
		radial-gradient(600px 400px at 10% 15%, rgba(0,122,255,0.14), transparent 60%),
		radial-gradient(500px 400px at 90% 85%, rgba(90,200,250,0.12), transparent 60%),
		linear-gradient(160deg, #EDF1F5 0%, #DDE3E9 100%);
}

.login{
	min-height: 100vh;
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
}

/* Tarjeta de cristal (compacta: debe caber completa en el TC21, ~360x560 CSS) */
.login-card{
	width: 100%;
	max-width: 380px;
	background: rgba(255,255,255,0.55);
	-webkit-backdrop-filter: blur(40px) saturate(160%);
	backdrop-filter: blur(40px) saturate(160%);
	border: 1px solid rgba(255,255,255,0.5);
	border-radius: 24px;
	padding: 22px 22px 20px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 8px 32px rgba(0,0,0,0.06);
	animation: entrar-tarjeta 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes entrar-tarjeta{
	from{ opacity: 0; transform: translateY(12px) scale(0.97); }
	to{ opacity: 1; transform: none; }
}

/* Branding sobre la tarjeta — logo + título flotando */
.login-branding{
	text-align: center;
	margin-bottom: 16px;
	margin-top: max(4px, 2vh);
	animation: entrar-branding 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-logo-wrapper{
	position: relative;
	display: inline-block;
	margin: 0 auto 8px;
}

.login-logo-wrapper::before{
	content: '';
	position: absolute;
	bottom: -14px;
	left: 50%;
	transform: translateX(-50%);
	width: 75%;
	height: 14px;
	background: rgba(0,0,0,0.25);
	border-radius: 50%;
	filter: blur(5px);
	pointer-events: none;
	animation: sombra 3s ease-in-out infinite;
}

.login-logo-wrapper::after{
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, transparent 55%, rgba(232,236,240,0.45) 100%);
	pointer-events: none;
	border-radius: 22px;
}

.login-logo{
	width: 80px;
	height: auto;
	display: block;
	filter: drop-shadow(0 2px 6px rgba(0,0,0,0.06));
	animation: boyar 3s ease-in-out infinite;
}

.login-titulo{
	margin: 0;
	font-size: 22px;
	font-weight: 800;
	letter-spacing: 0.3px;
	color: var(--texto);
}

@keyframes entrar-branding{
	from{ opacity: 0; transform: translateY(18px) scale(0.92); }
	to{ opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes boyar{
	0%, 100%{ transform: translateY(0); }
	50%{ transform: translateY(-4px); }
}

@keyframes sombra{
	0%, 100%{ opacity: 1; transform: translateX(-50%) scale(1); }
	50%{ opacity: 0.5; transform: translateX(-50%) scale(0.85); }
}

/* Aviso de error */
.banner-error{
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	background: var(--rojo-fondo);
	border: 1px solid rgba(255,59,48,0.2);
	color: #C9021A;
	border-radius: 12px;
	padding: 11px 14px;
	margin-bottom: 20px;
	font-size: 15px;
	font-weight: 600;
	animation: sacudir 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sacudir{
	0%{ opacity: 0; transform: translateX(-6px); }
	60%{ transform: translateX(3px); }
	100%{ opacity: 1; transform: none; }
}

.banner-error button{
	background: none;
	border: none;
	color: #C9021A;
	font-size: 22px;
	line-height: 1;
	padding: 0 2px;
	cursor: pointer;
}

/* Campos minimalistas: icono + línea inferior */
.campo{
	display: flex;
	align-items: center;
	gap: 12px;
	border-bottom: 1.5px solid var(--linea);
	padding: 9px 2px 7px;
	margin: 0;
	cursor: text;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.campo-select{ cursor: pointer; }

.campo:focus-within{
	border-color: var(--linea-foco);
	box-shadow: 0 1px 0 rgba(0,122,255,0.08);
}

.campo-icono{
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	flex-shrink: 0;
	color: var(--texto-suave);
	background: none;
	border: none;
	padding: 0;
	transition: color 0.2s;
}

.campo:focus-within .campo-icono{ color: var(--azul); }

.campo input,
.campo select{
	flex: 1;
	min-width: 0;
	height: 44px;
	border: none;
	outline: none;
	background: transparent;
	font-family: inherit;
	font-size: 17px;
	font-weight: 500;
	letter-spacing: 0.4px;
	color: var(--texto);
	caret-color: var(--azul);
}

.campo input::placeholder{ color: var(--placeholder); font-weight: 400; }

/* Select con chevron propio */
.campo select{
	-webkit-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%236C6C70' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
	background-repeat: no-repeat;
	background-position: right 2px center;
	padding-right: 26px;
}

.campo select option{ background: #FFFFFF; color: #1D1D1F; }

/* Botón mostrar/ocultar contraseña (derecha) */
.btn-ojo{
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-right: -8px;
	flex-shrink: 0;
	background: none;
	border: none;
	color: var(--texto-suave);
	cursor: pointer;
	transition: color 0.2s, opacity 0.2s;
}

.btn-ojo:active{ opacity: 0.5; }
.campo:focus-within .btn-ojo{ color: var(--texto); }

/* Botón principal */
.btn-ingresar{
	width: 100%;
	height: 52px;
	margin-top: 22px;
	border: none;
	border-radius: 14px;
	background: var(--azul);
	color: #ffffff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 3px;
	text-transform: uppercase;
	cursor: pointer;
	transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s, opacity 0.15s;
	box-shadow: 0 4px 14px rgba(0,122,255,0.3);
	-webkit-tap-highlight-color: transparent;
	user-select: none;
}

.btn-ingresar:hover{ box-shadow: 0 6px 20px rgba(0,122,255,0.35); }
.btn-ingresar:active{ transform: scale(0.97); opacity: 0.85; }
.btn-ingresar:focus-visible{ box-shadow: 0 0 0 3px rgba(10,132,255,0.4); outline: none; }

/* Pantallas más altas: aire y proporciones */
@media (min-height: 700px){
	.login-branding{ margin-bottom: 28px; margin-top: max(10px, 5vh); }
	.login-logo{ width: 96px; }
	.login-titulo{ font-size: 26px; }
	.login-card{ padding: 34px 26px 28px; border-radius: 28px; }
	.btn-ingresar{ margin-top: 28px; }
	.campo{ padding-top: 14px; padding-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce){
	*{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
