:root{
  --bg:#0b1220;
  --card:#101a2e;
  --muted:#8ea0c6;
  --text:#e8eeff;
  --accent:#4f8cff;
  --accent2:#22c55e;
  --danger:#ff4d4d;
  --border:rgba(255,255,255,.10);
  --shadow: 0 20px 50px rgba(0,0,0,.35);
  --radius:18px;
  --font: system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:
    radial-gradient(1000px 600px at 10% 10%, rgba(79,140,255,.25), transparent 55%),
    radial-gradient(900px 600px at 90% 20%, rgba(34,197,94,.18), transparent 55%),
    radial-gradient(900px 600px at 50% 90%, rgba(255,77,77,.10), transparent 55%),
    var(--bg);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}

/* ================= BACKGROUND CANVAS ================= */
.bg-canvas{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ================= LAYOUT ================= */
.auth-wrap{
  width:100%;
  max-width:420px;
  position:relative;
  z-index:2;
}

.brand{
  display:flex;
  align-items:flex-start;
  gap:12px;
  margin-bottom:18px;
  position:relative;
  z-index:3;
}

.logo{
  width: 90px;        /* ↑ aquí lo haces más grande */
  height: 90px;       /* ↑ aquí también */
  border-radius: 18px;
  object-fit: contain;
  box-shadow: 0 10px 30px rgba(79,140,255,.35);
  flex: 0 0 auto;
  background: transparent; /* quita el fondo si estorba */
}


/* ================= SCANNER BRAND ================= */
.brand-scan{
  position: relative;
  z-index: 3;
}

/* contenedor del bloque de brand (radar + scan box) */
.brand-scan{
  display:flex;
  gap:12px;
  align-items:flex-start;
}

/* zona derecha (radar arriba + scan-box abajo) */
.brand-scan .brand-stack{
  display:flex;
  flex-direction:column;
  width:100%;
}

/* ================= RADAR SUPERIOR ================= */
.radar-wrap{
  width:100%;
  display:flex;
  justify-content:center;
  margin-bottom:10px;
}

.radar-img{
  width:58px;
  height:58px;
  animation: radarPulse 3s ease-in-out infinite;
  filter:
    drop-shadow(0 0 10px rgba(79,140,255,.65))
    drop-shadow(0 0 22px rgba(0,255,200,.35));
}

@keyframes radarPulse{
  0%{ transform: scale(1); opacity:.85; }
  50%{ transform: scale(1.08); opacity:1; }
  100%{ transform: scale(1); opacity:.85; }
}


/* ================= SCAN BOX ================= */
.brand-scan .scan-box{
  position: relative;
  min-height: 56px;
  padding: 10px 16px;
  border-radius: 16px;

  border: 1px solid rgba(79,140,255,.45);
  background: linear-gradient(
    180deg,
    rgba(12,22,42,.85),
    rgba(12,22,42,.60)
  );

  overflow: hidden;

  /* 👇 ESTO ES LO IMPORTANTE */
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}


/* brillo interno (HUD) */
.brand-scan .scan-box::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 30% 50%, rgba(79,140,255,.22), transparent 55%),
    radial-gradient(circle at 70% 50%, rgba(0,255,200,.18), transparent 60%);
  pointer-events:none;
  animation: scanPulse 3s ease-in-out infinite;
}

@keyframes scanPulse{
  0%{ opacity:.45; }
  50%{ opacity:.95; }
  100%{ opacity:.45; }
}

.scan-title{
  font-weight:700;
  font-size:15px;
  text-shadow: 0 0 12px rgba(79,140,255,.65);
}

.scan-sub{
  color:var(--muted);
  font-size:12px;
  margin-top:2px;
}

/* línea de escaneo visible */
.scan-line{
  position: absolute;
  top: 0;
  left: -120%;
  width: 120%;
  height: 100%;

  background: linear-gradient(
    90deg,
    transparent,
    rgba(0,255,200,.25),
    rgba(0,255,255,.55),
    rgba(79,140,255,.75),
    rgba(0,255,255,.55),
    rgba(0,255,200,.25),
    transparent
  );

  filter: blur(2.5px);
  opacity: .9;

  transform: skewX(-25deg);
  animation: scanHUD 2.8s linear infinite;
}

@keyframes scanHUD{
  0%{
    transform: translateX(-140%) skewX(-25deg);
    opacity: 0;
  }
  20%{ opacity: 1; }
  80%{ opacity: 1; }
  100%{
    transform: translateX(340%) skewX(-25deg);
    opacity: 0;
  }
}

/* ================= CARD ================= */
.card{
  background: linear-gradient(180deg, rgba(16,26,46,.92), rgba(16,26,46,.78));
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:22px;
  backdrop-filter: blur(8px);
  position:relative;
  overflow:hidden;
}

.card h2{
  margin:0 0 6px 0;
  font-size:20px;
}

.card .sub{
  margin:0 0 16px 0;
  color:var(--muted);
  font-size:13px;
  line-height:1.4;
}

/* ================= INPUTS ================= */
.field{ margin:12px 0; }

label{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px;
}

.input-wrap{ position:relative; }

.input{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.18);
  color:var(--text);
  outline:none;
}

.input:focus{
  border-color: rgba(79,140,255,.55);
  box-shadow: 0 0 0 4px rgba(79,140,255,.15);
}

.input-ico{
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
  color:rgba(232,238,255,.75);
  pointer-events:none;
}

.input-ico-pad{ padding-left:40px; }

.peek{
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.22);
  color: rgba(232,238,255,.85);
  border-radius:10px;
  padding:6px 8px;
  cursor:pointer;
}

/* ================= BUTTON ================= */
.btn{
  width:100%;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(79,140,255,.45);
  background: rgba(79,140,255,.18);
  color:var(--text);
  font-weight:600;
  cursor:pointer;
}

.btn:hover{
  background: rgba(79,140,255,.28);
  border-color: rgba(79,140,255,.70);
}

/* ================= POPUPS ================= */
.popup{
  position: fixed;
  inset: 0;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding-top:22px;
  z-index:9999;
  opacity:0;
  pointer-events:none;
  transform: translateY(-12px) scale(.96);
  transition: opacity .25s ease, transform .25s ease;
}

.popup.show{
  opacity:1;
  pointer-events:auto;
  transform: translateY(0) scale(1);
}

.popup-card{
  width:min(520px, calc(100% - 28px));
  display:flex;
  align-items:center;
  gap:14px;
  padding:14px 16px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  animation: popupIn .35s ease-out both;
}

.popup-card.ok{
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.35);
}

.popup-card.danger{
  background: rgba(255,77,77,.14);
  border-color: rgba(255,77,77,.35);
}

@keyframes popupIn{
  from{
    opacity:0;
    transform: translateY(-10px) scale(.95);
  }
  to{
    opacity:1;
    transform: translateY(0) scale(1);
  }
}

/* ================= LOCK ANIMATION ================= */
.lock-open .shackle{
  transform-origin: 12px 10px;
  animation: unlock 1.6s cubic-bezier(.2,.8,.2,1) forwards;
}

@keyframes unlock{
  0%{ transform: rotate(0deg) translateX(0); }
  60%{ transform: rotate(-35deg) translateX(-4px); }
  100%{ transform: rotate(-45deg) translateX(-6px); }
}

/* ================= FOOTER ================= */
.footer{
  margin-top:12px;
  text-align:center;
  color:var(--muted);
  font-size:12px;
}
.hint{
  margin-top:8px;
  font-size:12px;
  color: var(--muted);
}
.hint.bad{ color: #ffb3b3; }
.hint.ok{ color: #bff7d2; }

.alert.err{
  background: rgba(255,77,77,.14);
  border-color: rgba(255,77,77,.35);
  color: #ffd0d0;
}
