/* ═══════════════════════════════════════════════════
   T.U. BUNKER — LOGIN PANEL (Layout Scriptcase Style)
   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: 'Segoe UI', system-ui, sans-serif;
  background: var(--navy-deep);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
  padding-bottom: 50px; /* Espacio para el footer */
}

/* ── 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: 1fr 440px;
  width: min(1180px, 94vw);
  align-items: center;
  gap: 40px;
  animation: deployIn 0.9s cubic-bezier(.16,1,.3,1) both;
  margin: auto;
}

@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 (SIN MARCO)
══════════════════════════════ */
.id-panel {
  background: transparent;
  padding: 10px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.logo-hex {
  width: 56px; height: 56px;
  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: 'Segoe UI', system-ui, sans-serif;
  font-size: 38px; font-weight: 800;
  color: var(--white);
  letter-spacing: 3px;
  line-height: 1;
}
.brand-name span { color: var(--orange); }

.brand-tagline.main-tagline {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.brand-tagline.sub-tagline {
  font-size: 13px;
  color: var(--silver);
  line-height: 1.5;
  margin-bottom: 32px;
  max-width: 90%;
}

/* Rejilla de Tarjetas — EN UNA SOLA FILA (4 Columnas) */
.bunker-features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
}

.bunker-feature-card {
  background: rgba(12, 36, 60, 0.45);
  border: 1px solid rgba(72, 96, 120, 0.35);
  border-radius: 12px;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-align: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(6px);
}

.bunker-feature-card:hover {
  background: rgba(24, 48, 72, 0.6);
  border-color: rgba(230, 140, 40, 0.6);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.bunker-feature-icon {
  font-size: 22px;
  color: var(--orange);
  margin-bottom: 4px;
}

.bunker-feature-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.2;
}

.bunker-feature-desc {
  font-size: 11px;
  color: var(--silver);
  line-height: 1.2;
  font-weight: 400;
}

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

  /* 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);
}

.access-header {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.access-title {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 22px; font-weight: 700;
  color: var(--white);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Control de texto en título según dispositivo */
.mobile-title { display: none; }
.desktop-title { display: inline; }

.access-title-icon {
  color: var(--orange);
  font-size: 20px;
}

.access-sub {
  font-size: 12px; color: var(--silver);
  margin-top: 4px;
}

.access-logo {
  height: 80px;
  width: auto;
}

/* ── 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: 'Segoe UI', system-ui, sans-serif;
  letter-spacing: 0.5px;
}

/* ── Grupos de campo ── */
.field-wrap { position: relative; }

.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;
  font-family: 'Segoe UI', system-ui, sans-serif;
  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);
}

/* ── 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: 'Segoe UI', system-ui, sans-serif;
  font-size: 15px; font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #0a1a08;
  cursor: pointer;
  margin-top: 12px;
  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: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);
}

/* ── Links inferiores ── */
.form-links {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px;
}

/* ══════════════════════════════
   FRANJA INFERIOR — FOOTER
══════════════════════════════ */
.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(6, 14, 26, 0.92);
  border-top: 1px solid rgba(72, 96, 120, 0.25);
  backdrop-filter: blur(8px);
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  font-size: 11px;
  color: var(--silver);
}

.footer-left span { letter-spacing: 0.5px; }
.footer-left strong { color: var(--orange); }

.footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.version-badge {
  background: rgba(48, 72, 96, 0.4);
  border: 1px solid rgba(72, 96, 120, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  color: var(--plate);
  transition: all 0.2s;
}

.footer-right a:hover .version-badge {
  background: rgba(230, 140, 40, 0.2);
  border-color: var(--orange);
  color: var(--white);
}

/* ── Selector de idioma ── */
#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: 'Segoe UI', system-ui, sans-serif !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 option,
select.sc-js-input[name="language"] option {
    background: #0c243c !important;
    color: var(--plate) !important;
}

#id_sc_field_language option[value=""] { display: none; }

/* ══════════════════════════════
   RESPONSIVE / MÓVIL
══════════════════════════════ */
@media (max-width: 992px) {
  .bunker-wrap {
    grid-template-columns: 1fr;
    width: 92vw;
    gap: 0;
  }

  /* Oculta id-panel completamente en móvil */
  .id-panel {
    display: none !important;
  }

  /* Oculta el footer en móvil */
  .app-footer {
    display: none !important;
  }

  body {
    padding-bottom: 0;
  }

  .form-panel {
    padding: 32px 24px;
    width: 100%;
  }

  /* Cambia el título solo en dispositivos móviles */
  .desktop-title { display: none; }
  .mobile-title { display: inline; }

  .access-title {
    font-size: 20px;
  }
  
  .access-logo {
    height: 60px;
  }
}
