:root {
  --bg:             #020508;
  --phosphor:       #4dc8ff;
  --phosphor-dim:   #1a4a66;
  --phosphor-bright:#b6eeff;
  --phosphor-glow:  rgba(77,200,255,0.35);
  --glass-tint:     rgba(77,200,255,0.05);
  --warn:           #ff6b3b;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #000;
  font-family: 'Share Tech Mono', monospace;
  overflow: hidden;
}

/* ── BEZEL ── */
.crt-bezel {
  width: 100vw; height: 100vh;
  background: radial-gradient(ellipse at center, #040d1488 0%, #000 100%);
  display: flex; align-items: center; justify-content: center;
}

/* ── PANTALLA ── */
.screen {
  position: relative;
  width: min(96vw, 900px);
  height: min(90vh, 620px);
  background: radial-gradient(ellipse at 50% 40%, #040e1a 0%, var(--bg) 65%, #010305 100%);
  border-radius: 16px;
  box-shadow:
    0 0 0 10px #030608,
    0 0 0 14px #0d1a24,
    0 0 70px 12px rgba(77,200,255,0.07),
    inset 0 0 120px rgba(0,0,0,0.88);
  overflow: hidden;
  color: var(--phosphor);
}

/* curvatura de vidrio */
.screen::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 52%, rgba(0,0,0,0.6) 100%);
  pointer-events: none; z-index: 6;
}

/* ── SCANLINES ── */
.scanlines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0)   0px,
    rgba(0,0,0,0)   1px,
    rgba(0,0,0,0.38) 2px,
    rgba(0,0,0,0.38) 3px
  );
  pointer-events: none; z-index: 5; mix-blend-mode: multiply;
}

/* ── BARRIDO ── */
.scan-sweep {
  position: absolute; left: 0; right: 0; height: 130px;
  background: linear-gradient(to bottom,
    rgba(180,235,255,0) 0%,
    rgba(180,235,255,0.045) 50%,
    rgba(180,235,255,0) 100%
  );
  animation: sweep 8s linear infinite;
  pointer-events: none; z-index: 4;
}
@keyframes sweep { 0%{ top:-130px; } 100%{ top:100%; } }

/* ── PARPADEO ── */
.flicker {
  position: absolute; inset: 0;
  background: rgba(77,200,255,0.015);
  animation: flick 9s infinite;
  pointer-events: none; z-index: 3;
}
@keyframes flick {
  0%,94%,100%{ opacity:1; }
  95%{ opacity:0.74; }
  96%{ opacity:0.9; }
  97%{ opacity:0.55; }
  98%{ opacity:0.85; }
}

/* ── RUIDO DE FONDO ── */
.noise {
  position: absolute; inset: 0;
  opacity: 0.018;
  pointer-events: none; z-index: 2;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ── CONTENIDO ── */
.content {
  position: relative; z-index: 2;
  height: 100%;
  padding: 38px 48px;
  font-size: 16px;
  line-height: 1.6;
  text-shadow: 0 0 3px var(--phosphor), 0 0 10px var(--phosphor-glow);
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
}

/* ── TERMINAL TEXT ── */
#terminal-output {
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.65;
}
.t-line { opacity: 0; animation: appear .04s forwards; }
@keyframes appear { to { opacity: 1; } }

.t-dim   { color: var(--phosphor-dim); }
.t-bright{ color: var(--phosphor-bright); }
.t-warn  { color: var(--warn); }

/* cursor parpadeante */
.cursor {
  display: inline-block;
  width: 9px; height: 15px;
  background: var(--phosphor);
  box-shadow: 0 0 6px var(--phosphor);
  vertical-align: -2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50%{ opacity:0; } }

/* barra de carga */
.bar-container {
  display: inline-block;
  font-size: 15px;
  letter-spacing: 0;
}
.bar-track { color: var(--phosphor-dim); }
.bar-fill  { color: var(--phosphor-bright); text-shadow: 0 0 6px var(--phosphor); }
.bar-pct   { color: var(--phosphor); margin-left: 8px; }

/* ── CREDENCIALES ── */
#credentials {
  display: flex; align-items: center; justify-content: center;
  height: 100%;
}
.cred-wrapper {
  text-align: center;
  animation: fadeIn .8s ease forwards;
}
@keyframes fadeIn { from{ opacity:0; transform: translateY(8px); } to{ opacity:1; transform:translateY(0); } }

.cred-label {
  font-family: 'VT323', monospace;
  font-size: 28px;
  letter-spacing: 3px;
  color: var(--phosphor-bright);
  text-shadow: 0 0 8px var(--phosphor), 0 0 22px var(--phosphor-glow);
  margin-bottom: 18px;
}
.cred-divider {
  color: var(--phosphor-dim);
  font-size: 14px;
  letter-spacing: 1px;
  margin: 10px 0;
}
.cred-field {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  padding: 7px 0;
}
.cred-key {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--phosphor-dim);
  text-align: left;
  flex-shrink: 0;
}
.cred-val {
  font-family: 'VT323', monospace;
  font-size: 26px;
  color: var(--phosphor-bright);
  text-shadow: 0 0 8px var(--phosphor), 0 0 20px var(--phosphor-glow);
  letter-spacing: 3px;
  animation: glowPulse 2.8s ease-in-out infinite;
}
@keyframes glowPulse {
  0%,100%{ text-shadow: 0 0 8px var(--phosphor), 0 0 20px var(--phosphor-glow); }
  50%{ text-shadow: 0 0 14px var(--phosphor), 0 0 36px var(--phosphor-glow); }
}
.cred-human {
  margin-top: 28px;
  font-size: 14px;
  color: var(--phosphor);
  letter-spacing: 1px;
  font-style: italic;
  opacity: 0;
  animation: fadeIn 1s ease 0.5s forwards;
}
.cred-stamp {
  margin-top: 20px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--phosphor-dim);
  opacity: 0;
  animation: fadeIn 1s ease 1.2s forwards;
}

@media (max-width: 600px) {
  .content { padding: 24px 22px; }
  .cred-val { font-size: 22px; }
  .cred-label { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .scan-sweep, .flicker, .cursor, .cred-val { animation: none !important; }
}
