/* ============================================================
   ESTILOS PRINCIPALES — AuditoríaDatos.cl
   Ley 19.628 / Ley 21.719 — Protección de Datos Chile
   ============================================================ */

/* ── Variables de diseño ──────────────────────────────────── */
:root {
  --azul-ley:     #0e7fc0;
  --azul-claro:   #1da1d8;
  --verde-ok:     #22c55e;
  --amarillo-med: #eab308;
  --rojo-crit:    #ef4444;
  --gris-bg:      #f8fafc;
  --gris-borde:   #e2e8f0;
  --texto-prin:   #1e293b;
  --texto-sec:    #64748b;
  --sombra-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --sombra-md:    0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --sombra-lg:    0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  --radio-card:   .875rem;
  --font-display: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* ── Reset y base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-display);
  background: var(--gris-bg);
  color: var(--texto-prin);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar-auditoria {
  background: linear-gradient(135deg, #085a8c 0%, #0e7fc0 100%);
  padding: 1rem 0;
  box-shadow: 0 2px 20px rgba(30,64,175,.4);
}
.navbar-brand-text {
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -.02em;
}
.navbar-brand-sub {
  color: rgba(255,255,255,.6);
  font-size: .7rem;
  display: block;
  font-weight: 400;
}
.nav-ley-badge {
  background: rgba(59,130,246,.2);
  color: #93c5fd;
  border: 1px solid rgba(59,130,246,.3);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: .75rem;
  font-weight: 600;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero-section {
  background: linear-gradient(160deg, #0f172a 0%, #1e3a8a 60%, #1e40af 100%);
  color: #fff;
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.hero-subtitle {
  color: rgba(255,255,255,.75);
  font-size: 1.1rem;
  max-width: 600px;
}
.hero-ley-pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  padding: .4rem 1rem;
  font-size: .8rem;
  color: #bfdbfe;
  margin-bottom: 1.5rem;
}

/* ── Tarjetas feature ─────────────────────────────────────── */
.feature-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radio-card);
  padding: 1.5rem;
  height: 100%;
  transition: transform .2s;
}
.feature-card:hover { transform: translateY(-3px); }
.feature-icon {
  width: 48px; height: 48px;
  background: rgba(59,130,246,.2);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.3rem; color: #93c5fd;
}

/* ── Formulario de inicio ─────────────────────────────────── */
.form-card {
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: var(--sombra-lg);
  padding: 2.5rem;
  border: 1px solid var(--gris-borde);
}
.form-label { font-weight: 600; font-size: .875rem; color: var(--texto-prin); margin-bottom: .4rem; }
.form-control {
  border: 1.5px solid var(--gris-borde);
  border-radius: .625rem;
  padding: .625rem 1rem;
  font-size: .9rem;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  border-color: var(--azul-claro);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.btn-iniciar-main {
  background: linear-gradient(135deg, var(--azul-ley), var(--azul-claro));
  color: #fff;
  border: none;
  border-radius: .75rem;
  padding: .875rem 2rem;
  font-weight: 700;
  font-size: 1rem;
  width: 100%;
  transition: all .2s;
  box-shadow: 0 4px 15px rgba(30,64,175,.3);
}
.btn-iniciar-main:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(30,64,175,.4);
  color: #fff;
}
.btn-iniciar-main:disabled { opacity: .6; cursor: not-allowed; }

/* ── Cuestionario ─────────────────────────────────────────── */
.cuestionario-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}
.progreso-panel {
  background: #fff;
  border-radius: var(--radio-card);
  box-shadow: var(--sombra-sm);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--gris-borde);
}

/* Dots de categorías */
.cat-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gris-borde);
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
}
.cat-dot.done  { background: var(--verde-ok); transform: scale(1.1); }
.cat-dot.active { background: var(--azul-claro); transform: scale(1.3); box-shadow: 0 0 0 3px rgba(59,130,246,.2); }

/* Categoría header */
.cat-icon-badge {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--azul-ley), var(--azul-claro));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

/* Pregunta card */
.pregunta-card {
  background: #fff;
  border: 1.5px solid var(--gris-borde);
  border-radius: var(--radio-card);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 1rem;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: var(--sombra-sm);
}
.pregunta-card.respondida {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.pregunta-numero {
  width: 32px; height: 32px;
  background: var(--azul-ley);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.pregunta-body { flex: 1; }
.pregunta-texto { color: var(--texto-prin); line-height: 1.5; }

/* Alternativas */
.alternativas-grid {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-top: .75rem;
}
.alt-btn {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1.5px solid var(--gris-borde);
  border-radius: .625rem;
  padding: .75rem 1rem;
  cursor: pointer;
  transition: all .15s;
  font-size: .875rem;
  color: var(--texto-prin);
  position: relative;
}
.alt-btn:hover {
  border-color: var(--azul-claro);
  background: #f0f7ff;
}
.alt-btn.selected {
  border-color: var(--azul-claro);
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(59,130,246,.2);
}
.alt-indicator {
  width: 18px; height: 18px;
  border: 2px solid var(--gris-borde);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all .15s;
  position: relative;
}
.alt-btn.selected .alt-indicator {
  border-color: var(--azul-claro);
  background: var(--azul-claro);
}
.alt-btn.selected .alt-indicator::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
}
.alt-texto { flex: 1; line-height: 1.4; }
.alt-pts {
  font-size: .75rem;
  font-weight: 700;
  color: var(--azul-claro);
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: 20px;
  flex-shrink: 0;
  white-space: nowrap;
}
.ayuda-texto { border-left: 3px solid var(--azul-claro); }

/* Navegación cuestionario */
.nav-cuestionario {
  background: #fff;
  border-top: 1px solid var(--gris-borde);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  bottom: 0;
  z-index: 100;
  box-shadow: 0 -4px 15px rgba(0,0,0,.06);
}

/* ── Resultados ───────────────────────────────────────────── */
.resultado-container { max-width: 960px; margin: 0 auto; padding: 2rem 1rem; }
.empresa-badge {
  display: inline-block;
  background: #eff6ff;
  color: var(--azul-ley);
  border: 1px solid #bfdbfe;
  border-radius: 50px;
  padding: .4rem 1.25rem;
  font-weight: 600;
  font-size: .9rem;
}
.gauge-container {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}
.gauge-label {
  margin-top: -2rem;
  text-align: center;
}

/* Cards de resultado por categoría */
.cat-result-card {
  background: #fff;
  border: 1.5px solid var(--gris-borde);
  border-radius: var(--radio-card);
  padding: 1.1rem;
  height: 100%;
  box-shadow: var(--sombra-sm);
  transition: transform .2s;
}
.cat-result-card:hover { transform: translateY(-2px); box-shadow: var(--sombra-md); }

/* Plan de acción */
.plan-card {
  background: #fff;
  border-radius: var(--radio-card);
  border-left: 5px solid;
  padding: 1.5rem;
  box-shadow: var(--sombra-sm);
}
.plan-card.prioridad-urgente { border-color: var(--rojo-crit);    background: #fff5f5; }
.plan-card.prioridad-alta    { border-color: #f97316;             background: #fff7ed; }
.plan-card.prioridad-media   { border-color: var(--amarillo-med); background: #fefce8; }
.plan-card.prioridad-baja    { border-color: var(--verde-ok);     background: #f0fdf4; }

.prioridad-badge-urgente { background: var(--rojo-crit);    color: #fff; padding: 4px 10px; border-radius: 20px; font-size: .75rem; font-weight: 700; }
.prioridad-badge-alta    { background: #f97316;             color: #fff; padding: 4px 10px; border-radius: 20px; font-size: .75rem; font-weight: 700; }
.prioridad-badge-media   { background: var(--amarillo-med); color: #000; padding: 4px 10px; border-radius: 20px; font-size: .75rem; font-weight: 700; }
.prioridad-badge-baja    { background: var(--verde-ok);     color: #fff; padding: 4px 10px; border-radius: 20px; font-size: .75rem; font-weight: 700; }

.acciones-lista { margin-top: .5rem; }
.accion-item {
  font-size: .875rem;
  padding: .3rem 0 .3rem 1.5rem;
  position: relative;
  color: var(--texto-sec);
  border-bottom: 1px solid var(--gris-borde);
}
.accion-item:last-child { border-bottom: none; }
.accion-item::before {
  content: '→';
  position: absolute; left: 0;
  color: var(--azul-claro);
  font-weight: 700;
}

/* ── PWA Banner ───────────────────────────────────────────── */
#pwa-banner {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  border-radius: 50px;
  padding: .6rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  box-shadow: var(--sombra-lg);
  z-index: 9999;
  white-space: nowrap;
  font-size: .875rem;
}

/* ── Admin styles ─────────────────────────────────────────── */
.admin-sidebar {
  width: 260px;
  min-height: 100vh;
  background: linear-gradient(180deg, #0f172a 0%, #1e3a8a 100%);
  color: #fff;
  padding: 1.5rem 0;
  position: fixed;
  top: 0; left: 0;
  z-index: 1000;
}
.admin-content {
  margin-left: 260px;
  padding: 2rem;
  min-height: 100vh;
}
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.5rem;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: .875rem;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.admin-nav-link:hover, .admin-nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.08);
  border-left-color: var(--azul-claro);
}
.stat-card {
  background: #fff;
  border-radius: var(--radio-card);
  padding: 1.5rem;
  box-shadow: var(--sombra-sm);
  border: 1px solid var(--gris-borde);
  height: 100%;
}
.stat-number {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--azul-ley);
}

/* ── Utilidades ───────────────────────────────────────────── */
.text-gradient {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-section { padding: 3rem 0 2.5rem; }
  .form-card { padding: 1.5rem; }
  .pregunta-card { flex-direction: column; }
  .admin-sidebar { transform: translateX(-100%); transition: transform .3s; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-content { margin-left: 0; padding: 1rem; }
  .nav-cuestionario { padding: .75rem 1rem; }
  #pwa-banner { width: calc(100% - 2rem); border-radius: .75rem; }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .no-print, .navbar-auditoria, .nav-cuestionario, #pwa-banner { display: none !important; }
  .plan-card { break-inside: avoid; }
  body { background: #fff; }
  .hero-section { background: var(--azul-ley) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── Glosario de abreviaturas ─────────────────────────────── */
.glosario-btn {
  background: rgba(29,161,216,.12);
  border: 1px solid rgba(29,161,216,.3);
  color: var(--azul-claro);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.glosario-btn:hover {
  background: var(--azul-claro);
  color: #fff;
  border-color: var(--azul-claro);
}
.glosario-modal .modal-header {
  background: linear-gradient(135deg, #085a8c 0%, #1da1d8 100%);
  color: #fff;
}
.glosario-modal .modal-header .btn-close { filter: invert(1); }
.glosario-item {
  border-left: 3px solid var(--azul-claro);
  padding: .75rem 1rem;
  margin-bottom: .75rem;
  background: #f8fafc;
  border-radius: 0 .5rem .5rem 0;
  transition: background .2s;
}
.glosario-item:hover { background: #e0f3fb; }
.glosario-abreviatura {
  font-weight: 700;
  color: var(--azul-ley);
  font-size: 1rem;
  font-family: monospace;
}
.glosario-termino {
  font-size: .82rem;
  color: var(--texto-sec);
  font-weight: 500;
  margin-bottom: .3rem;
}
.glosario-definicion {
  font-size: .88rem;
  color: var(--texto-prin);
  line-height: 1.5;
}
.glosario-ley {
  font-size: .75rem;
  color: var(--azul-claro);
  margin-top: .3rem;
  font-weight: 500;
}
.glosario-search {
  border: 2px solid var(--gris-borde);
  border-radius: .5rem;
  padding: .6rem 1rem;
  width: 100%;
  font-size: .9rem;
  outline: none;
  transition: border .2s;
}
.glosario-search:focus { border-color: var(--azul-claro); }

/* ── Nota de cumplimiento ─────────────────────────────────── */
.nota-cumplimiento-card {
  background: linear-gradient(135deg, #085a8c 0%, #1da1d8 100%);
  border-radius: var(--radio-card);
  padding: 2rem;
  color: #fff;
  text-align: center;
  box-shadow: var(--sombra-lg);
  position: relative;
  overflow: hidden;
}
.nota-cumplimiento-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
}
.nota-numero {
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.05em;
}
.nota-sobre-diez {
  font-size: 1.8rem;
  font-weight: 300;
  opacity: .7;
}
.nota-label {
  font-size: .9rem;
  opacity: .85;
  margin-top: .5rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.nota-descripcion {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: .75rem;
  padding: .5rem 1.5rem;
  background: rgba(255,255,255,.15);
  border-radius: 2rem;
  display: inline-block;
}
.nota-critico    { background: linear-gradient(135deg, #7f1d1d 0%, #dc2626 100%); }
.nota-bajo       { background: linear-gradient(135deg, #78350f 0%, #d97706 100%); }
.nota-medio      { background: linear-gradient(135deg, #713f12 0%, #ca8a04 100%); }
.nota-alto       { background: linear-gradient(135deg, #14532d 0%, #16a34a 100%); }
.nota-excelente  { background: linear-gradient(135deg, #1e3a5f 0%, #0e7fc0 100%); }

/* ── Banner iOS PWA ───────────────────────────────────────── */
#ios-pwa-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 2px solid var(--azul-claro);
  padding: 1rem 1.5rem;
  z-index: 9999;
  box-shadow: 0 -4px 20px rgba(0,0,0,.15);
  display: none;
}
#ios-pwa-banner.visible { display: flex; align-items: center; gap: 1rem; }
.ios-pwa-icon {
  width: 48px; height: 48px;
  background: var(--azul-claro);
  border-radius: .75rem;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.ios-pwa-text { flex: 1; }
.ios-pwa-text strong { display: block; font-size: .9rem; color: var(--texto-prin); }
.ios-pwa-text span { font-size: .8rem; color: var(--texto-sec); }
.ios-pwa-steps {
  font-size: .78rem;
  color: var(--texto-sec);
  margin-top: .3rem;
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-wrap: wrap;
}
.ios-step-arrow { color: var(--azul-claro); font-weight: 700; }
#ios-pwa-close {
  background: none; border: none;
  color: var(--texto-sec);
  font-size: 1.3rem;
  cursor: pointer;
  padding: .3rem;
  flex-shrink: 0;
}

/* ── Inteliworks branding en admin PDF ────────────────────── */
.iw-report-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #085a8c 0%, #1da1d8 100%);
  border-radius: .75rem .75rem 0 0;
  color: #fff;
  margin-bottom: 0;
}
.iw-report-logo {
  width: 52px; height: 52px;
  background: #fff;
  border-radius: .5rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  color: var(--azul-ley);
  font-size: 1rem;
  letter-spacing: -.03em;
  flex-shrink: 0;
}
.iw-report-title { font-size: 1rem; font-weight: 700; }
.iw-report-sub { font-size: .78rem; opacity: .8; }
.btn-export-pdf {
  background: linear-gradient(135deg, #085a8c, #1da1d8);
  color: #fff;
  border: none;
  padding: .55rem 1.2rem;
  border-radius: .5rem;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  transition: opacity .2s;
}
.btn-export-pdf:hover { opacity: .88; color: #fff; }

