/* =====================================================================
   Portal Grupo DICAS: portada (/), selector de módulos (/home) y
   páginas de acceso (login, recuperar y cambiar contraseña). 30-sep-2026.

   Paleta DICAS (misma de /paletadicas y de estilos.css --dicas-*):
   amarillo #FFCD00 como acento puntual, carbón #141414, grises #54595F y
   #7A7A7A. Reglas de marca: nunca texto blanco sobre amarillo, botones
   planos sin degradados, el amarillo no es fondo general.
   Todo va bajo body.portal para no afectar otras vistas.
   ===================================================================== */

:root {
  --pt-yellow: #FFCD00;
  --pt-yellow-hover: #D9AE00;
  --pt-yellow-soft: #FFF5CC;
  --pt-charcoal: #141414;
  --pt-gray-dark: #54595F;
  --pt-gray: #7A7A7A;
  --pt-white: #FFFFFF;
  /* Neutros de apoyo (derivados de los grises de marca) */
  --pt-bg: #F4F4F2;
  --pt-line: #E4E4E0;
  --pt-radius: 14px;
  --pt-shadow: 0 1px 2px rgba(20, 20, 20, .05);
  --pt-shadow-hover: 0 14px 30px rgba(20, 20, 20, .10);
}

body.portal {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--pt-bg);
  color: var(--pt-charcoal);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

body.portal a {
  text-decoration: none;
}

/* ---------- Encabezado (parcial menu.inicio.menu) ---------- */
.portal-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--pt-charcoal);
  border-bottom: 3px solid var(--pt-yellow);
}

/* El navbar de /home usa el carbón moderado aprobado para las vistas DICAS. */
.portal-header--home {
  background: #383739;
}

.portal-header .navbar {
  padding: .5rem 1rem;
}

.portal-header .nav-link {
  color: rgba(255, 255, 255, .85) !important;
  border-radius: 8px;
  padding: .45rem .8rem !important;
  transition: color .15s ease, background-color .15s ease;
}

.portal-header .nav-link:hover,
.portal-header .nav-link:focus,
.portal-header .nav-link.active {
  color: var(--pt-yellow) !important;
  background: rgba(255, 255, 255, .06);
}

.portal-header .nav-link--cta {
  color: var(--pt-charcoal) !important;
  background: var(--pt-yellow);
  font-weight: 600;
}

.portal-header .nav-link--cta:hover,
.portal-header .nav-link--cta:focus {
  color: var(--pt-charcoal) !important;
  background: var(--pt-yellow-hover);
}

.portal-header .dropdown-menu {
  background: var(--pt-charcoal);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  padding: .4rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
}

.portal-header .dropdown-item {
  color: rgba(255, 255, 255, .88) !important;
  border-radius: 6px;
  padding: .45rem .75rem;
  background: transparent;
}

.portal-header .dropdown-item:hover,
.portal-header .dropdown-item:focus {
  color: var(--pt-yellow) !important;
  background: rgba(255, 255, 255, .06);
}

/* El panel de notificaciones es claro (style.css): se conserva su texto oscuro */
.portal-header .notif .dropdown-menu {
  background: var(--pt-white);
}

.portal-header .notif .dropdown-item {
  color: var(--pt-charcoal) !important;
}

.portal-header .notif .dropdown-item:hover {
  background: var(--pt-bg);
  color: var(--pt-charcoal) !important;
}

.portal-header .navbar-toggler {
  border-color: rgba(255, 255, 255, .25);
}

/* ---------- Contenido ---------- */
.portal-main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.portal-banner {
  border-radius: var(--pt-radius);
  overflow: hidden;
  background: var(--pt-charcoal);
  box-shadow: var(--pt-shadow);
  margin-bottom: 1.75rem;
}

.portal-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.portal-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.portal-intro__title {
  position: relative;
  margin: 0;
  padding-left: .85rem;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--pt-charcoal);
}

.portal-intro__title::before {
  content: "";
  position: absolute;
  left: 0;
  top: .2em;
  bottom: .2em;
  width: 4px;
  border-radius: 2px;
  background: var(--pt-yellow);
}

.portal-intro__text {
  margin: .35rem 0 0;
  color: var(--pt-gray-dark);
  font-size: .95rem;
}

/* ---------- Tarjetas de módulo: toda la tarjeta es el enlace ---------- */
.portal-grid > [class*="col-"] {
  display: flex;
  margin-bottom: 1.5rem;
}

.portal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 1.75rem 1.25rem 1.25rem;
  background: var(--pt-white);
  border: 1px solid var(--pt-line);
  border-radius: var(--pt-radius);
  box-shadow: var(--pt-shadow);
  color: var(--pt-charcoal) !important;
  text-align: center;
  text-decoration: none !important;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

/* Línea amarilla superior que aparece al pasar el mouse */
.portal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--pt-yellow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.portal-card:hover,
.portal-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(255, 205, 0, .55);
  box-shadow: var(--pt-shadow-hover);
  color: var(--pt-charcoal) !important;
}

.portal-card:hover::before,
.portal-card:focus-visible::before {
  transform: scaleX(1);
}

.portal-card:focus {
  outline: none;
}

.portal-card:focus-visible {
  outline: 3px solid rgba(255, 205, 0, .65);
  outline-offset: 2px;
}

.portal-card__icon {
  width: 88px;
  height: 88px;
  margin-bottom: 1rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 4px var(--pt-bg);
  transition: transform .2s ease;
}

.portal-card__icon--fa {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pt-yellow-soft);
  color: var(--pt-charcoal);
  font-size: 2.4rem;
}

.portal-card:hover .portal-card__icon {
  transform: scale(1.04);
}

.portal-card__title {
  margin: 0 0 .35rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--pt-charcoal);
}

.portal-card__text {
  flex-grow: 1;
  margin: 0 0 1rem;
  font-size: .875rem;
  color: var(--pt-gray-dark);
}

.portal-card__tag {
  display: inline-block;
  margin: -.5rem 0 1rem;
  padding: .15rem .6rem;
  border-radius: 999px;
  background: var(--pt-yellow-soft);
  color: var(--pt-charcoal);
  font-size: .75rem;
  font-weight: 600;
}

.portal-card__cta {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem 1rem;
  border-radius: 999px;
  background: var(--pt-bg);
  color: var(--pt-charcoal);
  font-size: .85rem;
  font-weight: 600;
  transition: background-color .2s ease;
}

.portal-card__cta .fa {
  transition: transform .2s ease;
}

.portal-card:hover .portal-card__cta,
.portal-card:focus-visible .portal-card__cta {
  background: var(--pt-yellow);
}

.portal-card:hover .portal-card__cta .fa,
.portal-card:focus-visible .portal-card__cta .fa {
  transform: translateX(3px);
}

/* Aviso discreto: el módulo pide iniciar sesión */
.portal-card__lock {
  position: absolute;
  top: .75rem;
  right: .75rem;
  padding: .15rem .55rem;
  border-radius: 999px;
  background: var(--pt-bg);
  color: var(--pt-gray);
  font-size: .7rem;
  font-weight: 600;
}

.portal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  margin: -.5rem 0 1.25rem;
  color: var(--pt-gray);
  font-size: .8rem;
}

/* ---------- Botones ---------- */
.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.4rem;
  border: 1px solid var(--pt-yellow);
  border-radius: 10px;
  background: var(--pt-yellow);
  color: var(--pt-charcoal) !important;
  font-weight: 700;
  transition: background-color .15s ease, border-color .15s ease;
}

.portal-btn:hover,
.portal-btn:focus {
  background: var(--pt-yellow-hover);
  border-color: var(--pt-yellow-hover);
  color: var(--pt-charcoal) !important;
}

.portal-btn:disabled {
  opacity: .7;
  cursor: wait;
}

.portal-btn--block {
  width: 100%;
}

.portal-btn--ghost {
  background: var(--pt-white);
  border-color: var(--pt-line);
}

.portal-btn--ghost:hover,
.portal-btn--ghost:focus {
  background: var(--pt-bg);
  border-color: var(--pt-gray);
}

/* ---------- Avisos flotantes (bienvenida / sesión cerrada) ---------- */
.portal-toast {
  position: fixed;
  top: 84px;
  right: 16px;
  z-index: 1060;
  display: flex;
  align-items: center;
  gap: .65rem;
  max-width: calc(100% - 32px);
  padding: .8rem 1.1rem;
  border-left: 4px solid var(--pt-yellow);
  border-radius: 10px;
  background: var(--pt-white);
  color: var(--pt-charcoal);
  box-shadow: 0 10px 26px rgba(20, 20, 20, .14);
  font-size: .9rem;
  animation: portal-toast-in .35s ease-out;
  transition: opacity .4s ease, transform .4s ease;
}

.portal-toast.is-hidden {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.portal-toast--neutral {
  border-left-color: var(--pt-gray-dark);
}

@keyframes portal-toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Modales del portal (HelpDesk, avisos) ---------- */
.portal-modal .modal-content {
  border: 0;
  border-radius: var(--pt-radius);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .25);
}

.portal-modal .modal-header {
  background: var(--pt-charcoal);
  border-bottom: 3px solid var(--pt-yellow);
  color: var(--pt-white);
}

.portal-modal .modal-title {
  color: var(--pt-white);
  font-size: 1.05rem;
  font-weight: 700;
}

.portal-modal .close {
  color: var(--pt-white);
  opacity: .85;
  text-shadow: none;
}

.portal-modal .close:hover {
  color: var(--pt-yellow);
  opacity: 1;
}

.portal-modal .modal-body {
  color: var(--pt-charcoal);
}

.hd-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1rem;
  margin-bottom: .75rem;
  border: 1px solid var(--pt-line);
  border-radius: 10px;
  background: var(--pt-white);
  color: var(--pt-charcoal) !important;
  text-decoration: none !important;
  transition: border-color .2s ease, background-color .2s ease;
}

.hd-option:hover,
.hd-option:focus {
  border-color: var(--pt-yellow);
  background: var(--pt-yellow-soft);
}

.hd-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--pt-charcoal);
}

.hd-title {
  display: block;
  font-weight: 700;
}

.hd-subtitle {
  display: block;
  color: var(--pt-gray-dark);
  font-size: .8rem;
}

/* ---------- Páginas de acceso (login / contraseña) ---------- */
.auth-shell {
  display: flex;
  min-height: 100vh;
}

.auth-brand {
  position: relative;
  display: flex;
  flex: 0 0 44%;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  background: var(--pt-charcoal);
  color: var(--pt-white);
  overflow: hidden;
}

/* Detalle geométrico suave con el amarillo de marca */
.auth-brand::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 320px;
  height: 320px;
  border: 40px solid rgba(255, 205, 0, .12);
  border-radius: 50%;
}

.auth-brand__logo {
  width: 190px;
  max-width: 100%;
}

.auth-brand__title {
  position: relative;
  z-index: 1;
  margin: 0 0 .75rem;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.auth-brand__title span {
  color: var(--pt-yellow);
}

.auth-brand__text {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 0;
  color: rgba(255, 255, 255, .72);
}

.auth-brand__foot {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, .5);
  font-size: .8rem;
}

.auth-panel {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 2.25rem 2rem;
  border: 1px solid var(--pt-line);
  border-radius: var(--pt-radius);
  background: var(--pt-white);
  box-shadow: 0 10px 30px rgba(20, 20, 20, .06);
}

.auth-card__title {
  margin: 0 0 .35rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.auth-card__text {
  margin: 0 0 1.5rem;
  color: var(--pt-gray-dark);
  font-size: .92rem;
}

.auth-card label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--pt-charcoal);
}

.auth-card .form-control {
  height: auto;
  padding: .7rem .9rem;
  border: 1px solid var(--pt-line);
  border-radius: 10px;
  background: var(--pt-white);
  color: var(--pt-charcoal);
  font-size: .95rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-card .form-control:focus {
  border-color: var(--pt-yellow);
  box-shadow: 0 0 0 3px rgba(255, 205, 0, .25);
}

.auth-card .form-control.is-invalid {
  border-color: #c0392b;
}

.auth-password {
  position: relative;
}

.auth-password .form-control {
  padding-right: 3rem;
}

.auth-password__toggle {
  position: absolute;
  top: 50%;
  right: .4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pt-gray);
  transform: translateY(-50%);
  cursor: pointer;
}

.auth-password__toggle:hover,
.auth-password__toggle:focus {
  background: var(--pt-bg);
  color: var(--pt-charcoal);
  outline: none;
}

.auth-hint {
  margin-top: .35rem;
  color: var(--pt-gray);
  font-size: .78rem;
}

.auth-alert {
  display: flex;
  gap: .6rem;
  padding: .75rem .9rem;
  margin-bottom: 1.25rem;
  border-radius: 10px;
  font-size: .88rem;
}

.auth-alert--error {
  background: #FDECEA;
  color: #8A1F12;
}

.auth-alert--ok {
  background: var(--pt-yellow-soft);
  color: var(--pt-charcoal);
}

.auth-aviso {
  padding: .9rem 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--pt-yellow);
  border-radius: 10px;
  background: var(--pt-yellow-soft);
  font-size: .88rem;
}

.auth-aviso a {
  color: var(--pt-charcoal) !important;
  font-weight: 700;
  text-decoration: underline !important;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem;
  margin-top: 1.25rem;
  font-size: .88rem;
}

.auth-links a {
  color: var(--pt-gray-dark) !important;
  font-weight: 500;
}

.auth-links a:hover,
.auth-links a:focus {
  color: var(--pt-charcoal) !important;
  text-decoration: underline !important;
}

.auth-reglas {
  padding: 0;
  margin: .5rem 0 0;
  list-style: none;
  font-size: .78rem;
  color: var(--pt-gray);
}

.auth-reglas li::before {
  content: "\f10c";
  font-family: FontAwesome;
  margin-right: .4rem;
}

.auth-reglas li.ok {
  color: var(--pt-charcoal);
}

.auth-reglas li.ok::before {
  content: "\f058";
  color: #2E7D32;
}

/* ---------- Responsivo (puntos de quiebre de Bootstrap 4) ---------- */
@media (max-width: 991.98px) {
  .auth-shell {
    flex-direction: column;
  }

  .auth-brand {
    flex: 0 0 auto;
    padding: 1.5rem 1.25rem;
  }

  .auth-brand__title,
  .auth-brand__text,
  .auth-brand__foot,
  .auth-brand::after {
    display: none;
  }

  .auth-brand__logo {
    width: 150px;
  }
}

@media (max-width: 575.98px) {
  .portal-main {
    padding: 1rem 16px 2rem;
  }

  .portal-intro__title {
    font-size: 1.3rem;
  }

  .portal-card {
    padding: 1.25rem 1rem 1rem;
  }

  .portal-card__icon {
    width: 72px;
    height: 72px;
  }

  .auth-card {
    padding: 1.75rem 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-card,
  .portal-card::before,
  .portal-card__icon,
  .portal-card__cta .fa,
  .portal-toast {
    transition: none;
    animation: none;
  }

  .portal-card:hover,
  .portal-card:focus-visible,
  .portal-card:hover .portal-card__icon {
    transform: none;
  }
}

/* ── Overlay de referidos (#image-overlay + .referidos-overlay__*) ────
   Requerido también en /home (index2), que no carga inicio-dashboard.css.
   Variables locales resueltas contra --pt-* de este mismo archivo. */
#image-overlay {
  align-items: center;
  background: rgba(20, 20, 20, .92);
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 0;
  overflow-y: auto;
  padding: 24px;
  position: fixed;
  transition: opacity .25s ease, visibility .25s ease;
  visibility: hidden;
  z-index: 9999;
}
#image-overlay.active {
  opacity: 1;
  visibility: visible;
}
.referidos-overlay__dialog {
  color: #fff;
  max-width: 620px;
  position: relative;
  text-align: center;
  width: 100%;
}
.referidos-overlay__image {
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .4);
  display: block;
  margin: 0 auto 16px;
  max-height: 54vh;
  max-width: 100%;
}
.referidos-overlay__panel {
  background: #252525;
  border: 1px solid #4a4a4a;
  border-radius: 14px;
  padding: 18px;
}
.referidos-overlay__title {
  color: var(--pt-yellow);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.referidos-overlay__close {
  align-items: center;
  background: #fff;
  border: 0;
  border-radius: 50%;
  color: var(--pt-charcoal);
  display: flex;
  font-size: 1rem;
  height: 40px;
  justify-content: center;
  position: fixed;
  right: 24px;
  top: 24px;
  width: 40px;
}
.referidos-overlay__preference {
  align-items: center;
  color: #dedede;
  cursor: pointer;
  display: inline-flex;
  font-size: .78rem;
  margin: 8px 0 0;
}
.referidos-overlay__preference input {
  margin-right: 7px;
}
.referidos-overlay__confirm {
  background: var(--pt-yellow);
  border: 1px solid var(--pt-yellow);
  border-radius: 999px;
  color: var(--pt-charcoal);
  display: block;
  font-weight: 700;
  margin: 14px auto 0;
  padding: 9px 24px;
}
