:root{
  /* Base */
  --ink:#0f172a;
  --muted:#4b6b82;
  --line:#d7e3ec;
  --bg:#f6fafc;
  --card:#ffffff;

  /* Marca (turquesa corporativo y derivados) */
  --brand-main:#1ea995;  /* turquesa corporativo */
  --brand-dark:#17877a;  /* turquesa profundo */
  --brand-light:#24c0a8; /* turquesa claro */
  /* Azulados para wordmark */
  --brand-azul1:#1a9bb0;
  --brand-azul2:#188fa0;
  --brand-azul3:#157f8f;

  /* Estados */
  --danger:#ef4444;

  --radius:16px;
  --shadow:0 10px 30px rgba(2,6,23,.10), 0 2px 8px rgba(2,6,23,.06);
}

@media (prefers-color-scheme: dark){
  :root{
    --ink:#e6f0f6;
    --muted:#9fb8c9;
    --line:#10314a;
    --bg:#071a27;
    --card:#0a2130;
    --shadow:0 10px 30px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.35);
  }
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color:var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, color-mix(in oklab, var(--brand-azul2) 18%, transparent), transparent 60%),
    radial-gradient(1200px 600px at 110% 110%, color-mix(in oklab, var(--brand-main) 18%, transparent), transparent 60%),
    var(--bg);
}

/* Contenedor central */
.wrap{
  min-height:100dvh;
  display:grid;
  place-items:center;
  padding:32px;
}

/* Tarjeta Split 2 columnas */
.shell{
  width:min(1100px, 100%);
  background:var(--card);
  border:1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  display:grid;
  grid-template-columns: 1.1fr 0.9fr; /* panel marca + formulario */
  overflow:hidden;
}

/* Panel izquierdo (marca) */
.brand-pane{
  position:relative;
  padding:48px;
  border-right:1px solid var(--line);

  /* Fondo decorativo */
  background-image: url("../../assets/img/vector4.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

/* CABECERA DE MARCA: logo + wordmark pegado */
.brand-head{
  display:flex;
  align-items:center;
  gap:6px;                 /* pegado al logo */
  flex-wrap:nowrap;
}
.brand-mark{
  width:100px; height:100px;
  border-radius:14px;
  object-fit:cover; object-position:center;
}
.brand-text{ display:flex; flex-direction:column; gap:4px; }

/* Wordmark (degradado azul-verdoso) */
.wordmark{
  margin:0;
  display:inline-block;
  font-size: 40px;
  line-height:1;
  font-weight:800;
  letter-spacing:-1.8px;
  background-image: linear-gradient(90deg, var(--brand-azul1) 0%, var(--brand-azul2) 50%, var(--brand-azul3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.erp{
  font-size:.80em; font-weight:800;
  padding:4px 10px; border-radius:999px;
  background: color-mix(in oklab, var(--brand-main) 14%, transparent);
  border:1px solid color-mix(in oklab, var(--brand-main) 28%, transparent);
  color: var(--brand-main);
  align-self:flex-start;
}

.brand-copy{
  margin:16px 0 0 0;
  font-size: clamp(14px, 1.4vw, 16px);
  color: var(--muted);
}
.brand-bullets{
  margin:24px 0 0 0; padding:0; list-style:none;
  display:grid; gap:14px;
  color: var(--ink);
}
.brand-bullets li{
  display:flex; gap:12px; align-items:flex-start;
  font-size:15px; line-height:1.5;
}
.check{
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; border-radius:6px;
  background: linear-gradient(180deg, var(--brand-main), var(--brand-dark));
  color:white; flex:0 0 auto;
}

.brand-pane {
  position: relative; /* referencia para colocar la figura */
  overflow: hidden;   /* opcional: evita que la img sobresalga */
}

.brand-pane .figure {
  position: absolute;
  bottom: 10px;   /* separación del borde inferior */
  right: 10px;    /* separación del borde derecho */
  max-width: 105px;  /* ajusta el tamaño según tu diseño */
  height: auto;
}


/* Panel derecho (form) */
.form-pane{
  display:flex;
  flex-direction:column;
  padding:44px 38px;
  gap:18px;
  min-height: 500px;
}

/* ====== MARCA MÓVIL (visible solo cuando se oculta brand-pane) ====== */
.mobile-brand{
  display:none;                        /* oculto en escritorio */
  align-items:center;
  gap:4px;
  margin-bottom:4px;
}
.mb-logo{ width:75px; height:75px; object-fit:contain; }
.mb-text{ display:flex; flex-direction:column; gap:4px; }
.mb-wordmark{
  margin:0; font-weight:800; line-height:1; letter-spacing:-1px;
  font-size: 28px;
  background-image: linear-gradient(90deg, var(--brand-azul1) 0%, var(--brand-azul2) 50%, var(--brand-azul3) 100%);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
}
.mb-erp{
  align-self:flex-start;
  font-size:.78rem; font-weight:800;
  padding:3px 10px; border-radius:999px;
  background: color-mix(in oklab, var(--brand-main) 14%, transparent);
  border:1px solid color-mix(in oklab, var(--brand-main) 28%, transparent);
  color: var(--brand-main);
}

/* Titulares y textos del form */
.form-head h2{
  margin:0; font-size: clamp(20px, 2vw, 24px); font-weight:800;
}
.form-head p{
  margin:6px 0 0; color:var(--muted); font-size:14px;
}

/* ALERT */
.alert{
  padding:2px 7px;
  border:1px solid color-mix(in oklab, var(--danger) 35%, var(--line));
  background: color-mix(in oklab, var(--danger) 8%, transparent);
  color: color-mix(in oklab, var(--danger) 55%, black);
  border-radius:12px; font-size:14px;
}

/* Form */
.form{
  display:flex;
  flex-direction:column;
  gap:16px;
  margin-top:6px;
  flex:1;
}
.field{ display:grid; gap:8px; }
.label{
  font-size:13px; color:var(--muted); font-weight:600;
  letter-spacing:.2px;
}

/* Control con ícono a la izquierda dentro del input */
.control{ position:relative; }
.control .icon-left{
  position:absolute; left:12px; top:50%; transform:translateY(-50%);
  width:18px; height:18px;
  color:var(--muted);
  opacity:.8;
  pointer-events:none;
}
.control:focus-within .icon-left{ opacity:1; }

/* Inputs */
.input{
  width:100%;
  padding:14px 14px 14px 44px;   /* cómodo */
  border-radius:12px;
  border:1px solid var(--line);
  background: color-mix(in oklab, var(--card) 92%, white);
  color:var(--ink);
  font-size:15px; outline:none;
  transition: border-color .2s, box-shadow .2s, background .2s, transform .06s ease;
}
.input:focus{
  border-color: var(--brand-main);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand-main) 18%, transparent),
              inset 0 1px 0 rgba(255,255,255,.35);
  background: var(--card);
}

/* Row utilidades */
.row{
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
}
.checkbox{
  display:inline-flex; align-items:center; gap:8px; user-select:none;
  color:var(--muted); font-size:14px;
}
.checkbox input{ width:18px; height:18px }

/* --- BOTÓN CORPORATIVO (CTA) --- */
.btn {
  margin-top: 8px;
  appearance: none;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px 26px;        /* jerarquía CTA */
  gap: 10px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: .3px;
  color: #fff;
  background: linear-gradient(180deg, var(--brand-light), var(--brand-main));
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  transition: background .3s ease, transform .15s ease, box-shadow .3s ease, filter .2s ease;
}
.btn:hover {
  background: linear-gradient(180deg, var(--brand-main), var(--brand-dark));
  box-shadow: 0 8px 18px rgba(0,0,0,0.25), inset 0 1px 6px rgba(255,255,255,.22);
  transform: translateY(-1px);
  filter: saturate(1.03);
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .7; cursor: not-allowed; }
.btn:focus-visible{
  outline: 3px solid #7fe2d2;
  outline-offset: 2px;
}

/* Spinner del botón */
.btn .spin{
  width:16px; height:16px; border-radius:50%;
  border:3px solid rgba(255,255,255,.45);
  border-top-color:#fff;
  display:none;
  animation:spin 1s linear infinite;
}
@keyframes spin { to{ transform: rotate(360deg) } }

/* Mini-footer pegado abajo del formulario */
.foot{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  font-size:13px; color:var(--muted);
  margin-top:auto;
  padding-top:14px;
  border-top:1px solid var(--line);
}

/* Bloqueo suave mientras se envía */
.form[aria-busy="true"] .input{ pointer-events:none; }
.form[aria-busy="true"] .checkbox{ pointer-events:none; opacity:.8; }

/* Responsive: 1 columna en móviles — se oculta brand-pane y aparece mobile-brand
   Además: OCULTAR el texto "Ingresa con tu N° de documento y contraseña." en móviles */
@media (max-width: 980px){
  .shell{ grid-template-columns: 1fr; }
  .brand-pane{ display:none; }
  .form-pane{ padding:28px; min-height: 460px; }
  .mobile-brand{ display:flex; } /* mostrar marca arriba del formulario */
  .form-head p.form-sub{ display:none; } /* <-- ocultar texto en móviles */
}

/* Micro animación */
@keyframes float-in { from { transform: translateY(6px); opacity:0 } to { transform: translateY(0); opacity:1 } }
.form-pane{ animation: float-in .35s ease both }