/**
 * CRM Comercial 786 — FRONTEND (login neón + panel móvil tipo app).
 */

:root {
	--crm786-neon-green: #00ffa3;
	--crm786-neon-fuchsia: #ff2fd0;
	--crm786-neon-blue: #1b6bff;
}

/* ============ LOGIN ============ */
.crm786-login-wrap {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background: radial-gradient(circle at 20% 20%, #041b2d, #00060f 70%);
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	padding: 16px;
	box-sizing: border-box;
}

.crm786-login-bg { position: absolute; inset: 0; overflow: hidden; }
.crm786-orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .75; animation: crm786-float 14s ease-in-out infinite; }
.crm786-orb--green { width: 46vw; height: 46vw; background: var(--crm786-neon-green); top: -12vw; left: -10vw; }
.crm786-orb--fuchsia { width: 42vw; height: 42vw; background: var(--crm786-neon-fuchsia); bottom: -14vw; right: -8vw; animation-delay: -4s; }
.crm786-orb--blue { width: 40vw; height: 40vw; background: var(--crm786-neon-blue); bottom: 10vh; left: 30vw; animation-delay: -8s; }
.crm786-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(0,255,163,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(27,107,255,.08) 1px, transparent 1px); background-size: 46px 46px; mask-image: radial-gradient(circle at center, #000 40%, transparent 85%); }

@keyframes crm786-float { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(4vw,3vh) scale(1.08); } 66% { transform: translate(-3vw,-2vh) scale(.95); } }

.crm786-login-card {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 400px;
	padding: 40px 34px;
	background: rgba(6, 20, 38, .38);
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 22px;
	backdrop-filter: blur(18px) saturate(150%);
	-webkit-backdrop-filter: blur(18px) saturate(150%);
	box-shadow: 0 0 0 1px rgba(0, 255, 163, .12), 0 20px 60px rgba(0, 0, 0, .55), 0 0 40px rgba(255, 47, 208, .18);
	color: #eaf6ff;
}

.crm786-login-brand { text-align: center; margin-bottom: 24px; }
.crm786-login-logo { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 16px; font-weight: 800; font-size: 24px; letter-spacing: 1px; color: #001018; background: linear-gradient(135deg, var(--crm786-neon-green), var(--crm786-neon-blue)); box-shadow: 0 0 24px rgba(0,255,163,.6); margin-bottom: 14px; }
.crm786-login-brand h1 { color: #fff; font-size: 20px; margin: 0 0 4px; }
.crm786-login-brand p { color: rgba(234, 246, 255, .7); font-size: 13px; margin: 0; }
.crm786-login-form label { display: block; margin-bottom: 16px; }
.crm786-login-form label > span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: rgba(234, 246, 255, .7); margin-bottom: 6px; }
.crm786-login-form input[type="text"], .crm786-login-form input[type="password"] { width: 100%; padding: 13px 14px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.18); border-radius: 12px; color: #fff; font-size: 16px; transition: border-color .2s, box-shadow .2s; box-sizing: border-box; }
.crm786-login-form input:focus { outline: none; border-color: var(--crm786-neon-green); box-shadow: 0 0 0 3px rgba(0,255,163,.25); }
.crm786-login-remember { display: flex !important; align-items: center; gap: 8px; font-size: 13px; color: rgba(234,246,255,.8); }
.crm786-login-remember span { display: inline; }
.crm786-login-btn { width: 100%; margin-top: 6px; padding: 14px; border: none; border-radius: 12px; font-size: 16px; font-weight: 700; letter-spacing: .03em; cursor: pointer; color: #001018; background: linear-gradient(90deg, var(--crm786-neon-green), var(--crm786-neon-fuchsia), var(--crm786-neon-blue)); background-size: 200% auto; transition: background-position .4s, transform .1s, box-shadow .3s; box-shadow: 0 0 22px rgba(255,47,208,.35); }
.crm786-login-btn:hover { background-position: right center; box-shadow: 0 0 30px rgba(0,255,163,.5); }
.crm786-login-btn:active { transform: translateY(1px); }
.crm786-login-error { background: rgba(255,47,208,.16); border: 1px solid rgba(255,47,208,.5); color: #ffd9f4; padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; text-align: center; }
.crm786-login-foot { text-align: center; font-size: 11px; letter-spacing: .04em; color: rgba(234,246,255,.5); margin: 22px 0 0; }

/* ============ PANEL FRONT ============ */
.crm786-front {
	min-height: 100vh;
	background:
		radial-gradient(1200px 500px at 10% -10%, rgba(0, 255, 163, .10), transparent 60%),
		radial-gradient(1000px 500px at 100% 0%, rgba(255, 47, 208, .10), transparent 55%),
		radial-gradient(1000px 600px at 50% 120%, rgba(27, 107, 255, .14), transparent 60%),
		#050b18;
	margin: -30px -30px 0;
	padding: 0 0 40px;
}

.crm786-front-topbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 22px; background: rgba(4,12,26,.82); border-bottom: 1px solid rgba(0,255,163,.22); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 50; }
.crm786-front-brand { display: flex; align-items: center; gap: 10px; color: #eaf6ff; font-size: 15px; }
.crm786-front-logo { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; font-weight: 800; color: #001018; background: linear-gradient(135deg, var(--crm786-neon-green), var(--crm786-neon-blue)); box-shadow: 0 0 16px rgba(0,255,163,.5); }
.crm786-front-nav { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.crm786-front-navlink { display: inline-flex; align-items: center; gap: 7px; color: rgba(234,246,255,.78); text-decoration: none; font-weight: 600; font-size: 13px; padding: 8px 14px; border-radius: 999px; transition: background .2s, color .2s, box-shadow .2s; }
.crm786-front-navlink__ico { font-size: 15px; }
.crm786-front-navlink:hover { color: #fff; background: rgba(255,255,255,.06); }
.crm786-front-navlink.is-active { color: #001018; background: linear-gradient(90deg, var(--crm786-neon-green), var(--crm786-neon-blue)); box-shadow: 0 0 18px rgba(0,255,163,.4); }
.crm786-front-user { display: flex; align-items: center; gap: 12px; color: rgba(234,246,255,.85); font-size: 13px; }
.crm786-front-logout { color: var(--crm786-neon-fuchsia); text-decoration: none; font-weight: 700; border: 1px solid rgba(255,47,208,.5); padding: 6px 12px; border-radius: 999px; }
.crm786-front-logout:hover { background: rgba(255,47,208,.16); color: #ffd9f4; }

.crm786-front-main { padding: 22px; max-width: 1400px; margin: 0 auto; }
.crm786-front-foot { text-align: center; color: rgba(234,246,255,.45); font-size: 12px; padding: 10px 10px 24px; }

/* Ajustes sobre tarjetas dentro del fondo oscuro */
.crm786-front .wrap { margin: 0; }
.crm786-front .crm786-header h1 { color: #eaf6ff; }
.crm786-front .crm786-subtitle { color: rgba(234,246,255,.7); }
.crm786-front .crm786-header { border-bottom-color: rgba(0,255,163,.3); }
.crm786-front .crm786-tab { color: rgba(234,246,255,.7); }
.crm786-front .crm786-tab.is-active { color: #fff; border-bottom-color: var(--crm786-neon-green); }
.crm786-front .crm786-stat__label, .crm786-front .crm786-goal__label, .crm786-front .crm786-mini span { color: #4b5563; }

/* ============ MÓVIL: barra inferior tipo app ============ */
@media (max-width: 782px) {
	.crm786-front { margin: -12px -12px 0; padding-bottom: 78px; }
	.crm786-front-topbar { padding: 10px 14px; }
	.crm786-front-username { display: none; }
	.crm786-front-main { padding: 14px; }

	/* Nav se convierte en barra inferior fija con íconos */
	.crm786-front-nav {
		position: fixed;
		left: 0; right: 0; bottom: 0;
		z-index: 60;
		display: flex;
		justify-content: space-around;
		gap: 0;
		background: rgba(4, 12, 26, .96);
		border-top: 1px solid rgba(0, 255, 163, .25);
		padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
		backdrop-filter: blur(12px);
	}
	.crm786-front-navlink { flex-direction: column; gap: 2px; flex: 1; font-size: 10px; padding: 6px 2px; border-radius: 12px; text-align: center; }
	.crm786-front-navlink__ico { font-size: 19px; }
	.crm786-front-navlink.is-active { background: rgba(0,255,163,.16); color: var(--crm786-neon-green); box-shadow: none; }

	/* Tarjetas y tipografía más cómodas al tacto */
	.crm786-card { padding: 15px; border-radius: 16px; }
	.crm786-btn, .button { min-height: 40px; }
	.crm786-form input, .crm786-form select, .crm786-form textarea { font-size: 16px; } /* evita zoom iOS */
	.crm786-summary-grid { grid-template-columns: 1fr 1fr; }
	.crm786-wa { padding: 7px 12px; font-size: 13px; }
	.crm786-actions { gap: 12px; }
	.crm786-actions a { font-size: 13px; }
}

@media (max-width: 420px) {
	.crm786-summary-grid { grid-template-columns: 1fr; }
}

/* ================= v4 ================= */
/* Logo en la barra superior del front */
img.crm786-front-logo { width: auto; max-height: 34px; background: #fff; padding: 4px 6px; border-radius: 8px; box-shadow: none; }

/* FAQ en fondo oscuro */
.crm786-front .crm786-faq summary { color: #0f172a; }

/* Semántico: en front las tarjetas de ingreso ya son verdes; reforzamos texto */
.crm786-front .crm786-pos { color: #12b76a !important; }
.crm786-front .crm786-neg { color: #ff5d7a !important; }

@media (max-width: 782px) {
	/* Barra inferior con desplazamiento horizontal para todos los módulos */
	.crm786-front-nav {
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}
	.crm786-front-nav::-webkit-scrollbar { display: none; }
	.crm786-front-navlink { min-width: 62px; flex: 0 0 auto; }
	img.crm786-front-logo { max-height: 28px; }
}
