:root {
  --azul: #0b3d66;
  --azul-2: #124a7a;
  --azul-claro: #e8f1f8;
  --dorado: #c9a227;
  --gris: #4a4a4a;
  --gris-claro: #f4f6f9;
  --verde: #1e7a34;
  --rojo: #b00020;
  --radio: 12px;
  --sombra: 0 4px 18px rgba(11, 61, 102, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, #f4f8fb 0%, #eef3f8 100%);
  color: #1c1c1c;
  min-height: 100vh;
}

a { color: var(--azul-2); }

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

.topbar {
  background: linear-gradient(120deg, var(--azul) 0%, var(--azul-2) 100%);
  color: #fff;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--sombra);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar img.logo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
  flex-shrink: 0;
}

.topbar .brand {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.topbar .brand strong {
  font-size: 1.05rem;
  letter-spacing: 0.5px;
}

.topbar .brand span {
  font-size: 0.72rem;
  opacity: 0.85;
}

.hero {
  text-align: center;
  padding: 34px 16px 10px;
}

.hero h1 {
  font-size: 1.55rem;
  color: var(--azul);
  margin: 10px 0 8px;
}

.hero p {
  color: var(--gris);
  font-size: 0.95rem;
  max-width: 560px;
  margin: 0 auto 6px;
  line-height: 1.5;
}

.badge-tiempo {
  display: inline-block;
  margin-top: 10px;
  background: var(--azul-claro);
  color: var(--azul-2);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 600;
}

.card {
  background: #fff;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 22px 20px;
  margin: 18px 0;
}

.card h2 {
  font-size: 1.02rem;
  color: var(--azul);
  margin: 0 0 4px;
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.card h2 .num {
  background: var(--azul);
  color: #fff;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.card .hint {
  font-size: 0.8rem;
  color: #888;
  margin: 4px 0 14px;
}

.opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  border: 1px solid #e6eaf0;
  cursor: pointer;
  transition: 0.15s;
}

.opt:hover { background: var(--gris-claro); }

.opt input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--azul);
  flex-shrink: 0;
}

.opt.checked {
  background: var(--azul-claro);
  border-color: var(--azul-2);
}

.opt label {
  font-size: 0.92rem;
  cursor: pointer;
  line-height: 1.35;
}

input[type="text"], input[type="email"], input[type="tel"], textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  margin-top: 4px;
}

input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus, textarea:focus {
  outline: 2px solid var(--azul-2);
  border-color: var(--azul-2);
}

textarea { resize: vertical; min-height: 80px; }

.field { margin-bottom: 16px; }
.field label.field-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--azul);
  margin-bottom: 2px;
}
.req { color: var(--rojo); }

.otro-input { margin-top: 6px; margin-left: 30px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--azul);
  color: #fff;
  border: none;
  padding: 14px 26px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: 0.15s;
  box-shadow: 0 6px 16px rgba(11, 61, 102, 0.28);
}
.btn:hover { background: var(--azul-2); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-outline {
  background: transparent;
  color: var(--azul);
  border: 1.5px solid var(--azul);
  box-shadow: none;
}
.btn-outline:hover { background: var(--azul-claro); }

.footer-note {
  text-align: center;
  color: #93a0ad;
  font-size: 0.78rem;
  margin-top: 22px;
}

.error-box {
  background: #fdecec;
  color: var(--rojo);
  border: 1px solid #f4c4c8;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.87rem;
  margin-bottom: 14px;
  display: none;
}

.exito {
  text-align: center;
  padding: 60px 20px;
}
.exito .check {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: var(--verde);
  color: #fff;
  font-size: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.exito h2 { color: var(--azul); }
.exito p { color: var(--gris); max-width: 420px; margin: 0 auto; }

/* ---------- Admin ---------- */
.admin-wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px 60px; }

.admin-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--sombra);
  padding: 36px 30px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.login-card img { width: 72px; height: 72px; border-radius: 50%; margin-bottom: 10px; }
.login-card h1 { font-size: 1.2rem; color: var(--azul); margin: 6px 0 22px; }
.login-card .field { text-align: left; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.stat-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--sombra);
  padding: 18px;
  text-align: center;
}
.stat-card .n { font-size: 1.9rem; font-weight: 700; color: var(--azul); }
.stat-card .l { font-size: 0.8rem; color: var(--gris); margin-top: 4px; }

.tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0 6px;
  flex-wrap: wrap;
}
.tab-btn {
  border: 1.5px solid var(--azul);
  background: #fff;
  color: var(--azul);
  padding: 9px 18px;
  border-radius: 24px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.tab-btn.active { background: var(--azul); color: #fff; }

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 16px;
}
.chart-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--sombra);
  padding: 18px;
}
.chart-card h3 {
  font-size: 0.92rem;
  color: var(--azul);
  margin: 0 0 12px;
}
.chart-card .chart-holder { position: relative; width: 100%; height: 260px; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-card.wide .chart-holder { height: 320px; }

.free-text-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}
.free-text-list li {
  padding: 10px 12px;
  border-bottom: 1px solid #eef1f5;
  font-size: 0.87rem;
}
.free-text-list li strong { color: var(--azul-2); }

table.resp-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--sombra);
  font-size: 0.85rem;
}
table.resp-table th {
  background: var(--azul);
  color: #fff;
  text-align: left;
  padding: 10px 12px;
  position: sticky;
  top: 0;
}
table.resp-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef1f5;
  vertical-align: top;
}
table.resp-table tr:hover td { background: #f7fafc; }
.table-scroll { overflow-x: auto; border-radius: 12px; }
.btn-ver {
  background: var(--azul-claro);
  color: var(--azul-2);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 600;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 30, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: 14px;
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
}
.modal-box h3 { color: var(--azul); margin-top: 0; }
.modal-box .q-block { margin-bottom: 14px; }
.modal-box .q-block .qt { font-weight: 700; font-size: 0.85rem; color: var(--azul-2); margin-bottom: 4px; }
.modal-box .q-block .qa { font-size: 0.88rem; color: #333; white-space: pre-wrap; }
.modal-close {
  float: right;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #888;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 0 4px;
}
.admin-header .title { display: flex; align-items: center; gap: 12px; }
.admin-header img { width: 42px; height: 42px; border-radius: 50%; }
.admin-header h1 { font-size: 1.1rem; color: var(--azul); margin: 0; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-actions .btn, .admin-actions .btn-outline { width: auto; padding: 9px 16px; font-size: 0.85rem; }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.3rem; }
  .card { padding: 18px 14px; }
  .admin-header { flex-direction: column; align-items: flex-start; }
}
