/* ═══════════════════════════════════════════════════
   T.U. BUNKER — LOGIN PANEL
   Compatible Scriptcase: markups [login] [msgLogin]
   [user] [pass] [submit] [newPass]
═══════════════════════════════════════════════════ */
:root {
  --navy-deep:  #060e1a;
  --navy:       #0c243c;
  --navy-mid:   #183048;
  --steel:      #304860;
  --steel-lt:   #486078;
  --silver:     #7a9bb5;
  --silver-lt:  #b0c8d8;
  --plate:      #cfd8e0;
  --orange:     #e68c28;
  --orange-lt:  #f0a840;
  --orange-dk:  #c0700a;
  --orange-glow:rgba(230,140,40,0.18);
  --white:      #eef4f8;
  --glass:      rgba(12,36,60,0.75);
  --hex-stroke: rgba(72,96,120,0.25);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--navy-deep);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* ── Fondo hexagonal ── */
.hex-bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
}
.hex-bg svg {
  width: 100%; height: 100%;
  opacity: 1;
}

/* ── Gradiente de ambiente ── */
.ambient {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 30% 40%, rgba(24,48,72,0.7) 0%, transparent 65%),
    radial-gradient(ellipse 50% 50% at 75% 70%, rgba(6,14,26,0.9) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 50% 10%, rgba(230,140,40,0.04) 0%, transparent 60%);
}

/* ── Contenedor principal ── */
.bunker-wrap {
  position: relative; z-index: 10;
  display: grid;
  grid-template-columns: 300px 1fr;
  width: min(860px, 95vw);
  min-height: 580px;
  border-radius: 4px;
  overflow: hidden;
  animation: deployIn 0.9s cubic-bezier(.16,1,.3,1) both;

  /* Marco blindado */
  box-shadow:
    0 0 0 1px rgba(230,140,40,0.35),
    0 0 0 3px rgba(12,36,60,0.9),
    0 0 0 4px rgba(72,96,120,0.3),
    0 0 60px rgba(230,140,40,0.08),
    0 40px 80px rgba(0,0,0,0.7);
}

/* Esquinas decorativas del panel blindado */
.bunker-wrap::before,
.bunker-wrap::after {
  content: '';
  position: absolute;
  width: 24px; height: 24px;
  border-color: var(--orange);
  border-style: solid;
  z-index: 20;
}
.bunker-wrap::before { top: -1px; left: -1px; border-width: 3px 0 0 3px; }
.bunker-wrap::after  { bottom: -1px; right: -1px; border-width: 0 3px 3px 0; }

@keyframes deployIn {
  from { opacity:0; transform: translateY(28px) scale(0.96); filter: blur(4px); }
  to   { opacity:1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* ══════════════════════════════
   PANEL IZQUIERDO — IDENTIDAD
══════════════════════════════ */
.id-panel {
  background: linear-gradient(160deg, #0c243c 0%, #060e1a 100%);
  border-right: 1px solid rgba(230,140,40,0.2);
  padding: 40px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

/* Líneas de escaneo */
.id-panel::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(72,96,120,0.025) 3px,
    rgba(72,96,120,0.025) 4px
  );
  pointer-events: none;
}

.id-top { position: relative; z-index: 1; }

/* Logo hexagonal SVG */
.logo-hex {
  width: 80px; height: 80px; margin: 0 auto 20px;
  display: block;
  filter: drop-shadow(0 0 12px rgba(230,140,40,0.3));
  animation: pulseLock 3s ease-in-out infinite;
}
@keyframes pulseLock {
  0%,100% { filter: drop-shadow(0 0 10px rgba(230,140,40,0.25)); }
  50%      { filter: drop-shadow(0 0 22px rgba(230,140,40,0.55)); }
}

.brand-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 26px; font-weight: 700;
  color: var(--white);
  text-align: center;
  letter-spacing: 4px;
  margin-bottom: 4px;
}
.brand-name span { color: var(--orange); }

.brand-tagline {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: var(--silver);
  text-align: center;
  letter-spacing: 2px;
  margin-bottom: 28px;
}

.divider-hex {
  display: flex; align-items: center; gap: 8px; margin-bottom: 24px;
}
.divider-hex::before, .divider-hex::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230,140,40,0.3), transparent);
}
.divider-hex-icon {
  font-size: 10px; color: var(--orange); opacity: 0.6;
}

.status-block {
  background: rgba(48,72,96,0.2);
  border: 1px solid rgba(72,96,120,0.2);
  border-radius: 3px;
  padding: 12px;
  margin-bottom: 16px;
}
.status-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.status-row:last-child { margin-bottom: 0; }
.status-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  animation: blink 2s ease-in-out infinite;
}
.status-dot.green  { background: #4caf82; box-shadow: 0 0 6px #4caf82; }
.status-dot.orange { background: var(--orange); box-shadow: 0 0 6px var(--orange); animation-delay: .5s; }
.status-dot.blue   { background: var(--silver); box-shadow: 0 0 4px var(--silver); animation-delay: 1s; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.4} }
.status-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px; color: var(--silver-lt);
  letter-spacing: 1px;
}
.status-val {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px; color: var(--plate);
  margin-left: auto;
}

.id-bottom { position: relative; z-index: 1; }

.security-level {
  text-align: center;
  margin-bottom: 12px;
}
.sec-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px; color: var(--silver); letter-spacing: 2px; display: block; margin-bottom: 6px;
}
.sec-bars {
  display: flex; gap: 3px; justify-content: center;
}
.sec-bar {
  width: 18px; height: 6px; border-radius: 1px;
  background: var(--orange);
  opacity: 0.9;
}
.sec-bar.dim { opacity: 0.15; background: var(--steel); }

.id-footer {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px; color: rgba(122,155,181,0.35);
  text-align: center; letter-spacing: 1px;
  line-height: 1.8;
}

/* ══════════════════════════════
   PANEL DERECHO — FORMULARIO
══════════════════════════════ */
.form-panel {
  background: linear-gradient(170deg, #0d1e30 0%, #060e1a 100%);
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Esquinas interiores del form */
.form-panel::before {
  content: '';
  position: absolute; top: 12px; right: 12px;
  width: 16px; height: 16px;
  border-top: 2px solid rgba(230,140,40,0.3);
  border-right: 2px solid rgba(230,140,40,0.3);
}

.access-header {
  margin-bottom: 28px;
}
.access-tag {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px; color: var(--orange);
  letter-spacing: 3px;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.access-tag::before {
  content: '';
  width: 20px; height: 1px; background: var(--orange); opacity: 0.5;
}
.access-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 26px; font-weight: 700;
  color: var(--white);
  letter-spacing: 1px;
}
.access-sub {
  font-size: 12px; color: var(--silver);
  margin-top: 4px;
}

/* ── Mensajes error Scriptcase ── */
[msgLogin],
.sc-error, .nmsg, .login-error, [class*="nmsg"] {
  background: rgba(180,40,40,0.12);
  border: 1px solid rgba(220,60,60,0.3);
  border-left: 3px solid #e05050;
  border-radius: 3px;
  padding: 10px 14px;
  font-size: 12px; color: #f08080;
  margin-bottom: 16px;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.5px;
}

/* ── Grupos de campo ── */
.field-group { margin-bottom: 18px; }

.field-label {
  display: flex; align-items: center; gap: 6px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px; color: var(--silver);
  letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 8px;
}
.field-label-icon { color: var(--orange); font-size: 11px; }

.field-wrap { position: relative; }
.field-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--steel-lt); font-size: 14px; pointer-events: none;
  transition: color .2s;
}
.field-wrap:focus-within .field-icon { color: var(--orange); }

/* Input styles — override Scriptcase */
.field-wrap input,
.field-wrap input[type="text"],
.field-wrap input[type="password"],
.field-wrap input[type="number"] {
  width: 100%;
  background: rgba(12,36,60,0.6);
  border: 1px solid rgba(72,96,120,0.3);
  border-bottom: 2px solid rgba(72,96,120,0.4);
  border-radius: 3px;
  padding: 12px 14px 12px 40px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  color: var(--plate);
  outline: none;
  transition: all .2s;
  letter-spacing: 1px;
  -webkit-appearance: none;
}
.field-wrap input::placeholder { color: rgba(122,155,181,0.3); letter-spacing: 1px; }
.field-wrap input:focus {
  border-color: rgba(230,140,40,0.4);
  border-bottom-color: var(--orange);
  background: rgba(12,36,60,0.85);
  box-shadow: 0 0 0 3px rgba(230,140,40,0.06), inset 0 1px 0 rgba(230,140,40,0.04);
  color: var(--white);
}
.field-wrap input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0px 1000px rgba(12,36,60,0.95) inset !important;
  -webkit-text-fill-color: var(--plate) !important;
}

/* ── 2FA Block ── */
.twofa-block {
  background: rgba(48,72,96,0.15);
  border: 1px solid rgba(72,96,120,0.2);
  border-left: 2px solid rgba(230,140,40,0.4);
  border-radius: 3px;
  padding: 14px;
  margin-bottom: 20px;
}
.twofa-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.twofa-icon { font-size: 14px; }
.twofa-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--orange); letter-spacing: 1px;
}
.twofa-desc {
  font-size: 11px; color: var(--silver);
  margin-bottom: 10px; line-height: 1.5;
}
.twofa-inputs {
  display: flex; gap: 6px;
}
.twofa-digit {
  flex: 1;
  background: rgba(6,14,26,0.7);
  border: 1px solid rgba(72,96,120,0.3);
  border-bottom: 2px solid rgba(72,96,120,0.4);
  border-radius: 3px;
  height: 44px;
  text-align: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px; font-weight: 700;
  color: var(--orange);
  outline: none;
  transition: all .15s;
  caret-color: var(--orange);
  -webkit-appearance: none;
}
.twofa-digit:focus {
  border-color: rgba(230,140,40,0.5);
  border-bottom-color: var(--orange);
  background: rgba(12,36,60,0.9);
  box-shadow: 0 0 0 2px rgba(230,140,40,0.08);
}
.twofa-sep {
  display: flex; align-items: center;
  color: rgba(122,155,181,0.3);
  font-size: 18px; font-family: 'Rajdhani', sans-serif;
}

/* ── Botón Login ── */
.btn-login,
input[type="submit"],
button[type="submit"] {
  width: 100%;
  background: linear-gradient(135deg, var(--orange-dk) 0%, var(--orange) 50%, var(--orange-lt) 100%);
  background-size: 200% 100%;
  background-position: 100% 0;
  border: none;
  border-radius: 3px;
  padding: 14px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px; font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #0a1a08;
  cursor: pointer;
  margin-top: 4px;
  position: relative;
  overflow: hidden;
  transition: all .3s;
  box-shadow:
    0 4px 20px rgba(230,140,40,0.25),
    0 1px 0 rgba(255,255,255,0.1) inset;
}
.btn-login::before,
input[type="submit"]::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 60%);
  transition: opacity .2s;
}
.btn-login:hover,
input[type="submit"]:hover {
  background-position: 0 0;
  transform: translateY(-2px);
  box-shadow:
    0 8px 30px rgba(230,140,40,0.4),
    0 0 40px rgba(230,140,40,0.15),
    0 1px 0 rgba(255,255,255,0.15) inset;
}
.btn-login:active,
input[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(230,140,40,0.3);
}

/* ── Links inferiores ── */
.form-links {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px;
}
.form-link {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px; color: var(--steel-lt);
  text-decoration: none; letter-spacing: 1px;
  transition: color .2s;
}
.form-link:hover { color: var(--orange); }

/* ── Footer del form ── */
.form-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(72,96,120,0.15);
  display: flex; align-items: center; justify-content: space-between;
}
.footer-enc {
  display: flex; align-items: center; gap: 6px;
}
.footer-enc-icon { font-size: 11px; color: var(--orange); opacity: 0.6; }
.footer-enc-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px; color: rgba(122,155,181,0.35); letter-spacing: 1px;
}
.footer-ver {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px; color: rgba(122,155,181,0.2); letter-spacing: 1px;
}

/* ── Barra de progreso al submit ── */
.scan-bar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--orange) 50%, transparent 100%);
  background-size: 200% 100%;
  display: none;
  animation: scan 1s linear infinite;
}
@keyframes scan {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .bunker-wrap { grid-template-columns: 1fr; }
  .id-panel { display: none; }
  .form-panel { padding: 36px 24px; }
}
/* ── Fix selector de idioma Scriptcase ── */
#id_sc_field_language,
select.sc-js-input[name="language"] {
    background: rgba(12,36,60,0.6) !important;
    border: 1px solid rgba(72,96,120,0.3) !important;
    border-bottom: 2px solid rgba(72,96,120,0.4) !important;
    border-radius: 3px !important;
    padding: 5px 28px 5px 10px !important;
    font-family: 'Share Tech Mono', monospace !important;
    font-size: 10px !important;
    color: var(--silver-lt) !important;
    letter-spacing: 1px !important;
    outline: none !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='#e68c28' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    transition: all .2s !important;
}

#id_sc_field_language:focus,
select.sc-js-input[name="language"]:focus {
    border-color: rgba(230,140,40,0.4) !important;
    border-bottom-color: var(--orange) !important;
    background-color: rgba(12,36,60,0.85) !important;
    color: var(--white) !important;
}

#id_sc_field_language option,
select.sc-js-input[name="language"] option {
    background: #0c243c !important;
    color: var(--plate) !important;
    font-family: 'Share Tech Mono', monospace !important;
    font-size: 11px !important;
}
/* Agrega esto en tu CSS para ocultar la opción vacía 
   después de seleccionar */
#id_sc_field_language option[value=""] {
    display: none;
}