/* ============================================================
   AWS GP: Growth Path — Portal de Feedback
   Paleta oscura coherente con AWS + acento naranja.
   ============================================================ */

:root {
  --bg-0: #0b1119;          /* fondo base */
  --bg-1: #111a26;          /* superficie */
  --bg-2: #16212f;          /* superficie elevada */
  --border: #223245;
  --border-soft: #1b2836;

  --text-0: #f2f6fb;        /* principal */
  --text-1: #aebccc;        /* secundario */
  --text-2: #6d7d90;        /* atenuado */

  --accent: #ff9900;        /* naranja AWS */
  --accent-strong: #ec7211;
  --accent-soft: rgba(255, 153, 0, 0.12);

  --success: #1ec98b;
  --danger: #ff6b6b;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;

  --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 6px 20px rgba(0, 0, 0, 0.28);

  --maxw: 880px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-0);
  color: var(--text-0);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Decoración de fondo */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 82% -8%, rgba(255, 153, 0, 0.14), transparent 60%),
    radial-gradient(700px 520px at -6% 8%, rgba(35, 90, 150, 0.16), transparent 62%),
    radial-gradient(600px 600px at 50% 120%, rgba(255, 153, 0, 0.06), transparent 60%);
}

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px 20px 64px;
  flex: 1;
}

/* ===================== Header ===================== */
.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-logo {
  height: 46px;
  width: auto;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-subtitle { font-size: 0.78rem; color: var(--text-2); font-weight: 500; }

.header-nav {
  display: flex;
  gap: 6px;
  background: var(--bg-1);
  border: 1px solid var(--border-soft);
  padding: 5px;
  border-radius: 999px;
}

.nav-btn {
  border: none;
  background: transparent;
  color: var(--text-1);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.nav-btn:hover { color: var(--text-0); }
.nav-btn.is-active {
  background: var(--accent);
  color: #1a1206;
  box-shadow: 0 4px 14px rgba(255, 153, 0, 0.32);
}

/* ===================== Vistas ===================== */
.view { animation: fade-in 0.4s ease; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===================== Hero ===================== */
.hero { text-align: center; margin-bottom: 28px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}
.hero-title {
  font-size: clamp(1.5rem, 3.4vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.18;
  max-width: 640px;
  margin: 0 auto 12px;
}
.hero-lead { color: var(--text-1); font-size: 1.02rem; max-width: 520px; margin: 0 auto; }

/* ===================== Card ===================== */
.card {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-soft);
}

.card-title {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

/* ===================== Formulario ===================== */
.feedback-form { display: flex; flex-direction: column; gap: 26px; }

.question { display: flex; flex-direction: column; gap: 14px; }

.question-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-0);
}
.q-index {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  margin-top: 1px;
}
.q-text { flex: 1; }
.q-text em { color: var(--text-2); font-style: normal; font-weight: 500; }

/* Escala 1-5 */
.scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding-left: 38px;
}
.scale-option { position: relative; }
.scale-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.scale-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 6px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.16s ease;
  height: 100%;
}
.scale-num { font-size: 1.25rem; font-weight: 700; color: var(--text-1); }
.scale-word { font-size: 0.66rem; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; }
.scale-option input:hover + .scale-btn { border-color: var(--accent-strong); transform: translateY(-2px); }
.scale-option input:checked + .scale-btn {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(255, 153, 0, 0.22);
}
.scale-option input:checked + .scale-btn .scale-num { color: var(--accent); }
.scale-option input:checked + .scale-btn .scale-word { color: var(--accent); }
.scale-option input:focus-visible + .scale-btn { outline: 2px solid var(--accent); outline-offset: 2px; }

.question.invalid .scale-btn { border-color: var(--danger); }

/* Texto abierto */
.text-input {
  width: 100%;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-0);
  font-family: inherit;
  font-size: 0.98rem;
  padding: 14px 16px;
  resize: vertical;
  transition: border-color 0.16s ease;
}
.text-input::placeholder { color: var(--text-2); }
.text-input:focus { outline: none; border-color: var(--accent); }
.char-count { text-align: right; font-size: 0.74rem; color: var(--text-2); }

/* Botones */
.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-primary { background: var(--accent); color: #1a1206; padding: 15px 24px; }
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(255, 153, 0, 0.3); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-block { width: 100%; }

.btn-spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(26, 18, 6, 0.35);
  border-top-color: #1a1206;
  border-radius: 50%;
  display: none;
  animation: spin 0.7s linear infinite;
}
.btn.is-loading .btn-spinner { display: inline-block; }
.btn.is-loading .btn-label { opacity: 0.7; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-error {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.4);
  color: #ffb0b0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.form-note { text-align: center; font-size: 0.8rem; color: var(--text-2); }

/* ===================== Dashboard ===================== */
.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.dash-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-1);
  border: 1px solid var(--border-soft);
  color: var(--text-1);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
}
.live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(30, 201, 139, 0.6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(30, 201, 139, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(30, 201, 139, 0); }
  100% { box-shadow: 0 0 0 0 rgba(30, 201, 139, 0); }
}

.thanks-banner {
  background: var(--accent-soft);
  border: 1px solid rgba(255, 153, 0, 0.35);
  color: var(--accent);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  margin-bottom: 16px;
}

.stat-total {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  text-align: center;
}
.stat-total-label { font-size: 0.82rem; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.stat-total-value {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.stat-avg {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.avg-item {
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.avg-label { font-size: 0.76rem; color: var(--text-1); line-height: 1.3; min-height: 2.1em; }
.avg-value-row { display: flex; align-items: baseline; gap: 6px; }
.avg-value { font-size: 1.5rem; font-weight: 800; color: var(--text-0); }
.avg-max { font-size: 0.8rem; color: var(--text-2); }
.avg-bar { height: 5px; border-radius: 999px; background: var(--border); overflow: hidden; }
.avg-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); border-radius: 999px; transition: width 0.6s ease; }

/* Distribución */
.dist-container { display: flex; flex-direction: column; gap: 22px; }
.dist-group-title { font-size: 0.86rem; font-weight: 600; color: var(--text-1); margin-bottom: 10px; }
.dist-rows { display: flex; flex-direction: column; gap: 8px; }
.dist-row { display: grid; grid-template-columns: 54px 1fr 42px; align-items: center; gap: 12px; }
.dist-key { font-size: 0.8rem; color: var(--text-2); font-weight: 600; }
.dist-track { height: 22px; background: var(--bg-2); border-radius: 6px; overflow: hidden; }
.dist-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
  border-radius: 6px;
  width: 0;
  transition: width 0.6s ease;
  min-width: 2px;
}
.dist-count { font-size: 0.82rem; color: var(--text-1); font-weight: 600; text-align: right; }

/* Comentarios */
.comments-card { margin-top: 16px; }
.comments-feed { display: flex; flex-direction: column; gap: 12px; max-height: 420px; overflow-y: auto; }
.comment {
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 0.94rem;
  color: var(--text-0);
  animation: fade-in 0.3s ease;
}
.empty-state { color: var(--text-2); font-size: 0.92rem; text-align: center; padding: 20px; }

.dash-error {
  margin-top: 16px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: #ffb0b0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  text-align: center;
}

/* ===================== Footer ===================== */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-soft);
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.footer-logo { height: 34px; width: auto; opacity: 0.9; }
.footer-text { font-size: 0.8rem; color: var(--text-2); }

/* ===================== Responsive ===================== */
@media (max-width: 640px) {
  .site-header { flex-direction: column; gap: 14px; padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-avg { grid-template-columns: 1fr 1fr; }
  .scale { padding-left: 0; gap: 7px; }
  .scale-btn { padding: 12px 4px; }
  .scale-num { font-size: 1.05rem; }
  .hero-title { font-size: 1.5rem; }
  .dash-head { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 380px) {
  .stat-avg { grid-template-columns: 1fr; }
}

/* Accesibilidad: reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
