/* src/views/pages/css/portal.css */

/* Barra de utilidades superior: idiomas y accesibilidad */
.lang-switch-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-sep {
  color: rgba(255, 255, 255, 0.25);
  font-weight: 300;
  user-select: none;
  margin: 0 2px;
}

/* Botón de alternancia de alto contraste */
.contrast-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.8);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.contrast-toggle-btn:hover {
  color: #ffffff;
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}

.contrast-toggle-btn.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

/* Grupo de botones para escalado de texto */
.font-scale-group {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  overflow: hidden;
}

.font-btn {
  background: transparent;
  color: #94a3b8;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1.2;
}

.font-btn:last-child {
  border-right: none;
}

.font-btn:hover:not(:disabled) {
  color: #ffffff;
  background: rgba(56, 189, 248, 0.15);
}

.font-btn.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

.font-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Cabecera */
.portal-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 30px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.portal-pill {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 4px 14px;
  border-radius: 20px;
  text-transform: uppercase;
  user-select: none;
}

.portal-title {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.portal-subtitle {
  margin: 0;
  font-size: clamp(0.92rem, 1.4vw, 1.08rem);
  color: #94a3b8;
  line-height: 1.55;
}

/* Notificaciones de estado (feedback / onboarding) */
.status-toast {
  margin: 0 auto 24px auto;
  max-width: 680px;
  width: 100%;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  animation: fadeInToast 0.3s ease-out;
}

.status-toast.success {
  background: rgba(45, 164, 78, 0.18);
  border: 1px solid #2da44e;
  color: #7ee787;
}

.status-toast.error {
  background: rgba(207, 34, 46, 0.18);
  border: 1px solid #cf222e;
  color: #ff7b72;
}

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

/* Rejilla de Módulos (3 Secciones) */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 32px;
}

.portal-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.portal-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
}

.card-status-bar {
  padding: 8px 16px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-transform: uppercase;
  user-select: none;
}

.status-ready {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
}

.status-dot-active {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.card-body {
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

/* Badge circular corporativo para tarjetas */
.card-icon-badge {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  flex-shrink: 0;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.card-icon-badge .icon-svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* Variante azul tecnológico (ALBA / NORA) */
.badge-blue {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}

.portal-card:hover .badge-blue {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.55);
  transform: scale(1.05);
}

/* Variante ámbar de desarrollo (SARA) */
.badge-amber {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #f59e0b;
}

.card-dev-state:hover .badge-amber {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.6);
  transform: scale(1.05);
}

.card-heading {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.card-tag {
  font-size: 0.76rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.card-desc {
  margin: 4px 0 0 0;
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.55;
}

/* Aspecto En Construcción (SARA) */
.card-dev-state {
  border: 1.5px dashed rgba(245, 158, 11, 0.45);
  background: rgba(15, 23, 42, 0.82);
}

.card-dev-state:hover {
  border-color: rgba(245, 158, 11, 0.8);
}

.status-wip {
  background: rgba(245, 158, 11, 0.14);
  color: #f59e0b;
}

.status-dot-wip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

/* Añadir o actualizar la regla en src/views/pages/css/portal.css */
.wip-stripe-box {
  margin-top: 14px;
  padding: 10px 12px;
  background: repeating-linear-gradient(
    -45deg,
    rgba(245, 158, 11, 0.12),
    rgba(245, 158, 11, 0.12) 10px,
    rgba(245, 158, 11, 0.20) 10px,
    rgba(245, 158, 11, 0.20) 20px
  );
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 800;
  color: #fef08a;
  letter-spacing: 0.3px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wip-stripe-box:hover {
  background: repeating-linear-gradient(
    -45deg,
    rgba(245, 158, 11, 0.22),
    rgba(245, 158, 11, 0.22) 10px,
    rgba(245, 158, 11, 0.32) 10px,
    rgba(245, 158, 11, 0.32) 20px
  );
  border-color: rgba(245, 158, 11, 0.7);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Botones */
.card-action-box {
  padding: 16px 20px 20px 20px;
}

.btn-launch {
  width: 100%;
  padding: 11px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-blue {
  background: #0284c7;
  color: #ffffff;
  border: 1px solid #38bdf8;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}
.btn-blue:hover {
  background: #0369a1;
  border-color: #7dd3fc;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.55);
}

.btn-neutral {
  background: #334155;
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-neutral:hover {
  background: #475569;
  color: #ffffff;
}

/* Pie Institucional */
.portal-footer {
  text-align: center;
  padding: 18px 0 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.78rem;
  color: #7d95b4;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-divider {
  color: #475569;
}

.portal-footer .footer-link {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease, color 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.portal-footer .footer-link:hover {
  opacity: 0.85;
  text-decoration: underline;
}

@media (max-width: 920px) {
  .portal-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
  .portal-header {
    margin-bottom: 22px;
  }
}

/* ==========================================================================
   MODO ALTO CONTRASTE (WCAG AAA)
   ========================================================================== */
html.high-contrast {
  background-color: #000000 !important;
}

html.high-contrast body {
  background-color: #000000 !important;
  color: #ffffff !important;
}

html.high-contrast #ambient-canvas {
  display: none !important;
}

html.high-contrast .toolbar-sep {
  color: #ffffff !important;
}

html.high-contrast .contrast-toggle-btn {
  background: #000000 !important;
  color: #ffff00 !important;
  border: 2px solid #ffff00 !important;
}

html.high-contrast .contrast-toggle-btn.active {
  background: #ffff00 !important;
  color: #000000 !important;
  border: 2px solid #ffffff !important;
}

html.high-contrast .font-scale-group {
  background: #000000 !important;
  border: 2px solid #ffffff !important;
}

html.high-contrast .font-btn {
  color: #ffffff !important;
  border-right: 1px solid #ffffff !important;
}

html.high-contrast .font-btn:hover:not(:disabled) {
  background: #ffff00 !important;
  color: #000000 !important;
}

html.high-contrast .font-btn.active {
  background: #ffffff !important;
  color: #000000 !important;
}

html.high-contrast .font-btn:disabled {
  opacity: 0.25;
}

html.high-contrast .portal-title {
  color: #ffffff !important;
  text-shadow: none !important;
}

html.high-contrast .portal-subtitle {
  color: #ffff00 !important;
}

html.high-contrast .portal-pill {
  background: #000000 !important;
  color: #ffff00 !important;
  border: 2px solid #ffff00 !important;
  font-weight: 900 !important;
}

html.high-contrast .portal-card {
  background: #000000 !important;
  border: 2px solid #ffffff !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

html.high-contrast .portal-card:hover,
html.high-contrast .portal-card:focus-within {
  border-color: #ffff00 !important;
  outline: 2px solid #ffff00 !important;
}

html.high-contrast .card-heading {
  color: #ffffff !important;
}

html.high-contrast .card-tag {
  color: #00ffff !important;
}

html.high-contrast .card-desc {
  color: #ffffff !important;
}

html.high-contrast .card-status-bar {
  border-bottom: 2px solid #ffffff !important;
}

html.high-contrast .status-ready {
  background: #000000 !important;
  color: #00ff66 !important;
}

html.high-contrast .status-dot-active {
  background: #00ff66 !important;
  box-shadow: none !important;
  border: 1px solid #ffffff;
}

html.high-contrast .status-wip {
  background: #000000 !important;
  color: #ffff00 !important;
}

html.high-contrast .status-dot-wip {
  background: #ffff00 !important;
  box-shadow: none !important;
  border: 1px solid #ffffff;
}

/* Badges e iconos en alto contraste */
html.high-contrast .card-icon-badge {
  background: #000000 !important;
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
}

html.high-contrast .badge-blue {
  border-color: #00ffff !important;
  color: #00ffff !important;
}

html.high-contrast .badge-amber {
  border-color: #ffff00 !important;
  color: #ffff00 !important;
}

html.high-contrast .card-dev-state {
  border: 2px dashed #ffff00 !important;
}

html.high-contrast .wip-stripe-box {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
  color: #ffff00 !important;
}

html.high-contrast .btn-blue {
  background: #000000 !important;
  color: #00ffff !important;
  border: 2px solid #00ffff !important;
  box-shadow: none !important;
}

html.high-contrast .btn-blue:hover,
html.high-contrast .btn-blue:focus-visible {
  background: #00ffff !important;
  color: #000000 !important;
}

html.high-contrast .btn-neutral {
  background: #000000 !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
}

html.high-contrast .btn-neutral:hover,
html.high-contrast .btn-neutral:focus-visible {
  background: #ffffff !important;
  color: #000000 !important;
}

html.high-contrast .status-toast.success {
  background: #000000 !important;
  border: 2px solid #00ff66 !important;
  color: #00ff66 !important;
}

html.high-contrast .status-toast.error {
  background: #000000 !important;
  border: 2px solid #ff3333 !important;
  color: #ff3333 !important;
}

html.high-contrast .portal-footer {
  border-top: 2px solid #ffffff !important;
  color: #ffffff !important;
}

html.high-contrast .portal-footer .footer-link {
  color: #ffff00 !important;
  text-decoration: underline !important;
}