/* ============================================================
   LOGIN CON VIDRIO (NÚCLEO · Creando Gestión 1.17.0, 08/11/2026)
   Función 'login_vidrio' (cliente.php -> funciones). Tarjeta de vidrio con dos esquinas
   cortadas y redondeadas sobre el fondo animado del cliente (assets/fondo.js).
   Opciones en cliente.php -> 'login' => array('vidrio' => 'transparente'|'esmerilado', 'sonido' => true|false).
   La animación y el sonido de las transiciones están en assets/login-vidrio.js.
   ============================================================ */
body.cg-vidrio,body.cg-vidrio input,body.cg-vidrio button,body.cg-vidrio .btn{font-family:Inter,'Segoe UI',system-ui,-apple-system,sans-serif}
body.cg-vidrio{background:var(--grafito);background-image:none;position:relative;overflow-x:hidden}
body.cg-vidrio .bg-gradient{position:fixed;inset:0;z-index:0;pointer-events:none;
  background:
    radial-gradient(circle at 12% 110%, rgba(var(--azul-oscuro-rgb),.55) 0%, transparent 48%),
    radial-gradient(circle at 88% 105%, rgba(var(--azul-vivo-rgb),.22) 0%, transparent 46%),
    radial-gradient(circle at 70% -10%, rgba(var(--azul-oscuro-rgb),.30) 0%, transparent 45%),
    linear-gradient(180deg,var(--grafito-2) 0%,var(--grafito) 100%);
  animation:cgRespira 12s ease-in-out infinite}
@keyframes cgRespira{0%,100%{opacity:1}50%{opacity:.82}}
body.cg-vidrio #fondo-canvas{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:1}
body.cg-vidrio .bg-vineta{position:fixed;inset:0;z-index:1;pointer-events:none;
  background:radial-gradient(ellipse 55% 55% at 50% 48%, rgba(var(--grafito-rgb),.55) 0%, rgba(var(--grafito-rgb),.25) 55%, transparent 82%)}
body.cg-vidrio .franja{position:fixed;top:0;left:0;right:0;height:4px;background:var(--azul);z-index:6}

/* ---------- Tarjeta ---------- */
body.cg-vidrio .caja{--chaflan:46px;position:relative;z-index:2;max-width:440px;background:none;border:0;border-radius:0;
  box-shadow:none;padding:0;filter:drop-shadow(0 24px 50px rgba(0,0,0,.45))}
.cg-capa,.cg-reflejo{position:absolute;inset:0;border-radius:18px;transition:background .4s}
body[data-vidrio="esmerilado"] .cg-capa{background:linear-gradient(160deg,rgba(255,255,255,.10),rgba(255,255,255,.03) 45%,rgba(255,255,255,.06));
  backdrop-filter:blur(14px) saturate(150%);-webkit-backdrop-filter:blur(14px) saturate(150%)}
body[data-vidrio="transparente"] .cg-capa{background:linear-gradient(160deg,rgba(255,255,255,.07) 0%,rgba(255,255,255,0) 30%,rgba(0,0,0,.20) 60%,rgba(255,255,255,.05) 100%);
  backdrop-filter:saturate(120%) brightness(.8);-webkit-backdrop-filter:saturate(120%) brightness(.8)}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  body[data-vidrio] .cg-capa{background:rgba(var(--grafito-2-rgb),.93)}}
.cg-reflejo{pointer-events:none;display:none;
  background:linear-gradient(115deg,transparent 0 18%,rgba(255,255,255,.10) 22%,transparent 30%,transparent 62%,rgba(255,255,255,.05) 66%,transparent 72%)}
body[data-vidrio="transparente"] .cg-reflejo{display:block}
.cg-borde{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}
.cg-borde path{fill:none;stroke:rgba(255,255,255,.18);stroke-width:1}
body[data-vidrio="transparente"] .cg-borde path{stroke:rgba(255,255,255,.30)}
.cg-borde .cg-linea{stroke:var(--azul);stroke-width:2;opacity:.9}
.cg-esquirla{position:absolute;width:38px;height:38px;z-index:3;pointer-events:none;overflow:visible}
.cg-esquirla path{fill:url(#cgEsq);stroke:rgba(255,255,255,.35);stroke-width:1}
.cg-esquirla.sup{left:4px;top:4px}
.cg-esquirla.inf{right:4px;bottom:4px}
.cg-destello{position:absolute;left:50%;top:50%;width:14px;height:14px;margin:-7px 0 0 -7px;border-radius:50%;z-index:4;pointer-events:none;opacity:0;
  background:radial-gradient(circle,#fff 0,var(--azul-vivo) 45%,transparent 72%);box-shadow:0 0 30px 12px rgba(var(--azul-vivo-rgb),.55)}
.cg-contenido{position:relative;z-index:2;padding:34px 32px 28px}
body[data-vidrio="transparente"] .cg-contenido{text-shadow:0 1px 8px rgba(0,0,0,.6)}
.cg-sonido{position:absolute;right:14px;top:12px;z-index:5;width:30px;height:30px;margin:0;padding:0;border-radius:8px;
  background:transparent;border:1px solid transparent;color:rgba(255,255,255,.45);display:flex;align-items:center;justify-content:center;cursor:pointer}
.cg-sonido:hover{color:#fff;border-color:rgba(255,255,255,.2);filter:none}
.cg-sonido svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* ---------- Contenido ---------- */
body.cg-vidrio .marca{border-bottom-color:rgba(255,255,255,.10);padding-right:34px}
body.cg-vidrio .marca .logo{max-width:calc(100% - 140px);object-fit:contain;object-position:left center}
body.cg-vidrio .marca span{white-space:nowrap}
body.cg-vidrio h1{font-size:1.45rem;font-weight:700;letter-spacing:-.01em;margin-bottom:6px}
body.cg-vidrio p{color:#cfd6df}
body.cg-vidrio label{color:#d0d5dc;font-size:.8rem}
body.cg-vidrio input[type=email],body.cg-vidrio input[type=password],body.cg-vidrio input[type=text]{
  height:46px;padding:0 14px;border-radius:11px;border:1px solid rgba(255,255,255,.12);background-color:rgba(255,255,255,.05);
  transition:border-color .2s,box-shadow .2s}
body[data-vidrio="transparente"] input[type=email],body[data-vidrio="transparente"] input[type=password],body[data-vidrio="transparente"] input[type=text]{background-color:rgba(0,0,0,.38)}
body.cg-vidrio input:focus{border-color:rgba(var(--azul-vivo-rgb),.8);box-shadow:0 0 0 3px rgba(var(--azul-vivo-rgb),.2)}
body.cg-vidrio .codigo{height:56px !important}
.cg-clave{position:relative}
.cg-clave input{padding-right:44px !important}
.cg-ojo{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:34px;height:34px;margin:0;padding:0;border-radius:8px;background:transparent;
  border:0;color:#8d95a1;display:flex;align-items:center;justify-content:center;cursor:pointer}
.cg-ojo:hover{color:#fff;filter:none}
.cg-ojo svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
body.cg-vidrio button[type=submit],body.cg-vidrio .btn:not(.sec){height:48px;border-radius:11px;font-weight:600;
  background:linear-gradient(180deg,var(--azul-vivo),var(--azul) 55%,var(--azul-oscuro));
  box-shadow:0 0 26px rgba(var(--azul-rgb),.40),inset 0 1px 0 rgba(255,255,255,.35);transition:transform .15s,box-shadow .2s;text-shadow:0 1px 2px rgba(0,0,0,.25)}
body.cg-vidrio .btn:not(.sec){line-height:26px}
body.cg-vidrio button[type=submit]:hover,body.cg-vidrio .btn:not(.sec):hover{filter:none;box-shadow:0 0 38px rgba(var(--azul-rgb),.6),inset 0 1px 0 rgba(255,255,255,.35)}
body.cg-vidrio button[type=submit]:active,body.cg-vidrio .btn:active{transform:scale(.985)}
body.cg-vidrio .btn.sec{background:rgba(255,255,255,.05);border-color:rgba(255,255,255,.18)}
body.cg-vidrio .error{background:rgba(239,68,68,.16)}
body.cg-vidrio .secreto,body.cg-vidrio .respaldo div{background:rgba(0,0,0,.4)}
body.cg-vidrio .sello{position:relative;z-index:2}
body.cg-vidrio .cg-ocupado button[type=submit]{opacity:.75;pointer-events:none}

/* 1.17.0b: como la demo — título a dos colores, íconos y ejemplo dentro de los campos, recordar equipo, botones con flecha */
body.cg-vidrio h1 span{color:var(--azul-vivo)}
body.cg-vidrio input[type=email],body.cg-vidrio input[type=password],body.cg-vidrio input[type=text]{
  background-repeat:no-repeat;background-position:13px center;background-size:18px 18px;padding-left:42px}
body.cg-vidrio input[name=email]{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d95a1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E")}
body.cg-vidrio input[type=password],body.cg-vidrio .cg-clave input[type=text]{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d95a1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E")}
body.cg-vidrio input.codigo{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d95a1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E");background-size:22px 22px;background-position:16px center;padding-left:14px}
body.cg-vidrio input::placeholder{color:#6f7680;opacity:1}
body.cg-vidrio input.codigo::placeholder{color:rgba(255,255,255,.18)}
.cg-fila{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:14px}
body.cg-vidrio label.cg-check{display:flex;align-items:center;gap:8px;margin:0;font-size:.82rem;color:#cfd6df;cursor:pointer}
.cg-check input{width:16px;height:16px;margin:0;accent-color:var(--azul);cursor:pointer}
body.cg-vidrio .cg-ico{width:17px;height:17px;vertical-align:-3px;margin-left:4px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}

body.cg-vidrio a.cg-link{font-size:.82rem;color:var(--azul-vivo);text-decoration:none;white-space:nowrap}
body.cg-vidrio a.cg-link:hover{text-decoration:underline}
body.cg-vidrio .nota a{color:var(--azul-vivo);text-decoration:none}
body.cg-vidrio .nota a:hover{text-decoration:underline}
@media (max-width:400px){.cg-fila{flex-wrap:wrap}}

@media (max-width:480px){body.cg-vidrio .caja{--chaflan:36px}.cg-contenido{padding:30px 20px 24px}}
@media (prefers-reduced-motion:reduce){body.cg-vidrio .bg-gradient{animation:none}}
@media print{body.cg-vidrio .bg-gradient,body.cg-vidrio #fondo-canvas,body.cg-vidrio .bg-vineta,.cg-capa,.cg-reflejo,.cg-borde,.cg-esquirla,.cg-destello,.cg-sonido{display:none!important}
  body.cg-vidrio .caja{filter:none;border:1px solid #999}.cg-contenido{text-shadow:none!important}}
