:root {
  --color-bg: #f4f6fb;
  --color-bg-soft: #ffffff;
  --color-primary: #004b9b;    /* azul institucional */
  --color-primary-soft: #e2ecff;
  --color-secondary: #00a78e;  /* verde moderno confianza */
  --color-accent: #e61f2d;     /* toque rojo Chile */
  --color-text: #1b1f2a;
  --color-muted: #6b7280;
  --radius-lg: 18px;
  --radius-full: 999px;
  --shadow-soft: 0 12px 35px rgba(15, 23, 42, 0.12);
  --transition-fast: 0.2s ease;
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #eaf2ff 0, #f4f6fb 40%, #eafaf7 100%);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ===== LAYOUT GENERAL ===== */
.page {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

header {
  backdrop-filter: blur(12px);
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.95),
    rgba(255, 255, 255, 0.85),
    transparent
  );
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
}

/* ===== LOGO ===== */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: conic-gradient(
    from 180deg,
    #004b9b,
    #00a78e,
    #e61f2d,
    #004b9b
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.3);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.logo-subtitle {
  font-size: 0.75rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ===== NAV ===== */
nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
}

.nav-link {
  color: var(--color-muted);
  position: relative;
  padding-bottom: 0.15rem;
  transition: color var(--transition-fast);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
  border-radius: 999px;
  transition: width var(--transition-fast);
}

.nav-link:hover {
  color: var(--color-primary);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link--active {
  color: var(--color-primary);
  font-weight: 600;
}

.nav-link--active::after {
  width: 100%;
}

/* ===== HERO FULL PAGE ===== */
.hero {
  padding: 3rem 0 2rem 0;
  min-height: calc(100vh - 70px); /* ocupa prácticamente toda la página */
  display: flex;
  align-items: center;
}

.hero-inner {
  width: 100%;
  text-align: center;
}

.hero-kicker {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.hero-kicker-badge {
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.08);
  color: #059669;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.hero-title {
  font-size: clamp(2.2rem, 2.6rem, 3rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.9rem;
}

.hero-title span.highlight {
  background: linear-gradient(120deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  font-size: 0.98rem;
  color: var(--color-muted);
  max-width: 40rem;
  margin: 0 auto 1.4rem auto;
}

.hero-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  max-width: 32rem;
  margin: 0 auto 2rem auto;
  text-align: left;
}

.hero-bullets li {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.hero-bullets span.bullet {
  margin-top: 0.1rem;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .hero-bullets {
    text-align: left;
  }
}

/* ===== BUSCADOR TIPO GOOGLE ===== */
.search-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.25);
  position: relative;
  overflow: hidden;
}

.search-card--google {
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  max-width: 680px;
  margin: 0 auto 1.2rem auto;
}

.search-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 60%);
  opacity: 0.8;
  pointer-events: none;
}

.search-card-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.search-icon-left {
  font-size: 1.1rem;
  opacity: 0.7;
  margin-left: 0.3rem;
}

.field-input-main {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.65rem 0.4rem;
  font-size: 1rem;
  outline: none;
}

/* cinta de seguridad + botón tipo google */
.search-secure {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.35);
  margin: 0 auto 0.7rem auto;
  width: fit-content;
}

.search-secure span.icon {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #10b981;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: white;
}

.btn-search-main {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #f8fafc;
  padding: 0.55rem 1.4rem;
  font-size: 0.9rem;
  margin: 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.btn-search-main span.icon {
  font-size: 1rem;
}

.btn-search-main:hover {
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
  transform: translateY(-1px);
}

.search-hints {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: var(--color-muted);
  max-width: 40rem;
  margin: 0.9rem auto 0 auto;
}

.search-hints-badge {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px dashed rgba(148, 163, 184, 0.6);
}

/* ===== MAIN SECTION: RESULTADOS ===== */
.main {
  padding: 1.5rem 0 2.5rem 0;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 1.7rem;
  align-items: flex-start;
}

@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.panel {
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.panel-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.panel-subtitle {
  font-size: 0.8rem;
  color: var(--color-muted);
}

/* CHIPS / CERTIFICACIONES */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.chip {
  font-size: 0.74rem;
  padding: 0.26rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(248, 250, 252, 0.9);
  color: var(--color-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.chip--primary {
  border-color: rgba(37, 99, 235, 0.7);
  background: rgba(37, 99, 235, 0.06);
  color: var(--color-primary);
  font-weight: 500;
}

.chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.7);
}

.chip-dot--iso {
  background: linear-gradient(to right, #22c55e, #16a34a);
}

/* LISTA DE CERTIFICACIONES */
.cert-list {
  list-style: none;
  margin-top: 0.4rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.8rem;
}

.cert-item {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.9);
  border: 1px dashed rgba(148, 163, 184, 0.5);
}

.cert-item-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cert-item-name {
  font-weight: 500;
}

.cert-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--color-muted);
}

.cert-item-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.cert-item-meta span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.9);
}

.cert-item-badge {
  align-self: center;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(22, 163, 74, 0.08);
  color: #15803d;
  font-size: 0.74rem;
  border: 1px solid rgba(22, 163, 74, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.cert-item-badge span.dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
}

/* RESULTADOS EMPRESAS */
.results-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.results-info {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.results-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-ghost {
  border-radius: var(--radius-full);
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(248, 250, 252, 0.9);
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-ghost:hover {
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(15, 23, 42, 0.15);
}

/* TARJETAS DE EMPRESAS */
.company-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.company-card {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.98),
    rgba(239, 246, 255, 0.92)
  );
  padding: 0.9rem 1rem;
  display: grid;
  grid-template-columns: minmax(0, 3.2fr) minmax(0, 2.2fr);
  gap: 0.9rem;
  position: relative;
  overflow: hidden;
}

.company-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.14), transparent 55%);
  pointer-events: none;
}

@media (max-width: 700px) {
  .company-card {
    grid-template-columns: minmax(0, 1fr);
  }
}

.company-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.company-name {
  font-weight: 600;
  font-size: 0.96rem;
}

.company-rut {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.company-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
  font-size: 0.74rem;
}

.tag {
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(255, 255, 255, 0.9);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.tag--success {
  border-color: rgba(22, 163, 74, 0.6);
  background: rgba(22, 163, 74, 0.06);
  color: #166534;
}

.tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.8);
}

.tag-dot--green {
  background: #22c55e;
}

.company-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.company-link {
  font-size: 0.8rem;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.company-link span.icon {
  font-size: 0.9rem;
}

.company-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
  justify-content: space-between;
}

.badge-score {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(30, 64, 175, 0.04);
  border: 1px solid rgba(37, 99, 235, 0.6);
  color: #1d4ed8;
}

.badge-score span.dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #38bdf8;
}

.badge-score strong {
  font-size: 0.85rem;
}

.company-cert-summary {
  text-align: right;
  font-size: 0.78rem;
  color: var(--color-muted);
}

.company-cert-summary strong {
  color: var(--color-text);
}

.company-cert-logos {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip-cert {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(248, 250, 252, 0.9);
}

.chip-cert--iso {
  border-color: rgba(22, 163, 74, 0.6);
  background: rgba(22, 163, 74, 0.06);
}

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.95);
  margin-top: auto;
}

.footer-inner {
  padding: 0.9rem 1.5rem;
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--color-muted);
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.footer-link {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}
/* Oculta la sección de resultados al cargar */
#resultados-wrapper {
    display: none;
}