/* ═══════════════════════════════════════
   SISTEMA RED — PORTAL DE ACESSO
   ═══════════════════════════════════════ */

:root {
  --red:    #D40000;
  --red2:   #FF1111;
  --bg:     #000;
  --s1:     #080000;
  --s2:     #0f0000;
  --s3:     #141414;
  --border: rgba(212,0,0,0.3);
  --text:   #fff;
  --dim:    rgba(255,255,255,0.45);
  --radius: 16px;
  --font:   'Wix Madefor Text', sans-serif;
  --mono:   'JetBrains Mono', monospace;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── FUNDO ── */
#bg-particles {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  overflow: hidden;
}
.particle {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(212,0,0,0.55) 0%, transparent 70%);
  animation: pfloat linear infinite;
  opacity: 0;
}
@keyframes pfloat {
  0%   { transform: translateY(105vh) scale(0); opacity: 0; }
  8%   { opacity: 0.8; }
  92%  { opacity: 0.3; }
  100% { transform: translateY(-5vh) scale(1.3); opacity: 0; }
}

.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(212,0,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,0,0,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

/* ── LAYOUT ── */
.container {
  position: relative; z-index: 1;
  height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px;
  gap: 28px;
}

/* ── LOGO ── */
.logo-wrap {
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  opacity: 0; animation: logoIn .8s cubic-bezier(.16,1,.3,1) .1s forwards;
}
@keyframes logoIn {
  from { opacity:0; transform: translateY(-16px) scale(.95); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}

.logo-img {
  width: 120px;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(212,0,0,0.6)) drop-shadow(0 0 40px rgba(212,0,0,0.3));
  animation: logoPulse 2.5s ease-in-out infinite;
}
@keyframes logoPulse {
  0%,100% { filter: drop-shadow(0 0 15px rgba(212,0,0,0.5)) drop-shadow(0 0 30px rgba(212,0,0,0.2)); }
  50%     { filter: drop-shadow(0 0 28px rgba(212,0,0,0.85)) drop-shadow(0 0 55px rgba(212,0,0,0.4)); }
}
.logo-sub {
  font-size: 10px; letter-spacing: 4px; color: rgba(212,0,0,0.7);
  text-transform: uppercase; font-weight: 800;
}

/* ── BOX ── */
.box {
  width: 100%; max-width: 380px;
  background: linear-gradient(145deg, #0a0000 0%, #0d0d0d 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: 0 20px 60px rgba(212,0,0,0.12), 0 0 0 1px rgba(255,255,255,0.03);
  position: relative; overflow: hidden;
  opacity: 0; animation: boxIn .6s cubic-bezier(.16,1,.3,1) .35s forwards;
}
@keyframes boxIn {
  from { opacity:0; transform: translateY(20px) scale(.98); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}
.box::before {
  content: '';
  position: absolute; top:0; left:-100%; width:60%; height:1px;
  background: linear-gradient(90deg, transparent, rgba(212,0,0,0.7), transparent);
  animation: topSweep 4s linear infinite;
}
@keyframes topSweep {
  0%   { left:-60%; }
  100% { left:160%; }
}
.box::after {
  content: '';
  position: absolute; inset:0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(212,0,0,0.05) 0%, transparent 60%);
  pointer-events: none;
}

.box-header {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 24px;
}
.box-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 8px var(--red);
}
.box-label {
  font-size: 11px; font-weight: 900; letter-spacing: 4px;
  color: rgba(212,0,0,0.9); text-transform: uppercase;
  text-shadow: 0 0 10px rgba(212,0,0,0.4);
}

/* ── CAMPOS ── */
.field-wrap { margin-bottom: 14px; }
.field-label {
  display: block; font-size: 9px; font-weight: 800;
  letter-spacing: 3px; color: var(--dim);
  text-transform: uppercase; margin-bottom: 7px;
}
.field-inner {
  position: relative;
}
.field-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: rgba(212,0,0,0.5);
  pointer-events: none;
}
.field-inner input {
  width: 100%; padding: 14px 14px 14px 42px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; color: var(--text);
  font-size: 14px; font-family: var(--font);
  outline: none; transition: all .2s ease;
  -webkit-appearance: none;
}
.field-inner input:focus {
  border-color: var(--red);
  background: rgba(212,0,0,0.04);
  box-shadow: 0 0 0 3px rgba(212,0,0,0.1);
}
.field-inner input::placeholder { color: rgba(255,255,255,0.2); }

/* ── ERRO ── */
.error-msg {
  font-size: 12px; color: #ff5555;
  text-align: center; min-height: 18px;
  margin-bottom: 10px; font-weight: 600;
  opacity: 0; transition: opacity .2s;
}
.error-msg.visible { opacity: 1; }

/* ── BOTÕES ── */
.btn-primary {
  width: 100%; padding: 16px;
  background: linear-gradient(to bottom, #D40000 0%, #800000 100%);
  border: none; border-radius: 12px;
  color: #fff; font-size: 13px; font-weight: 800;
  letter-spacing: 2px; font-family: var(--font);
  cursor: pointer; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 6px 25px rgba(212,0,0,0.45);
  transition: all .2s ease;
}
.btn-primary:hover {
  box-shadow: 0 8px 35px rgba(212,0,0,0.65);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: scale(.97) translateY(0);
  box-shadow: 0 3px 12px rgba(212,0,0,0.3);
}
.btn-primary::before {
  content:''; position:absolute; top:-50%; left:-50%;
  width:200%; height:200%;
  background: rgba(255,255,255,0.05);
  transform: rotate(45deg);
  animation: btnShine 4s linear infinite;
}
@keyframes btnShine {
  0%   { left:-150%; }
  20%  { left: 150%; }
  100% { left: 150%; }
}
.btn-primary svg { width:18px; height:18px; flex-shrink:0; }

.btn-sec {
  width: 100%; padding: 14px;
  background: transparent;
  border: 1px solid rgba(212,0,0,0.25);
  border-radius: 12px; color: rgba(212,0,0,0.7);
  font-size: 12px; font-weight: 700; letter-spacing: 2px;
  font-family: var(--font); cursor: pointer;
  margin-top: 10px; transition: all .2s ease;
}
.btn-sec:hover { border-color: var(--red); color: var(--red); }
.btn-sec:active { opacity: .7; transform: scale(.97); }

/* ── LOADER ── */
.btn-loader { display: flex; align-items: center; justify-content: center; }
.btn-loader.hidden { display: none; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── BARRA DE SEGURANÇA ── */
.security-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-top: 16px;
  font-size: 10px; color: rgba(255,255,255,0.2);
  font-weight: 600; letter-spacing: .5px;
}
.security-bar svg { width: 11px; height: 11px; color: rgba(212,0,0,0.4); }

/* ── BOX DE CHAVE ── */
.key-success-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(48,209,88,0.1);
  border: 2px solid rgba(48,209,88,0.4);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 0 25px rgba(48,209,88,0.2);
  animation: successPop .5s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes successPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.key-success-icon svg { width: 26px; height: 26px; color: #30D158; stroke-width: 2.5; }

.key-title {
  font-size: 16px; font-weight: 900; letter-spacing: 3px;
  color: var(--text); text-align: center; margin-bottom: 6px;
}
.key-sub {
  font-size: 11px; color: var(--dim); text-align: center;
  margin-bottom: 24px; line-height: 1.5;
}

.key-display {
  position: relative; margin-bottom: 16px;
}
.key-label {
  font-size: 9px; font-weight: 800; letter-spacing: 3px;
  color: rgba(212,0,0,0.5); text-transform: uppercase;
  margin-bottom: 8px;
}
.key-display input {
  width: 100%; padding: 16px 14px;
  background: #000;
  border: 1px dashed rgba(212,0,0,0.5);
  border-radius: 12px;
  color: var(--red); font-family: var(--mono);
  font-size: 15px; font-weight: 700;
  text-align: center; letter-spacing: 2px;
  outline: none; cursor: default;
  box-shadow: inset 0 0 20px rgba(212,0,0,0.05);
  animation: keyGlow 2s ease-in-out infinite;
}
@keyframes keyGlow {
  0%,100% { box-shadow: inset 0 0 15px rgba(212,0,0,0.04), 0 0 10px rgba(212,0,0,0.08); }
  50%     { box-shadow: inset 0 0 25px rgba(212,0,0,0.08), 0 0 20px rgba(212,0,0,0.15); }
}
.key-glow {
  position: absolute; inset:0; border-radius: 12px;
  background: radial-gradient(ellipse at 50% 0%, rgba(212,0,0,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.key-warning {
  font-size: 11px; color: rgba(255,215,0,0.6);
  text-align: center; margin-top: 14px; line-height: 1.5;
}

/* ── HIDDEN ── */
.hidden { display: none !important; }

/* ── BADGE CHAVE EXISTENTE ── */
.key-existing-badge {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-bottom: 16px;
  padding: 8px 14px;
  background: rgba(255,215,0,0.08);
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 8px;
  font-size: 11px; font-weight: 700;
  color: rgba(255,215,0,0.8);
  letter-spacing: 0.5px;
  animation: badgeFadeIn .4s ease both;
}
@keyframes badgeFadeIn {
  from { opacity:0; transform: translateY(-4px); }
  to   { opacity:1; transform: translateY(0); }
}

/* ── BOTÃO ESQUECI SENHA ── */
.btn-forgot {
  width: 100%; padding: 10px;
  background: transparent; border: none;
  color: rgba(212,0,0,0.5);
  font-size: 12px; font-weight: 700;
  font-family: var(--font); letter-spacing: 1px;
  cursor: pointer; margin-top: 4px;
  transition: color .2s ease;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(212,0,0,0.2);
}
.btn-forgot:hover {
  color: rgba(212,0,0,0.85);
  text-decoration-color: rgba(212,0,0,0.5);
}
.btn-forgot:active { opacity: .7; }
