:root{
  --bg1:#f7f9ff;
  --bg2:#eef2ff;
  --stroke: rgba(10,15,30,.12);
  --card: rgba(10,15,30,.08);
  --text: rgba(10,15,30,.92);
  --muted: rgba(10,15,30,.62);

  --shadow: 0 22px 60px rgba(10,15,30,.18);
  --radius: 18px;

  /* neutros (sin color de marca) */
  --brand:#94a3b8;
  --brand2:#64748b;
}

:root[data-theme="dark"]{
  --bg1:#0b1220;
  --bg2:#0a1b2b;
  --stroke: rgba(255,255,255,.14);
  --card: rgba(255,255,255,.08);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.70);
  --shadow: 0 22px 60px rgba(0,0,0,.55);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: "Century Gothic", system-ui, Segoe UI, Roboto, Arial;
  color: var(--text);
  font-size: 9.75pt;
  overflow:hidden;

  /* Fondo neutral (sin auroras de color) */
  background:
    radial-gradient(850px 650px at 55% 60%, rgba(255,255,255,.04), transparent 70%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
}

/* === Flags esquina === */
.cornerFlags{
  position: fixed;
  top: 18px;
  right: 18px;
  display:flex;
  gap:10px;
  z-index: 10;
}

.flag{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 14px 40px rgba(10,15,30,.18);
  color: var(--muted);
  font-size: 12px;
}

.flagDot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.flagSmall{ font-size: 12px; }
.flagText{ font-size: 12px; }

/* Estados */
.status-ok .flagDot{ background:#22c55e; box-shadow: 0 0 0 6px rgba(34,197,94,.18); }
.status-warn .flagDot{ background:#f59e0b; box-shadow: 0 0 0 6px rgba(245,158,11,.18); }
.status-bad .flagDot{ background:#ef4444; box-shadow: 0 0 0 6px rgba(239,68,68,.18); }

/* === Header === */
.header{
  width: min(1240px, 100%);
  margin: 50px auto 0;   /* Subir o bajar portal acceso */
  padding: 0 22px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.brand{
  display:flex;
  align-items:center;
  gap:18px;
}

.brandLogo{
  width: 118px;
  height: 118px;
  border-radius: 30px;
  overflow:hidden;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  border: 1px solid var(--stroke);
  box-shadow: 0 18px 50px rgba(10,15,30,.18);
}

.brandLogo img{
  width:100%;
  height:100%;
  object-fit: contain;
  display:block;
}

.brandLine{
  display:flex;
  align-items:baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.brandLine h1{
  margin:0;
  font-size: 54px;
  font-weight: 700;
  letter-spacing: .2px;
  line-height: 1;
}

.divider{
  opacity:.55;
  font-size: 30px;
}

.subtitle{
  font-size: 22px;
  color: var(--muted);
  letter-spacing: .2px;
}

.glowLine{
  margin-top: 18px;
  height: 2px;
  width: min(740px, 70vw);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--text) 40%, transparent),
    color-mix(in srgb, var(--text) 20%, transparent),
    transparent
  );
  filter: blur(.2px);
  opacity: .6;
}

/* MAC pill */
.macPill{
  display:flex;
  align-items:center;
  gap:12px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 14px 40px rgba(10,15,30,.18);
  color: var(--muted);
  user-select:none;
}

.macPill img{
  width: 26px;
  height: 26px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: #9b9b9b;
  object-fit: cover;
}

/* === Main layout === */
.main{
  height: calc(100vh - 190px);
  display:grid;
  place-items:center;
  padding: 0 22px;
  margin-top: -60px;   /* sube */
}

/* Login card (centrada y como la imagen) */
.loginCard{
  width: min(700px, 92vw);
  min-height: 480px;
  border-radius: calc(var(--radius) + 20px);
  border: 1px solid var(--stroke);
  background: var(--card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  padding: 28px 30px 34px;

  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.loginCard h2{
  margin:0 0 6px;
  font-size: 26px;
}

.hint{
  margin:0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

/* Asterisco de obligatorio */
.field.field-required > span::after{
  content: " *";
  color: #ef4444;
  font-weight: 600;
}

.form{
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  flex: 1;
}

.field{
  display:grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

.inputWrap{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--card);
}

.icon{ opacity:.75; }

input{
  flex:1;
  padding: 14px 0;
  border: none;
  outline:none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}

.toggleBtn{
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 6px 4px;
  line-height: 1;
}
.toggleBtn:hover{ color: var(--text); }

/* Override shared ui.css field input styles (evita doble caja) */
.loginCard .field input{
  border: none;
  background: transparent;
  padding: 14px 0;
  text-transform: uppercase;
  box-shadow: none !important;
}

.loginCard .field input:focus{
  box-shadow: none !important;
  outline: none;
}

.inputWrap:focus-within{
  border-color: color-mix(in srgb, var(--brand) 55%, var(--stroke));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}

.row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 12px;
  margin-top: 4px;
}

.check{
  display:flex;
  align-items:center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.check input{ width: 16px; height: 16px; }

.link{
  color: color-mix(in srgb, var(--brand) 92%, var(--text));
  text-decoration:none;
  font-size: 12px;
}
.link:hover{ text-decoration: underline; }

.btn{
  margin-top: auto;
  width: 100%;
  display: block;
  justify-self: stretch;
  align-self: stretch;
  grid-column: 1 / -1;
  max-width: none;
  padding: 14px 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #000C7B, #1a2aa5);
  color: #ffffff;
  font-weight: 800;
  font-size: 16px;
  cursor:pointer;
  letter-spacing:.2px;
}

.loginCard .btn{
  width: 100% !important;
}
.btn:hover{ filter: brightness(1.03); }
.btn:disabled{
  cursor: default;
  filter: none;
}

.btn-loading{
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.loading-dots{
  display: inline-flex;
  align-items: flex-end;
  gap: 5px;
  min-width: 22px;
}

.loading-dots i{
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.95);
  display: block;
  animation: dot-wave 720ms ease-in-out infinite;
  transform-origin: center bottom;
}

.loading-dots i:nth-child(2){ animation-delay: 120ms; }
.loading-dots i:nth-child(3){ animation-delay: 240ms; }

@keyframes dot-wave{
  0%, 100% { transform: translateY(0) scale(1); opacity: .72; }
  45% { transform: translateY(-4px) scale(1.12); opacity: 1; }
}

.footer{
  position: fixed;
  bottom: 26px;
  left: 0;
  right: 0;
  text-align:center;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: .2px;
}

/* Theme toggle */
.theme-toggle{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
}
.theme-btn{
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(10,15,30,.16);
}
.theme-btn:hover{ filter: brightness(0.98); }

/* Responsive */
@media (max-width: 820px){
  .header{
    margin-top: 22px;
    flex-direction:column;
    align-items:flex-start;
    gap: 14px;
  }
  .brandLine h1{ font-size: 42px; }
  .subtitle{ font-size: 18px; }
  .glowLine{ width: 100%; }
}

/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////// */
/* Estilos logos de empresa */

/* AVIACIÓN (logo horizontal) */
.logo-aviacion{
  width: 250px;
  height: 140px;
}

/* ZARAGOZA (rectangular medio) */
.logo-zaragoza{
  width: 250px;
  height: 140px;
}

/* TAURO (más alto) */
.logo-tauro{
  width: 250px;
  height: 140px;
}

.logo-isl{
  width: 150px;
  height: 150px;
}

/* MAC (casi cuadrado) */
.logo-mac{
  width: 150px;
  height: 150px;
}

/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////// */

/* ====== Errores login ====== */
.errorBox{
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(239,68,68,.35);
  background: rgba(239,68,68,.12);
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}
