:root{
  --navy:#0b1f33;
  --navy-deep:#061421;
  --brand-teal:#008d8d;
  --brand-teal-2:#00a2a0;
  --brand-orange:#ea8720;
  --white:#fff;
  --text:#ffffff;
  --muted:rgba(255,255,255,.76);
  --panel:rgba(7,28,45,.58);
  --panel-border:rgba(255,255,255,.18);
  --danger-bg:rgba(166,47,53,.34);
}

*{box-sizing:border-box}

html,
body{
  margin:0;
  width:100%;
  min-height:100%;
}

body{
  min-height:100vh;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--text);
  background:var(--navy-deep);
}

button,input{font:inherit}

/* Fondo realmente full-screen */
.login-shell{
  position:relative;
  min-height:100vh;
  min-height:100svh;
  overflow:hidden;
  background:
    linear-gradient(110deg,rgba(4,20,34,.76) 0%,rgba(7,31,49,.48) 54%,rgba(4,22,37,.62) 100%),
    url("../../imagenes/portal-home.webp") center center/cover no-repeat;
}

/* Capa visual de profundidad, sin marco exterior */
.login-backdrop{
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(circle at 68% 18%,rgba(0,162,160,.16),transparent 28%),
    radial-gradient(circle at 16% 86%,rgba(234,135,32,.08),transparent 24%),
    linear-gradient(to top,rgba(4,15,27,.58),transparent 58%);
}

.login-backdrop::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(90deg,rgba(3,17,29,.16),transparent 40%,rgba(3,17,29,.12));
}

/* Grid principal senior: aire, balance y foco en el formulario */
.login-layout{
  position:relative;
  z-index:1;
  width:min(100%,1540px);
  min-height:100vh;
  min-height:100svh;
  margin:0 auto;
  padding:clamp(34px,4vw,64px) clamp(28px,5.5vw,92px);
  display:grid;
  grid-template-columns:minmax(0,1.18fr) minmax(400px,480px);
  gap:clamp(48px,7vw,120px);
  align-items:center;
}

.login-visual{
  align-self:stretch;
  min-width:0;
  display:flex;
  flex-direction:column;
}

/* Logo MILSEC sin tarjeta/fondo */
.brand{
  display:inline-flex;
  width:max-content;
  line-height:0;
  text-decoration:none;
}

.brand img{
  display:block;
  width:clamp(170px,14vw,220px);
  height:auto;
  max-height:82px;
  object-fit:contain;
  filter:none!important;
  background:transparent!important;
  border:0;
  box-shadow:none;
  drop-shadow:none;
}

.visual-copy{
  max-width:760px;
  margin:auto 0;
  padding:58px 0;
}

.eyebrow,
.panel-kicker{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-size:.74rem;
  font-weight:850;
  letter-spacing:.19em;
  text-transform:uppercase;
}

.eyebrow{
  color:#a6f0ed;
}

.eyebrow::before{
  content:"";
  width:38px;
  height:3px;
  border-radius:999px;
  background:linear-gradient(90deg,var(--brand-orange),var(--brand-teal-2));
}

.visual-copy h1{
  margin:22px 0 20px;
  max-width:780px;
  font-size:clamp(3.2rem,6.2vw,6.7rem);
  line-height:.91;
  letter-spacing:-.058em;
  font-weight:800;
  text-shadow:0 10px 30px rgba(0,0,0,.20);
}

.visual-copy p{
  max-width:600px;
  margin:0;
  color:var(--muted);
  font-size:clamp(1rem,1.25vw,1.16rem);
  line-height:1.72;
}

.visual-foot{
  margin:0;
  color:rgba(255,255,255,.48);
  font-size:.72rem;
  letter-spacing:.17em;
  text-transform:uppercase;
}

.login-panel{
  width:100%;
  align-self:center;
}

.panel-inner{
  position:relative;
  width:100%;
  padding:clamp(32px,3.7vw,48px);
  background:
    linear-gradient(150deg,rgba(11,43,66,.76),rgba(5,25,42,.62));
  border:1px solid rgba(255,255,255,.17);
  border-radius:24px;
  box-shadow:
    0 28px 70px rgba(2,17,29,.34),
    inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter:blur(22px) saturate(135%);
  -webkit-backdrop-filter:blur(22px) saturate(135%);
  overflow:hidden;
}

.panel-inner::before{
  content:"";
  position:absolute;
  top:0;
  left:30px;
  width:86px;
  height:4px;
  border-radius:0 0 999px 999px;
  background:linear-gradient(90deg,var(--brand-orange),var(--brand-teal-2));
}

.panel-inner::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(135deg,rgba(255,255,255,.07),transparent 42%);
}

.mobile-brand{display:none}

.panel-head{
  position:relative;
  z-index:1;
  margin-bottom:30px;
}

.panel-kicker{color:#8de4e0}

.panel-head h2{
  margin:12px 0 10px;
  color:#fff;
  font-size:clamp(2rem,3vw,2.6rem);
  line-height:1.08;
  letter-spacing:-.035em;
}

.panel-head p{
  margin:0;
  color:rgba(255,255,255,.74);
  line-height:1.6;
}

.alert{
  position:relative;
  z-index:1;
  margin:0 0 20px;
  padding:13px 15px;
  border-radius:12px;
  font-size:.9rem;
  line-height:1.45;
}

.alert-error{
  color:#fff;
  background:var(--danger-bg);
  border:1px solid rgba(255,215,218,.38);
}

.login-form{
  position:relative;
  z-index:1;
  display:grid;
  gap:20px;
}

.field{
  display:grid;
  gap:9px;
}

.field label{
  color:#fff;
  font-size:.84rem;
  font-weight:750;
}

.input-wrap{position:relative}

.input-wrap>svg{
  position:absolute;
  left:16px;
  top:50%;
  width:20px;
  height:20px;
  transform:translateY(-50%);
  fill:none;
  stroke:#728696;
  stroke-width:1.8;
  pointer-events:none;
}

.input-wrap input{
  width:100%;
  min-height:56px;
  padding:0 50px 0 48px;
  color:#102235;
  background:rgba(255,255,255,.96);
  border:1px solid rgba(255,255,255,.76);
  border-radius:12px;
  outline:none;
  box-shadow:0 8px 22px rgba(2,18,30,.08);
  transition:border-color .2s ease,box-shadow .2s ease,background .2s ease;
}

.input-wrap input::placeholder{color:#8c9aa6}

.input-wrap input:focus{
  border-color:var(--brand-teal-2);
  box-shadow:0 0 0 4px rgba(0,162,160,.18);
  background:#fff;
}

.toggle-pass{
  position:absolute;
  right:10px;
  top:50%;
  width:38px;
  height:38px;
  transform:translateY(-50%);
  display:grid;
  place-items:center;
  padding:0;
  color:#657784;
  background:transparent;
  border:0;
  border-radius:9px;
  cursor:pointer;
}

.toggle-pass:hover{background:#eef4f5}

.toggle-pass:focus-visible{
  outline:3px solid rgba(0,162,160,.28);
  outline-offset:2px;
}

.toggle-pass svg{
  width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
}

.btn-login{
  min-height:58px;
  margin-top:2px;
  padding:0 20px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  color:#fff;
  background:linear-gradient(135deg,var(--brand-teal-2),var(--brand-teal));
  border:0;
  border-radius:12px;
  font-weight:850;
  cursor:pointer;
  box-shadow:0 12px 30px rgba(0,141,141,.27);
  transition:transform .2s ease,box-shadow .2s ease,filter .2s ease;
}

.btn-login:hover{
  transform:translateY(-1px);
  box-shadow:0 16px 34px rgba(0,141,141,.34);
  filter:brightness(1.05);
}

.btn-login:focus-visible{
  outline:3px solid rgba(255,255,255,.72);
  outline-offset:3px;
}

.btn-login svg{
  width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
}

.help-box{
  position:relative;
  z-index:1;
  margin-top:26px;
  padding:16px 18px;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.12);
  border-radius:13px;
}

.help-box strong{
  display:block;
  color:#fff;
  font-size:.86rem;
}

.help-box p{
  margin:5px 0 0;
  color:rgba(255,255,255,.70);
  font-size:.81rem;
  line-height:1.5;
}

.login-footer{
  position:relative;
  z-index:1;
  margin-top:34px;
  padding-top:18px;
  display:flex;
  justify-content:space-between;
  gap:16px;
  color:rgba(255,255,255,.50);
  border-top:1px solid rgba(255,255,255,.12);
  font-size:.67rem;
  letter-spacing:.05em;
  text-transform:uppercase;
}

.development-credit{
  display:inline-flex;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:4px;
  text-align:right;
}

.credit-separator{
  margin:0 2px;
  opacity:.55;
}

.login-footer a{
  color:#93e2df;
  font-weight:750;
  text-decoration:none;
  transition:color .2s ease;
}

.login-footer a:hover,
.login-footer a:focus-visible{
  color:#fff;
  text-decoration:underline;
  text-decoration-color:var(--brand-orange);
  text-underline-offset:3px;
}

/* Tablet */
@media (max-width:980px){
  .login-layout{
    width:min(100%,720px);
    grid-template-columns:1fr;
    gap:24px;
    padding:28px 22px 34px;
  }

  .login-visual{
    min-height:auto;
    display:block;
    text-align:center;
  }

  .brand{display:none}

  .visual-copy{
    max-width:620px;
    margin:0 auto;
    padding:10px 0 6px;
  }

  .visual-copy h1{
    font-size:clamp(2.7rem,10vw,4.5rem);
  }

  .visual-copy p{margin:auto}

  .visual-foot{display:none}

  .mobile-brand{
    display:inline-flex;
    margin-bottom:26px;
    line-height:0;
    background:transparent;
  }

  .mobile-brand img{
    display:block;
    width:165px;
    height:auto;
    filter:none!important;
    background:transparent!important;
  }
}

/* Móvil */
@media (max-width:600px){
  .login-shell{
    min-height:100svh;
    background:
      linear-gradient(180deg,rgba(4,20,34,.72),rgba(4,20,34,.78)),
      url("../../imagenes/portal-home.webp") center/cover no-repeat;
  }

  .login-layout{
    width:100%;
    min-height:100svh;
    padding:22px 14px 28px;
    align-content:center;
  }

  .visual-copy{
    padding:0 8px 12px;
  }

  .visual-copy h1{
    margin:14px 0 12px;
    font-size:clamp(2.3rem,12vw,3.35rem);
    line-height:.96;
  }

  .visual-copy p{
    font-size:.92rem;
    line-height:1.55;
  }

  .eyebrow{font-size:.66rem}

  .panel-inner{
    padding:27px 20px;
    border-radius:20px;
  }

  .panel-head{margin-bottom:24px}
  .panel-head h2{font-size:1.9rem}

  .login-footer{
    flex-direction:column;
    gap:8px;
  }

  .development-credit{
    justify-content:flex-start;
    text-align:left;
  }
}

@media (max-width:380px){
  .login-layout{padding-left:10px;padding-right:10px}
  .panel-inner{padding:23px 16px}
  .visual-copy h1{font-size:2.15rem}
}
