/* Estilo alineado con facegov.org */
:root {
  --ink: #000000;
  --ink-2: #374151;
  --muted: #6b7280;
  --bg: #ffffff;
  --soft: #f3f4f6;
  --line: #e5e7eb;
  --gold: #eab308;
  --gold-dark: #ca8a04;
  --yellow: #eab308;
  --star: #eab308;
  --star-off: #d1d5db;
  --error: #dc2626;

  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1);

  --body: 'Bellota Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --head: 'Mukta', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.5;
  display: flex; flex-direction: column; min-height: 100vh;
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Encabezado */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 14px 16px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: block; line-height: 0; }
.brand img { height: 40px; width: auto; }
.topbar-tag {
  margin-left: auto;
  font-family: var(--head); font-weight: 600; font-size: 15px;
  background: var(--yellow); color: #fff;
  padding: 6px 16px; border-radius: 9999px; white-space: nowrap;
}
@media (max-width: 480px) {
  .brand img { height: 32px; }
  .topbar-tag { font-size: 13px; padding: 5px 12px; }
}

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 36px 16px 56px; flex: 1; }

/* Intro */
.intro { text-align: center; margin-bottom: 32px; }
.chip {
  display: inline-block; margin-bottom: 14px;
  background: var(--soft); border-radius: 9999px; padding: 6px 16px;
  font-size: 14px; color: var(--ink-2);
}
.intro h1 {
  margin: 0 0 10px; font-family: var(--head); font-weight: 800;
  font-size: clamp(32px, 6.5vw, 52px); line-height: 1.05; letter-spacing: -.01em;
}
.lead { margin: 0 auto; max-width: 600px; color: var(--ink-2); font-size: 17px; }

/* Preguntas */
.question { border: 0; margin: 0 0 32px; padding: 0; min-width: 0; }
.q-head {
  float: left; width: 100%; padding: 0; margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px;
}
.q-head + * { clear: both; }
.q-num {
  flex: none; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: #000; color: #fff;
  font-family: var(--head); font-weight: 800; font-size: 17px;
}
.q-text { font-family: var(--head); font-size: clamp(20px, 3.8vw, 26px); font-weight: 600; line-height: 1.25; }

/* Grid de tarjetas */
.grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 960px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

.card {
  position: relative; display: block;
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow-xl); transform: translateY(-2px); }
.card input { position: absolute; opacity: 0; pointer-events: none; }
.card:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 3px; }
.card:has(input:checked) { box-shadow: 0 0 0 4px var(--gold), var(--shadow-xl); }

.photo {
  position: relative; display: block;
  aspect-ratio: 3 / 4;
  background: #111;
  overflow: hidden;
}
.photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; display: block;
  filter: grayscale(1) contrast(1.05);
  transition: filter .25s ease, transform .4s ease;
}
.card:hover .photo img { transform: scale(1.03); }
.card:has(input:checked) .photo img { filter: none; }
.photo.no-img { display: grid; place-items: center; }
.photo.no-img .initials { font-family: var(--head); font-size: 44px; font-weight: 800; color: #fff; margin-bottom: 30%; }

/* Degradado para que el nombre se lea sobre la foto */
.photo::after {
  content: ''; position: absolute; inset: 45% 0 0 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .85), rgba(0, 0, 0, 0));
  pointer-events: none;
}
.overlay {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: 0 16px 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.name {
  font-family: var(--head); font-weight: 800; color: #fff;
  font-size: clamp(17px, 2vw, 22px); line-height: 1.05;
}
.party { font-family: var(--head); color: #f3f4f6; font-size: 15px; }

.card-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 12px;
  font-family: var(--head); font-size: 14px; text-transform: uppercase; letter-spacing: .02em;
}
.card-foot .pick { color: var(--ink-2); }
.card:has(input:checked) .card-foot .pick { color: var(--gold-dark); font-weight: 800; }

.mark {
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--star-off); color: #fff;
  transition: background .15s ease, border-color .15s ease;
}
.mark svg { opacity: 0; transition: opacity .15s ease; }
.card:has(input:checked) .mark { background: var(--gold); border-color: var(--gold); }
.card:has(input:checked) .mark svg { opacity: 1; }

@media (max-width: 560px) {
  .card { border-radius: 18px; }
  .overlay { padding: 0 12px 10px; }
  .party { font-size: 13px; }
  .card-foot { padding: 8px 12px 10px; font-size: 12px; }
}

/* Opciones sin imagen */
.extra { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }
.option-pill {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 50px; padding: 10px 24px;
  background: #fff; border: 2px solid var(--line); border-radius: 9999px;
  font-family: var(--head); font-weight: 600; font-size: 17px;
  cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.option-pill:hover { border-color: #9ca3af; }
.option-pill input { position: absolute; opacity: 0; pointer-events: none; }
.option-pill .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #9ca3af; flex: none; }
.option-pill:has(input:checked) { border-color: var(--gold); background: #fefce8; }
.option-pill:has(input:checked) .dot { border: 5px solid var(--gold); }
.option-pill:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (max-width: 560px) { .option-pill { width: 100%; justify-content: center; } }

/* Calificación */
.rating-box {
  background: #fff; border-radius: 24px; box-shadow: var(--shadow-lg);
  padding: 24px 20px 26px;
  animation: aparece .25s ease;
}
.rating-box .q-head { justify-content: center; text-align: left; }
.rating-box strong { font-weight: 800; }
.rating { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.stars { display: inline-flex; flex-direction: row-reverse; gap: 6px; }
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars label {
  width: clamp(46px, 12vw, 58px); height: clamp(46px, 12vw, 58px);
  cursor: pointer;
  background: var(--star-off);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.94 5.96 6.56.95-4.75 4.63 1.12 6.54L12 17.5l-5.87 3.08 1.12-6.54L2.5 9.41l6.56-.95z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.94 5.96 6.56.95-4.75 4.63 1.12 6.54L12 17.5l-5.87 3.08 1.12-6.54L2.5 9.41l6.56-.95z'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: background-color .1s ease, transform .1s ease;
}
.stars label:hover,
.stars label:hover ~ label,
.stars input:checked ~ label { background: var(--star); }
.stars label:hover { transform: scale(1.08); }
.stars:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 6px; border-radius: 8px; }
.stars-label { margin: 0; font-family: var(--head); font-size: 17px; color: var(--ink-2); min-height: 1.5em; }

/* Honeypot: fuera de pantalla (no display:none, algunos bots lo detectan) */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Botones */
.actions { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; max-width: 380px; min-height: 54px; padding: 0 28px;
  border: 0; border-radius: 9999px;
  background: var(--gold); color: #fff;
  font-family: var(--head); font-size: 19px; font-weight: 800;
  text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: background .15s ease, transform .1s ease, opacity .15s ease;
}
.btn:hover:not(:disabled) { background: var(--gold-dark); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:focus-visible { outline: 3px solid #000; outline-offset: 3px; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.fine { margin: 0; color: var(--muted); font-size: 14px; text-align: center; }
.error { margin: 0; color: var(--error); font-weight: 700; text-align: center; }

/* Confirmación */
.done {
  max-width: 560px; margin: 0 auto; text-align: center;
  background: #fff; border-radius: 24px; box-shadow: var(--shadow-xl);
  padding: 44px 24px; animation: aparece .3s ease; outline: none;
}
.check {
  display: grid; place-items: center; margin: 0 auto 16px;
  width: 68px; height: 68px; border-radius: 50%;
  background: var(--gold); color: #fff;
}
.done h2 { margin: 0 0 6px; font-family: var(--head); font-weight: 800; font-size: 30px; }
.done p { margin: 0 0 24px; color: var(--ink-2); }
.btn-link { width: auto; }

/* Pie */
.foot { background: var(--soft); color: var(--muted); font-size: 14px; }
.foot-inner {
  max-width: 1200px; margin: 0 auto; padding: 22px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
}
.foot img { height: 26px; width: auto; opacity: .85; }
.foot p { margin: 0; }

[hidden] { display: none !important; }

@keyframes aparece { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
