/* ============================================================
   KiikUp - auditoria.kiikup.com - assets/style.css  (Fase 1B)
   Paleta oficial KiikUp + Nunito.
   ============================================================ */

:root {
  --kiik-turquoise: #00A6B6;
  --kiik-coral:     #FC7643;
  --kiik-orange:    #F79532;
  --kiik-lime:      #C7CF62;
  --kiik-yellow:    #EFD050;

  --ink:       #333333;
  --ink-soft:  #666666;
  --ink-muted: #999999;
  --paper:     #FFFFFF;
  --paper-off: #FAFAFA;
  --rule:      #EEEEEE;

  --grad-brand: linear-gradient(135deg, #00A6B6 0%, #FC7643 100%);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--kiik-turquoise); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 24px; }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo img { height: 32px; display: block; }
.topbar-meta {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================================
   SCREENS
   ============================================================ */
.screen {
  padding: 40px 0 60px;
}
.screen-home {
  min-height: calc(100vh - 73px - 60px);
}

/* ============================================================
   HOME
   ============================================================ */
.screen-home { display: flex; align-items: center; }
.screen-home .wrap { width: 100%; }
.kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: var(--kiik-turquoise);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 18px;
}
.home-h1 {
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 18px;
  color: var(--ink);
}
.home-h1 .coral { color: var(--kiik-coral); }
.home-sub {
  font-size: 18px;
  color: var(--ink-soft);
  margin-bottom: 36px;
  max-width: 620px;
}

.search-box { position: relative; margin-bottom: 12px; }
.search-input {
  width: 100%;
  padding: 20px 22px 20px 56px;
  border: 2px solid var(--rule);
  border-radius: 14px;
  font-size: 17px;
  font-family: inherit;
  font-weight: 500;
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.15s;
}
.search-input:focus { outline: none; border-color: var(--kiik-turquoise); }
.search-icon {
  position: absolute;
  left: 20px; top: 50%;
  transform: translateY(-50%);
  color: var(--kiik-turquoise);
  pointer-events: none;
}
.search-hint { font-size: 13px; color: var(--ink-muted); margin-top: 6px; }

.suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  z-index: 20;
}
.suggestion {
  display: block;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: background 0.1s;
}
.suggestion:last-child { border-bottom: none; }
.suggestion:hover, .suggestion.active { background: rgba(0, 166, 182, 0.08); }
.sugg-titulo { font-weight: 700; font-size: 15px; color: var(--ink); }
.sugg-sub    { font-size: 13px; color: var(--ink-muted); margin-top: 2px; }
.sugg-empty  { padding: 14px 18px; color: var(--ink-muted); font-size: 14px; }

/* ============================================================
   LOADING
   ============================================================ */
.screen-loading {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 60px;
}
.loading-card {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  padding: 40px 28px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}
.loading-logo img {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  display: block;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%      { transform: scale(1.08); opacity: 0.85; }
}
.loading-title { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.loading-sub   { font-size: 14px; color: var(--ink-muted); margin-bottom: 24px; }
.loading-steps {
  list-style: none;
  text-align: left;
  max-width: 320px;
  margin: 0 auto;
}
.loading-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 15px;
  color: var(--ink-muted);
  transition: color 0.2s;
}
.loading-steps li.active { color: var(--ink); font-weight: 700; }
.loading-steps li.done   { color: var(--ink-soft); }
.step-bullet {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--rule);
  flex-shrink: 0;
  position: relative;
}
.loading-steps li.active .step-bullet {
  border-color: var(--kiik-turquoise);
  animation: spin 1s linear infinite;
  border-top-color: transparent;
}
.loading-steps li.done .step-bullet {
  background: var(--kiik-lime);
  border-color: var(--kiik-lime);
}
.loading-steps li.done .step-bullet::after {
  content: "";
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   INFORME
   ============================================================ */
.result-back { margin-bottom: 18px; }
.result-back a { font-size: 14px; font-weight: 700; color: var(--ink-soft); }

.report-head { margin-bottom: 24px; }
.report-name {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.15;
}
.report-dir {
  color: var(--ink-soft);
  font-size: 15px;
  margin-bottom: 10px;
}
.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 14px;
  color: var(--ink-soft);
}
.report-meta a { font-weight: 600; }

/* ---- HERO Puntuacion ---- */
.score-hero {
  display: flex;
  gap: 28px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-md);
  border-left: 8px solid var(--kiik-turquoise);
}
.score-hero.score-lime      { border-left-color: var(--kiik-lime); }
.score-hero.score-turquoise { border-left-color: var(--kiik-turquoise); }
.score-hero.score-yellow    { border-left-color: var(--kiik-yellow); }
.score-hero.score-orange    { border-left-color: var(--kiik-orange); }
.score-hero.score-coral     { border-left-color: var(--kiik-coral); }

.score-num {
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  color: var(--kiik-turquoise);
}
.score-hero.score-lime      .score-num { color: var(--kiik-lime); }
.score-hero.score-yellow    .score-num { color: var(--kiik-orange); }
.score-hero.score-orange    .score-num { color: var(--kiik-orange); }
.score-hero.score-coral     .score-num { color: var(--kiik-coral); }
.score-max {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-muted);
}
.score-info { flex: 1; }
.score-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.score-interp {
  font-size: 24px;
  font-weight: 800;
  margin: 4px 0 10px;
}
.score-stars {
  font-size: 14px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.score-stars-icons { color: var(--kiik-yellow); font-size: 16px; }
.score-stars-sub  { color: var(--ink-muted); font-size: 13px; }

/* ---- Aviso ---- */
.result-aviso {
  background: rgba(247, 149, 50, 0.12);
  border: 1px solid rgba(247, 149, 50, 0.3);
  color: #8a4a00;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 22px;
}

/* ---- 3 dimensiones ---- */
.dim-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 28px;
}
.dim-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: var(--shadow-md);
}
.dim-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.dim-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}
.dim-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
}
.dim-body { font-size: 15px; }

/* Desglose barras */
.dim-metric-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 12px;
}
.dim-bars { list-style: none; }
.dim-bar { margin-bottom: 14px; }
.dim-bar-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 5px;
}
.dim-bar-label { font-weight: 700; color: var(--ink-soft); }
.dim-bar-val   { font-weight: 700; color: var(--kiik-turquoise); }
.dim-bar-track {
  width: 100%;
  height: 8px;
  background: var(--paper-off);
  border-radius: 4px;
  overflow: hidden;
}
.dim-bar-fill {
  height: 100%;
  background: var(--grad-brand);
  border-radius: 4px;
  transition: width 0.6s ease-out;
}

/* IA cobertura */
.ia-cobertura {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--paper-off);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.ia-cob-num {
  font-size: 40px;
  font-weight: 900;
  line-height: 1;
  color: var(--kiik-turquoise);
}
.ia-cob-num.ok  { color: var(--kiik-lime); }
.ia-cob-num.mid { color: var(--kiik-yellow); }
.ia-cob-num.bad { color: var(--kiik-coral); }
.ia-cob-txt { font-size: 14px; color: var(--ink-soft); line-height: 1.4; }
.ia-cob-empty {
  font-size: 14px;
  color: var(--ink-muted);
  text-align: center;
  padding: 8px 0;
}

/* IA cards (1 por motor) */
.ia-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.ia-card {
  background: var(--paper-off);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 14px 16px;
}
.ia-card.ia-yes     { border-left: 4px solid var(--kiik-lime); }
.ia-card.ia-no      { border-left: 4px solid var(--kiik-coral); }
.ia-card.ia-pending { border-left: 4px solid var(--ink-muted); opacity: 0.7; }
.ia-card.ia-error   { border-left: 4px solid var(--kiik-orange); }

.ia-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.ia-card-name { font-weight: 800; font-size: 15px; }
.ia-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ia-badge-yes     { background: rgba(199, 207, 98, 0.25); color: #6a7530; }
.ia-badge-no      { background: rgba(252, 118, 67, 0.18); color: #b54d20; }
.ia-badge-pending { background: var(--paper); color: var(--ink-muted); border: 1px solid var(--rule); }
.ia-badge-error   { background: rgba(247, 149, 50, 0.18); color: #8a4a00; }
.ia-card-msg  { font-size: 14px; color: var(--ink-soft); margin: 0; }
.ia-card-comp { font-size: 13px; color: var(--ink-muted); margin-top: 4px; }

/* Plan accion */
.plan-list { list-style: none; }
.plan-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--rule);
  font-size: 14px;
}
.plan-item:last-child { border-bottom: none; }
.plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}
.plan-k .plan-badge   { background: var(--grad-brand); color: #fff; }
.plan-ext .plan-badge { background: var(--paper-off); color: var(--ink-muted); border: 1px solid var(--rule); }
.plan-txt { line-height: 1.45; color: var(--ink); }

/* Competidores */
.result-section { margin-bottom: 24px; }
.result-section-title { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.result-section-sub {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.competidores-list {
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 6px 18px;
}
.comp-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.comp-item:last-child { border-bottom: none; }
.comp-name { font-weight: 700; color: var(--ink); }
.comp-count { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-muted); }
.comp-dot {
  width: 8px; height: 8px;
  background: var(--kiik-coral);
  border-radius: 50%;
}
.comp-count em { font-style: normal; }

/* Reviews y horario */
.reviews-list { display: flex; flex-direction: column; gap: 12px; }
.review {
  background: var(--paper-off);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 14px 16px;
}
.review-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
}
.review-autor  { font-weight: 700; color: var(--ink); }
.review-rating { color: var(--kiik-yellow); }
.review-hace   { color: var(--ink-muted); }
.review-texto  { font-size: 14px; color: var(--ink-soft); line-height: 1.5; }

.horario-list {
  list-style: none;
  background: var(--paper-off);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 12px 16px;
}
.horario-list li {
  padding: 5px 0;
  font-size: 14px;
  color: var(--ink-soft);
  border-bottom: 1px dashed var(--rule);
}
.horario-list li:last-child { border-bottom: none; }

/* ============================================================
   EMAIL GATE
   ============================================================ */
.email-gate {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 28px;
  box-shadow: var(--shadow-md);
  margin-top: 12px;
}
.gate-head { margin-bottom: 18px; }
.gate-title { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.gate-sub   { color: var(--ink-soft); font-size: 15px; }
.gate-form  { display: flex; flex-direction: column; gap: 14px; }
.field      { display: block; }
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input[type=text],
.field input[type=email] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: var(--paper);
}
.field input:focus { outline: none; border-color: var(--kiik-turquoise); }
.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}
.check input { margin-top: 3px; }
.gate-mini {
  font-size: 12px;
  color: var(--ink-muted);
  text-align: center;
  margin-top: 4px;
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.05s, opacity 0.15s, background 0.15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; opacity: 0.92; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--kiik-turquoise); color: #fff; }
.btn-coral   { background: var(--kiik-coral);     color: #fff; }
.btn-block   { width: 100%; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  z-index: 100;
  animation: toastIn 0.25s ease-out;
}
.toast.toast-error { background: #b3261e; }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================================================
   FOOTER + ERROR
   ============================================================ */
.foot {
  border-top: 1px solid var(--rule);
  padding: 18px 0;
  font-size: 13px;
  color: var(--ink-muted);
}
.foot-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.error-card {
  max-width: 520px;
  margin: 0 auto;
  padding: 40px 28px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}
.error-title { font-size: 24px; font-weight: 800; margin-bottom: 12px; }
.error-sub   { color: var(--ink-soft); margin-bottom: 22px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 720px) {
  .ia-cards { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 540px) {
  .wrap { padding: 0 16px; }
  .search-input { padding: 18px 18px 18px 50px; font-size: 16px; }
  .loading-card, .email-gate, .dim-card, .score-hero { padding: 22px 18px; }
  .home-h1 { font-size: 30px; }
  .home-sub { font-size: 16px; }
  .score-hero { flex-direction: column; gap: 14px; text-align: center; align-items: stretch; }
  .score-num { font-size: 56px; }
  .score-stars { justify-content: center; }
  .report-name { font-size: 22px; }
}
