/* ============================================================
   APP - Estilos del proyecto Espacio Seguro
   Componentes específicos del portal y panel admin
   ============================================================ */

/* ---- Layout general ---- */
body {
  display: flex;
  flex-direction: column;
}
main {
  flex: 1;
}

/* ============================================================
   PORTAL PÚBLICO
   ============================================================ */

/* Hero / carousel */
.hero-carousel,
.hero-carousel .carousel-item {
  height: 60vh;
  min-height: 320px;
  position: relative;
}
.hero-carousel .carousel-item > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-carousel .carousel-caption {
  bottom: 2rem;
  text-shadow: 0 2px 12px rgba(0,0,0,.55);
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}
.hero-carousel .carousel-caption h1 {
  color: #fff;
  font-weight: 700;
}
.hero-carousel .carousel-caption .lead {
  color: rgba(255,255,255,.95);
}
.hero-carousel .carousel-indicators [data-bs-target] {
  background-color: rgba(255,255,255,.85);
  border: 0;
  border-radius: 999px;
  width: 10px;
  height: 10px;
  margin: 0 4px;
}
.hero-carousel .carousel-control-prev-icon,
.hero-carousel .carousel-control-next-icon {
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.5));
}

@media (max-width: 991.98px) {
  .hero-carousel,
  .hero-carousel .carousel-item { height: 55vh; }
  .hero-carousel .carousel-caption { bottom: 1.25rem; }
}
@media (max-width: 575.98px) {
  .hero-carousel,
  .hero-carousel .carousel-item { height: 50vh; }
  .hero-carousel .carousel-caption h1 { font-size: 1.4rem; }
  .hero-carousel .carousel-caption .lead { font-size: .95rem; }
}

/* Tarjetas de tipo de mensaje (selección rápida) */
.choice-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--mz-gray-200);
  border-radius: var(--mz-radius-lg);
  padding: 1.75rem;
  text-decoration: none;
  color: var(--mz-gray-800);
  transition: all .25s ease;
  height: 100%;
  box-shadow: var(--mz-shadow-sm);
}
.choice-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--mz-shadow-lg);
  border-color: transparent;
  color: var(--mz-gray-900);
}
.choice-card .badge-top {
  align-self: flex-start;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .25rem .6rem;
  border-radius: 999px;
  margin-bottom: .85rem;
}
.choice-card .choice-icon {
  width: 60px;
  height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--mz-radius);
  font-size: 1.7rem;
  margin-bottom: 1rem;
}
.choice-card h3 { font-size: 1.2rem; margin-bottom: .35rem; color: var(--mz-blue-700); }
.choice-card p  { color: var(--mz-gray-600); font-size: .94rem; margin-bottom: 1rem; flex: 1; }
.choice-card .arrow-cta {
  display: inline-flex; align-items: center; gap: .35rem;
  font-weight: 600; font-size: .92rem;
}
.choice-card .arrow-cta i { transition: transform .15s; }
.choice-card:hover .arrow-cta i { transform: translateX(3px); }

/* Variantes por tipo */
.choice-card.is-comment .badge-top   { background: var(--mz-orange-100); color: var(--mz-orange-700); }
.choice-card.is-comment .choice-icon { background: var(--mz-orange-50);  color: var(--mz-orange-600); }
.choice-card.is-comment .arrow-cta   { color: var(--mz-orange-600); }

.choice-card.is-question .badge-top   { background: var(--mz-blue-50);  color: var(--mz-blue-600); }
.choice-card.is-question .choice-icon { background: var(--mz-blue-50);  color: var(--mz-blue-500); }
.choice-card.is-question .arrow-cta   { color: var(--mz-blue-600); }

.choice-card.is-report .badge-top   { background: var(--mz-danger-bg); color: var(--mz-danger); }
.choice-card.is-report .choice-icon { background: var(--mz-danger-bg); color: var(--mz-danger); }
.choice-card.is-report .arrow-cta   { color: var(--mz-danger); }

/* Banner confidencialidad denuncia */
.confidential-banner {
  background: linear-gradient(135deg, var(--mz-blue-50) 0%, var(--mz-blue-100) 100%);
  border-left: 4px solid var(--mz-blue-500);
  border-radius: var(--mz-radius);
  padding: 1rem 1.15rem;
  display: flex;
  gap: .85rem;
  align-items: flex-start;
}
.confidential-banner .bi { font-size: 1.4rem; color: var(--mz-blue-500); flex-shrink: 0; }
.confidential-banner strong { color: var(--mz-blue-700); }

/* Banner anonimato activo */
.anon-banner {
  background: var(--mz-success-bg);
  border-left: 4px solid var(--mz-success);
  border-radius: var(--mz-radius);
  padding: .85rem 1.15rem;
  display: flex;
  gap: .65rem;
  align-items: center;
  font-size: .92rem;
  color: #0E5C36;
}
.anon-banner .bi { font-size: 1.2rem; }

/* ============================================================
   CHECKBOX-CARD (anonimato y otras decisiones importantes)
   ============================================================ */
.checkbox-card {
  display: block;
  cursor: pointer;
  background: #fff;
  border: 2px solid var(--mz-gray-300);
  border-radius: var(--mz-radius-lg);
  padding: 1rem 1.15rem 1rem 3.4rem;
  transition: all .2s ease;
  position: relative;
  margin-bottom: 0;
}
.checkbox-card:hover {
  border-color: var(--mz-orange-400);
  background: var(--mz-orange-50);
}
.checkbox-card .form-check-input {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.4em;
  height: 1.4em;
  margin: 0;
  cursor: pointer;
}
.checkbox-card .checkbox-card-title {
  font-weight: 600;
  color: var(--mz-blue-700);
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .15rem;
}
.checkbox-card .checkbox-card-title .bi {
  font-size: 1.1rem;
  color: var(--mz-orange-600);
}
.checkbox-card .checkbox-card-help {
  font-size: .85rem;
  color: var(--mz-gray-600);
  margin-bottom: 0;
}
/* Estado seleccionado */
.checkbox-card:has(.form-check-input:checked) {
  border-color: var(--mz-success);
  background: var(--mz-success-bg);
  box-shadow: 0 0 0 4px rgba(27, 158, 92, .15);
}
.checkbox-card:has(.form-check-input:checked) .checkbox-card-title {
  color: #0E5C36;
}
.checkbox-card:has(.form-check-input:checked) .checkbox-card-title .bi {
  color: var(--mz-success);
}
.checkbox-card:has(.form-check-input:checked) .checkbox-card-help {
  color: #0E5C36;
}

/* Folio pill */
.tracking-pill {
  display: inline-block;
  background: var(--mz-gray-100);
  border: 1px dashed var(--mz-gray-400);
  border-radius: var(--mz-radius);
  padding: .65rem 1rem;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--mz-blue-700);
}

/* ============================================================
   ADMIN - Layout
   ============================================================ */
/* Layout tipo "app": sidebar y topbar fijos, solo el contenido scrollea */
.admin-shell {
  display: flex;
  height: 100vh;          /* ocupa exactamente la ventana */
  overflow: hidden;       /* la página no scrollea */
}
.admin-sidebar {
  width: 250px;
  background: var(--mz-blue-700);
  color: rgba(255,255,255,.9);
  flex-shrink: 0;
  padding: 1rem 0;
  box-shadow: var(--mz-shadow);
  height: 100vh;
  overflow-y: auto;       /* scroll interno del sidebar si los enlaces no caben */
  /* Scrollbar discreta dentro del sidebar */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.25) transparent;
}
.admin-sidebar::-webkit-scrollbar {
  width: 6px;
}
.admin-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.18);
  border-radius: 3px;
}
.admin-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.35);
}
.admin-sidebar .sidebar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: .85rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}
.admin-sidebar .sidebar-brand img { height: 32px; }
.admin-sidebar .sidebar-section {
  padding: .25rem 1.25rem .35rem;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.5);
  margin-top: .85rem;
}
.admin-sidebar .sidebar-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .65rem 1.25rem;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  font-size: .93rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .15s ease;
}
.admin-sidebar .sidebar-link:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}
.admin-sidebar .sidebar-link.active {
  background: rgba(255,107,26,.12);
  color: #fff;
  border-left-color: var(--mz-orange-500);
}
.admin-sidebar .sidebar-link .bi { font-size: 1.1rem; opacity: .9; }

.admin-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;     /* misma altura que la ventana */
  overflow: hidden;  /* el scroll ocurre dentro, no aquí */
}
.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--mz-gray-200);
  padding: .85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;    /* topbar siempre visible, no encoge */
  z-index: 5;
}
.admin-topbar .topbar-search {
  flex: 1;
  max-width: 420px;
}
.admin-main {
  padding: 1.75rem 1.5rem;
  background: var(--mz-gray-50);
  flex: 1;
  overflow-y: auto;  /* solo esta área scrollea */
  scrollbar-width: thin;
  scrollbar-color: var(--mz-gray-400) transparent;
}
.admin-main::-webkit-scrollbar {
  width: 8px;
}
.admin-main::-webkit-scrollbar-thumb {
  background: var(--mz-gray-300);
  border-radius: 4px;
}
.admin-main::-webkit-scrollbar-thumb:hover {
  background: var(--mz-gray-400);
}
.admin-main h1.page-title {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

/* KPI cards admin */
.kpi {
  background: #fff;
  border-radius: var(--mz-radius-lg);
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--mz-gray-200);
  box-shadow: var(--mz-shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.kpi .kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--mz-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.kpi .kpi-label {
  font-size: .82rem;
  color: var(--mz-gray-600);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.kpi .kpi-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--mz-blue-700);
  line-height: 1.1;
}

/* Mobile: layout vuelve a scroll normal de página completa */
@media (max-width: 991.98px) {
  .admin-shell {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .admin-sidebar {
    width: 100%;
    padding: .5rem 0;
    height: auto;
    overflow-y: visible;
  }
  .admin-content {
    height: auto;
    overflow: visible;
  }
  .admin-main {
    overflow-y: visible;
  }
  .admin-sidebar .sidebar-brand { border-bottom: 0; padding-bottom: .5rem; }
  .admin-sidebar .sidebar-section,
  .admin-sidebar .sidebar-link {
    display: none;
  }
  .admin-sidebar.is-open .sidebar-section,
  .admin-sidebar.is-open .sidebar-link {
    display: flex;
  }
  .admin-sidebar.is-open .sidebar-section {
    display: block;
  }
}

/* ============================================================
   TABLA admin
   ============================================================ */
.table-mz {
  background: #fff;
  border-radius: var(--mz-radius-lg);
  overflow: hidden;
  box-shadow: var(--mz-shadow-sm);
  border: 1px solid var(--mz-gray-200);
}
.table-mz thead th {
  background: var(--mz-gray-50);
  border-bottom: 1px solid var(--mz-gray-200);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--mz-gray-700);
  font-weight: 600;
  padding: .85rem 1rem;
}
.table-mz tbody td {
  padding: .85rem 1rem;
  vertical-align: middle;
  border-color: var(--mz-gray-100);
}
.table-mz tbody tr:hover {
  background: var(--mz-blue-50);
}

/* ============================================================
   WIZARD (denuncia paso a paso)
   ============================================================ */
.wizard-steps {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
  margin-bottom: 2rem;
  position: relative;
}
.wizard-steps::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 12%;
  right: 12%;
  height: 2px;
  background: var(--mz-gray-200);
  z-index: 0;
}
.wizard-step {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
}
.wizard-step .step-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--mz-gray-300);
  color: var(--mz-gray-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: .5rem;
  transition: all .25s ease;
}
.wizard-step .step-label {
  font-size: .82rem;
  color: var(--mz-gray-600);
  font-weight: 500;
}
/* Estados */
.wizard-step.is-active .step-circle {
  background: var(--mz-orange-500);
  border-color: var(--mz-orange-500);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(255, 107, 26, .18);
}
.wizard-step.is-active .step-label {
  color: var(--mz-orange-700);
  font-weight: 600;
}
.wizard-step.is-done .step-circle {
  background: var(--mz-blue-500);
  border-color: var(--mz-blue-500);
  color: #fff;
}
.wizard-step.is-done .step-label {
  color: var(--mz-blue-700);
}

.wizard-pane { display: none; animation: fadeStep .25s ease; }
.wizard-pane.is-current { display: block; }
@keyframes fadeStep {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Mobile: ocultar líneas, hacer steps más compactos */
@media (max-width: 575.98px) {
  .wizard-steps::before { left: 18%; right: 18%; top: 18px; }
  .wizard-step .step-circle { width: 36px; height: 36px; font-size: .9rem; }
  .wizard-step .step-label  { font-size: .72rem; }
}

/* ============================================================
   PANTALLA DE ÉXITO
   ============================================================ */
.success-hero {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
}
.success-hero .success-check {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--mz-success-bg);
  color: var(--mz-success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: popCheck .35s ease;
}
@keyframes popCheck {
  from { transform: scale(.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.success-folio {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  background: var(--mz-blue-50);
  border: 2px dashed var(--mz-blue-300);
  border-radius: var(--mz-radius-lg);
  padding: 1rem 1.25rem;
  margin: 1rem 0 .5rem;
}
.success-folio .folio-text {
  font-family: 'Courier New', monospace;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--mz-blue-700);
}
.success-folio .btn-copy {
  background: #fff;
  border: 1px solid var(--mz-blue-200);
  color: var(--mz-blue-600);
  border-radius: var(--mz-radius-sm);
  padding: .35rem .65rem;
  font-size: .8rem;
  cursor: pointer;
  transition: all .15s;
}
.success-folio .btn-copy:hover {
  background: var(--mz-blue-500);
  color: #fff;
  border-color: var(--mz-blue-500);
}

/* ============================================================
   TIMELINE de seguimiento
   ============================================================ */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--mz-gray-200);
}
.timeline-item {
  position: relative;
  padding-left: 48px;
  padding-bottom: 1.25rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item .tl-dot {
  position: absolute;
  left: 8px;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--mz-blue-400);
  color: var(--mz-blue-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  z-index: 1;
}
.timeline-item.tl-current .tl-dot {
  background: var(--mz-orange-500);
  border-color: var(--mz-orange-500);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(255,107,26,.18);
}
.timeline-item .tl-title {
  font-weight: 600;
  color: var(--mz-blue-700);
}
.timeline-item .tl-meta {
  font-size: .82rem;
  color: var(--mz-gray-500);
}
.timeline-item .tl-note {
  font-size: .9rem;
  color: var(--mz-gray-700);
  font-style: italic;
  margin-top: .15rem;
}

/* ============================================================
   CHAT denuncias
   ============================================================ */
.chat-thread {
  background: #fff;
  border: 1px solid var(--mz-gray-200);
  border-radius: var(--mz-radius-lg);
  padding: 1rem;
  max-height: 520px;
  overflow-y: auto;
}
.chat-msg {
  display: flex;
  gap: .75rem;
  margin-bottom: 1rem;
}
.chat-msg .chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--mz-blue-50);
  color: var(--mz-blue-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.chat-msg .chat-bubble {
  background: var(--mz-gray-50);
  border-radius: var(--mz-radius);
  padding: .65rem .9rem;
  flex: 1;
  font-size: .94rem;
}
.chat-msg .chat-meta {
  font-size: .78rem;
  color: var(--mz-gray-500);
  margin-bottom: .2rem;
}
.chat-msg.is-admin .chat-bubble {
  background: var(--mz-blue-50);
  color: var(--mz-blue-700);
}
.chat-msg.is-internal .chat-bubble {
  background: var(--mz-warning-bg);
  border: 1px dashed var(--mz-warning);
}
