/* =============================================================
   AMISALUD · Propuesta B — Cálido Humano · estilos por pantalla
   Solo se aplica donde se importe explicitamente.
   Todo prefijado con .login-b o similar para no contaminar otras
   pantallas que sigan en estilos.css.
   ============================================================= */

/* ──────────────────────────────────────────────────────────
   LOGIN
   ────────────────────────────────────────────────────────── */
.login-b {
  font-family: var(--f-sans);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Hero izquierdo — gradiente verde institucional con manchas cálidas */
.login-b .hero {
  flex: 1 1 50%;
  background:
    radial-gradient(circle at 18% 22%, rgba(250, 246, 239, .14) 0, transparent 38%),
    radial-gradient(circle at 78% 72%, rgba(250, 246, 239, .10) 0, transparent 42%),
    linear-gradient(135deg, var(--verde) 0%, var(--verde-d) 100%);
  color: #fff;
  padding: var(--sp-12) var(--sp-10);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-b .hero::before {
  content: "";
  position: absolute;
  top: -120px; right: -120px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(250,246,239,.08) 0%, transparent 70%);
  pointer-events: none;
}
.login-b .hero::after {
  content: "";
  position: absolute;
  bottom: -160px; left: -100px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13,32,83,.18) 0%, transparent 70%);
  pointer-events: none;
}

.login-b .hero-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.login-b .hero-brand img {
  height: 44px;
  width: auto;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.18));
}
.login-b .hero-brand .brand-name {
  font-weight: 800;
  font-size: var(--fs-md);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
}
.login-b .hero-brand .brand-tag {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: rgba(255,255,255,.78);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 2px;
}

.login-b .hero-copy {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: var(--sp-12) 0;
}
.login-b .hero-copy .kicker {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255,255,255,.72);
  margin-bottom: var(--sp-4);
}
.login-b .hero-copy h1 {
  font-family: var(--f-sans);
  font-size: var(--fs-3xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
  margin: 0 0 var(--sp-4) 0;
  color: #fff;
}
.login-b .hero-copy h1 .hl {
  color: var(--coral);
  font-style: normal;
}
.login-b .hero-copy p {
  font-size: var(--fs-md);
  font-weight: 400;
  line-height: 1.6;
  color: rgba(255,255,255,.86);
  margin: 0;
}

.login-b .hero-seals {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
}
.login-b .hero-seals .seal {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-3) var(--sp-4);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--r);
  backdrop-filter: blur(4px);
  min-width: 0;
}
.login-b .hero-seals .seal .label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.72);
}
.login-b .hero-seals .seal .value {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #fff;
}

/* Enlaces legales: visible bajo los hero-seals (regulatorio Habeas Data) */
.login-b .hero-legal {
  position: relative;
  z-index: 1;
  margin-top: var(--sp-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
  align-items: center;
  font-size: 12px;
  color: rgba(255,255,255,.72);
}
.login-b .hero-legal a {
  color: rgba(255,255,255,.92);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(255,255,255,.4);
}
.login-b .hero-legal a:hover {
  color: #fff;
  text-decoration-color: #fff;
}

/* Card derecha */
.login-b .card-wrap {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-10) var(--sp-6);
  background: var(--bg);
}
.login-b .card-form {
  width: 100%;
  max-width: 460px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  padding: var(--sp-8) var(--sp-8) var(--sp-6);
}
.login-b .card-form .greeting {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--verde);
  margin-bottom: 6px;
}
.login-b .card-form h2 {
  font-family: var(--f-sans);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
  margin: 0 0 var(--sp-6) 0;
}

/* Tabs Login / Registro — segmented */
.login-b .nav-pills {
  background: var(--crema);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 4px;
  display: flex;
  gap: 4px;
  margin-bottom: var(--sp-5);
  list-style: none;
}
.login-b .nav-pills .nav-item { flex: 1 1 0; display: flex; }
.login-b .nav-pills .nav-link {
  flex: 1 1 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--f-sans);
  font-weight: 600;
  font-size: var(--fs-sm);
  padding: 10px 12px;
  border-radius: 8px;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
  cursor: pointer;
}
.login-b .nav-pills .nav-link:hover { color: var(--ink); }
.login-b .nav-pills .nav-link.active {
  background: var(--panel);
  color: var(--verde);
  box-shadow: var(--sh-sm);
}
.login-b .nav-pills .nav-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--verde-50);
}

/* Forms */
.login-b .form-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
  display: block;
}
.login-b .form-label .opt {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}
.login-b .input-group {
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--panel);
  display: flex;
  align-items: center;
  transition: border-color .18s ease, box-shadow .18s ease;
  overflow: hidden;
}
.login-b .input-group:focus-within {
  border-color: var(--verde);
  box-shadow: 0 0 0 4px var(--verde-50);
}
.login-b .input-group-text {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 0 0 0 14px;
  font-size: var(--fs-md);
  display: flex;
  align-items: center;
}
.login-b .form-control,
.login-b .form-select {
  border: 0 !important;
  background: transparent !important;
  font-family: var(--f-sans);
  font-size: var(--fs-base);
  color: var(--ink);
  padding: 12px 14px;
  width: 100%;
  outline: none;
  box-shadow: none !important;
}
.login-b .form-control::placeholder { color: var(--muted-2); }
.login-b .form-select { padding-right: 32px; cursor: pointer; }

/* Inputs sueltos (sin input-group) */
.login-b .input-bare {
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--panel);
  padding: 12px 14px;
  font-family: var(--f-sans);
  font-size: var(--fs-base);
  color: var(--ink);
  width: 100%;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.login-b .input-bare:focus {
  outline: none;
  border-color: var(--verde);
  box-shadow: 0 0 0 4px var(--verde-50);
}

/* Wrapper con boton "mostrar contrasena" (icono ojo a la derecha) */
.login-b .password-wrapper {
  position: relative;
}
.login-b .password-wrapper .input-bare {
  padding-right: 44px; /* espacio para el icono ojo */
}
.login-b .password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 6px 8px;
  cursor: pointer;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-md);
  transition: color .15s ease, background .15s ease;
}
.login-b .password-toggle:hover,
.login-b .password-toggle:focus {
  color: var(--verde);
  background: var(--verde-50);
  outline: none;
}
.login-b .password-toggle:focus-visible {
  box-shadow: 0 0 0 2px var(--verde-50);
}

/* Link "¿Olvidaste tu contraseña?" debajo del boton iniciar sesion */
.login-b .forgot-link {
  text-align: center;
  margin-top: 12px;
}
.login-b .btn-link-b {
  background: transparent;
  border: 0;
  color: var(--verde);
  font-family: var(--f-sans);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .15s ease;
}
.login-b .btn-link-b:hover,
.login-b .btn-link-b:focus {
  color: var(--verde-d);
  outline: none;
}

/* Botón primary cálido */
.login-b .btn-primary {
  background: var(--verde);
  border: 0;
  color: #fff;
  font-family: var(--f-sans);
  font-weight: 700;
  font-size: var(--fs-base);
  letter-spacing: .01em;
  padding: 14px 16px;
  border-radius: var(--r);
  width: 100%;
  cursor: pointer;
  transition: background .15s ease, transform .12s ease, box-shadow .15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 18px rgba(71,103,69,.22);
}
.login-b .btn-primary:hover { background: var(--verde-d); }
.login-b .btn-primary:active { transform: translateY(1px); }
.login-b .btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--verde-50), 0 6px 18px rgba(71,103,69,.22);
}
.login-b .btn-primary:disabled {
  opacity: .65;
  cursor: not-allowed;
  transform: none;
}

/* Footer del card */
.login-b .card-footer-note {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--line);
  font-size: var(--fs-xs);
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}
.login-b .card-footer-note a {
  color: var(--verde);
  font-weight: 600;
  text-decoration: none;
}
.login-b .card-footer-note a:hover { text-decoration: underline; }

/* Alertas (override Bootstrap dentro del login) */
.login-b .alert {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  font-size: var(--fs-sm);
  font-weight: 500;
  margin-bottom: var(--sp-4);
  font-family: var(--f-sans);
}
.login-b .alert-danger {
  background: var(--err-50);
  border-color: #F5C2C2;
  color: #7A1F1F;
}
.login-b .alert-success {
  background: var(--ok-50);
  border-color: #BBE4C5;
  color: #1B5C2F;
}
.login-b .alert .btn-close {
  background-size: 12px;
  filter: opacity(.6);
}

/* Spinner inline en botón */
.login-b .spinner-border-sm {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: login-b-spin .8s linear infinite;
  flex-shrink: 0;
}
.login-b .spinner-border-sm.d-none { display: none; }
@keyframes login-b-spin { to { transform: rotate(360deg); } }

/* Grid del registro (2 columnas que colapsan) */
.login-b .grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.login-b .grid-7-5 {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.login-b .field { display: block; margin-bottom: var(--sp-3); }

/* Tab content fade */
.login-b .tab-content > .tab-pane { display: none; }
.login-b .tab-content > .tab-pane.show.active { display: block; }

/* Consentimientos del registro (Habeas Data) */
.login-b .consents {
  background: var(--crema);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  margin: var(--sp-3) 0 var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.login-b .consents .consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
  cursor: pointer;
}
.login-b .consents .consent input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 1.5px solid var(--line-2);
  border-radius: 5px;
  background: var(--panel);
  cursor: pointer;
  position: relative;
  margin-top: 1px;
  transition: border-color .15s, background .15s;
}
.login-b .consents .consent input[type="checkbox"]:hover { border-color: var(--verde); }
.login-b .consents .consent input[type="checkbox"]:checked {
  background: var(--verde);
  border-color: var(--verde);
}
.login-b .consents .consent input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.login-b .consents .consent input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--verde-50);
}
.login-b .consents .consent a {
  color: var(--verde);
  font-weight: 600;
  text-decoration: none;
}
.login-b .consents .consent a:hover { text-decoration: underline; }
.login-b .consents .consent strong {
  color: var(--ink);
  font-weight: 600;
}

/* MFA verificacion (paso 2 del login) */
.login-b .mfa-intro {
  background: var(--azul-50);
  border-left: 3px solid var(--azul);
  border-radius: var(--r);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: var(--sp-5);
  line-height: 1.55;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.login-b .mfa-intro i {
  color: var(--azul);
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.login-b .mfa-intro strong { color: var(--azul-d); font-weight: 700; }
.login-b .mfa-input {
  font-size: 22px;
  letter-spacing: .3em;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 14px 12px;
}

/* ──────────────────────────────────────────────────────────
   Responsive — colapsa a una sola columna
   ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .login-b { flex-direction: column; }
  .login-b .hero {
    flex: 0 0 auto;
    padding: var(--sp-8) var(--sp-6) var(--sp-10);
  }
  .login-b .hero-copy { margin: var(--sp-6) 0; }
  .login-b .hero-copy h1 { font-size: var(--fs-2xl); }
  .login-b .hero-seals { gap: var(--sp-2); }
  .login-b .card-wrap {
    padding: var(--sp-6) var(--sp-4);
  }
  .login-b .card-form {
    margin-top: -36px;
    padding: var(--sp-6) var(--sp-5) var(--sp-5);
  }
}

@media (max-width: 480px) {
  .login-b .hero { padding: var(--sp-6) var(--sp-5) var(--sp-8); }
  .login-b .hero-copy h1 { font-size: var(--fs-xl); }
  .login-b .grid-2 { grid-template-columns: 1fr; }
  .login-b .grid-7-5 { grid-template-columns: 1fr; }
  .login-b .card-form { padding: var(--sp-5) var(--sp-4) var(--sp-4); }
}
