/* ============================================
   Design Tokens - OSDE Style
   ============================================ */

/* Colores como tripletas RGB para poder usarlos con opacidad desde Tailwind
   (bg-osde/10, border-line, etc.). Siempre en tema claro. */
:root {
  --c-paper: 250 250 249;     /* fondo de pantalla */
  --c-surface: 255 255 255;   /* tarjetas, modales, barra inferior */
  --c-ink: 27 32 51;          /* texto principal */
  --c-muted: 95 100 114;      /* texto secundario: 5.9:1 sobre paper (AA) */
  --c-line: 236 237 242;      /* bordes y divisores */
  --c-osde: 18 38 170;        /* azul de marca para texto, bordes y tintes */
  --c-marca: 18 38 170;       /* azul de marca para fondos con texto blanco */
  --c-brick: 176 80 63;
  --c-okgreen: 30 138 95;

  /* alias usados por estilos viejos */
  --osde-blue: rgb(var(--c-marca));
  --paper: rgb(var(--c-paper));
  --ink: rgb(var(--c-ink));
  --muted: rgb(var(--c-muted));
  --line: rgb(var(--c-line));
  --brick: rgb(var(--c-brick));
  --okgreen: rgb(var(--c-okgreen));
}


.font-display {
  font-family: 'Manrope', system-ui, sans-serif;
}

/* ============================================
   App del afiliado
   ============================================ */

/* Pantallas de la app: fondo y controles nativos según el tema */
body.app-afiliado { background-color: rgb(var(--c-paper)); color: rgb(var(--c-ink)); color-scheme: light; }

/* Encabezado azul compartido (layouts/_app_header) */
.app-header {
  background: linear-gradient(160deg, #1226AA 0%, #2A3CC2 100%);
}
.app-header-curve { fill: rgb(var(--c-paper)); }

/* Evita el zoom por doble toque sin bloquear el zoom con pellizco */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }

/* Inputs de 16px: con menos, iOS hace zoom automático al enfocarlos */
.app-input {
  font-size: 16px;
  line-height: 1.4;
  background-color: rgb(var(--c-paper));
  border: 1px solid rgb(var(--c-line));
  border-radius: 14px;
  padding: 12px 14px;
  color: rgb(var(--c-ink));
  width: 100%;
}
.app-input:focus {
  outline: none;
  border-color: rgb(var(--c-osde));
  box-shadow: 0 0 0 3px rgb(var(--c-osde) / 0.18);
}
.app-input::placeholder { color: rgb(var(--c-muted) / 0.8); }

/* Foco visible para quien navega con teclado o lector de pantalla */
.app-focus:focus-visible,
.service-item:focus-visible,
.nav-item:focus-visible {
  outline: 2px solid rgb(var(--c-osde));
  outline-offset: 2px;
  border-radius: 12px;
}

/* ── Credencial: color del parentesco en variables (--accent, --accent-light)
      (los íconos de servicios del inicio las usan) ── */
.cred-acento { color: var(--accent); }
.cred-tinte { background-color: var(--accent-light); }
.cred-relleno { background-color: var(--accent); }

/* ── Estados de autorización (icono, insignia y aviso) ── */
.estado-en_analisis  { --e-bg: #E8EAFA; --e-fg: #1226AA; }
.estado-en_auditoria { --e-bg: #FEF3C7; --e-fg: #92400E; }
.estado-aprobada     { --e-bg: #D1FAE5; --e-fg: #065F46; }
.estado-rechazada    { --e-bg: #FEE2E2; --e-fg: #991B1B; }
.estado-finalizada   { --e-bg: #ECEDF2; --e-fg: #3F4452; }
.estado-fondo { background-color: var(--e-bg); }
.estado-texto { color: var(--e-fg); }
.estado-caja  { background-color: var(--e-bg); color: var(--e-fg); }

/* Bienvenida (splash) */
.bienvenida-fondo { background: radial-gradient(120% 90% at 50% 30%, #EFF3FF 0%, #FFFFFF 65%); }

/* Esqueleto de carga */
.skeleton {
  background: linear-gradient(90deg, rgb(var(--c-line)) 25%, rgb(var(--c-line) / 0.5) 50%, rgb(var(--c-line)) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
  border-radius: 10px;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Respeta "reducir movimiento" del sistema */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   Credential Cards - Swipeable
   ============================================ */

/* Scroll container */
#cardScroller {
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 1.25rem; /* igual al px-5: la tarjeta frena alineada al margen */
  overscroll-behavior-x: contain; /* el deslizamiento no dispara el "volver" del celular */
  -webkit-overflow-scrolling: touch;
}

/* Card slide snap: frena en cada tarjeta, aunque el gesto sea rápido */
.card-slide {
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* Security pattern overlay */
.security-pattern {
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 1px, transparent 1px, transparent 7px);
}

/* Embossed text effect */
.embossed {
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255,255,255,0.7), 0 -1px 0 rgba(27,32,51,0.08);
}

/* Dots indicator */
.dot {
  transition: all 0.25s ease;
  cursor: pointer;
}

.dot.active {
  width: 16px;
}

/* Hide scrollbar */
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ============================================
   Status Banner
   ============================================ */

.status-banner {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.status-banner svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* Active banner - with gradient and glow */
.status-banner--active {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  color: #065f46;
  border: 1px solid #a7f3d0;
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.15);
}

.status-banner--active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, #10b981, #34d399);
  border-radius: 0 2px 2px 0;
}

.status-banner--active svg {
  color: #10b981;
}

/* Warning banner */
.status-banner--warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #92400e;
  border: 1px solid #fde68a;
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.15);
}

.status-banner--warning::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, #f59e0b, #fbbf24);
  border-radius: 0 2px 2px 0;
}

.status-banner--warning svg {
  color: #f59e0b;
}

/* Blocked banner */
.status-banner--blocked {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  color: #991b1b;
  border: 1px solid #fecaca;
  box-shadow: 0 2px 12px rgba(239, 68, 68, 0.15);
}

.status-banner--blocked::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, #ef4444, #f87171);
  border-radius: 0 2px 2px 0;
}

.status-banner--blocked svg {
  color: #ef4444;
}

