:root{
  --bg:#070A12;
  --panel:#0D1223;
  --panel2:#0A0F1E;
  --text:#EAF0FF;
  --muted:#A9B4D0;
  --border:rgba(255,255,255,.10);

  --blue:#1E6BFF;
  --blue2:#2D8CFF;
  --red:#FF2D2D;
  --green:#1ED760;

  --shadow: 0 12px 40px rgba(0,0,0,.45);
  --radius:18px;
  --radius2:24px;
}
*{
    margin: 0;
  padding: 0;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(30,107,255,.20), transparent 60%),
    radial-gradient(800px 500px at 90% 30%, rgba(255,45,45,.14), transparent 55%),
    radial-gradient(700px 500px at 40% 90%, rgba(45,140,255,.10), transparent 60%),
    var(--bg);
  color:var(--text);
}

a{color:var(--blue2)}
a:hover{opacity:.9}

.container{
  max-width:1100px;
  margin:0 auto;
  padding:20px;
}

.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:16px 0 12px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.brand img{
  height:100px;
  width:auto;
  border-radius:12px;
  box-shadow: var(--shadow);
}
.brand .title{
  display:flex;
  flex-direction:column;
  line-height:1.1;
}
.brand .title strong{
  font-size:2em;
  letter-spacing:.2px;
}
.brand .title span{
  font-size:1em;
  color:var(--muted);
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  background:rgba(255,255,255,.06);
  border:1px solid var(--border);
  border-radius:999px;
  color:var(--muted);
  font-size:13px;
}
.badge .dot{
  width:8px;height:8px;border-radius:50%;
  background:var(--green);
  box-shadow:0 0 0 3px rgba(30,215,96,.15);
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.content{ padding:18px; }

.h1{
  margin:0;
  font-size:34px;
  letter-spacing:-.6px;
}
.h2{
  margin:0;
  font-size:22px;
  letter-spacing:-.2px;
}
.p{
  margin:6px 0 0;
  color:var(--muted);
  font-size:14.5px;
  line-height:1.45;
}

/* Buttons */
.btnbar{ display:flex; gap:10px; flex-wrap:wrap; margin-top:14px; }
button, .btn{
  appearance:none;
  border:0;
  cursor:pointer;
  text-align: center;
  border-radius:14px;
  padding:12px 14px;
  font-weight:650;
  font-size:14.5px;
  color:#fff;
  background: linear-gradient(180deg, var(--blue2), var(--blue));
  box-shadow: 0 10px 24px rgba(30,107,255,.25);
  transition: transform .08s ease, filter .2s ease, opacity .2s ease;
}
button:hover,.btn:hover{ filter:brightness(1.03) }
button:active,.btn:active{ transform: translateY(1px) }

.btn.secondary{
  background:rgba(255,255,255,.06);
  border:1px solid var(--border);
  color:var(--text);
  box-shadow:none;
}
.btn.danger{
  background: linear-gradient(180deg, #ff4a4a, var(--red));
  box-shadow: 0 10px 24px rgba(255,45,45,.18);
}

input, textarea, select{
  width:100%;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(0,0,0,.25);
  color:var(--text);
  outline:none;
}
input:focus, textarea:focus, select:focus{
  border-color: rgba(45,140,255,.55);
  box-shadow: 0 0 0 4px rgba(45,140,255,.12);
}

.notice{
  margin-top:14px;
  padding:14px;
  border-radius:16px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  color:var(--muted);
}
.notice.err{
  border-color: rgba(255,45,45,.35);
  background: rgba(255,45,45,.08);
  color:#ffd0d0;
}
.notice.ok{
  border-color: rgba(30,215,96,.35);
  background: rgba(30,215,96,.08);
  color:#cbffe1;
}

/* Table */
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius:18px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.18);
}
.table th, .table td{
  padding:12px 12px;
  border-bottom:1px solid rgba(255,255,255,.07);
  font-size:14px;
}
.table th{
  text-align:left;
  color:var(--muted);
  font-weight:700;
  background: rgba(255,255,255,.04);
}
.table tr:hover td{ background: rgba(255,255,255,.03) }
.table tr:last-child td{ border-bottom:0 }

code{
  padding:4px 8px;
  border-radius:999px;
  background: rgba(255,255,255,.08);
  border:1px solid var(--border);
  color:var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size:12.5px;
}

/* Pills / status */
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  font-size:13px;
}
.dot{ width:8px;height:8px;border-radius:50%; background:var(--muted) }
.dot.active{ background:var(--green); box-shadow:0 0 0 3px rgba(30,215,96,.12) }
.dot.draft{ background:#ffc94a; box-shadow:0 0 0 3px rgba(255,201,74,.12) }
.dot.closed{ background:var(--red); box-shadow:0 0 0 3px rgba(255,45,45,.12) }

/* Public poll page */
.pollwrap{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap:16px;
  align-items:stretch;
}
@media (max-width: 900px){
  .pollwrap{ grid-template-columns:1fr; }
}

.bigChoice{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  margin-top:14px;
}
.bigChoice button{
  padding:16px 14px;
  border-radius:18px;
  font-size:18px;
  letter-spacing:.2px;
}
.bigChoice .yes{
  background: linear-gradient(180deg, rgba(30,215,96,1), rgba(20,170,75,1));
  box-shadow: 0 14px 30px rgba(30,215,96,.18);
}
.bigChoice .no{
  background: linear-gradient(180deg, rgba(255,74,74,1), rgba(255,45,45,1));
  box-shadow: 0 14px 30px rgba(255,45,45,.18);
}

.qrBox{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.qrImg{
  width:320px;
  height:320px;
  background:#fff;
  border-radius:18px;
  padding:10px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.qrImg img{ width:100%; height:100%; }

.footer{
  padding:14px 0 30px;
  color:rgba(255,255,255,.35);
  font-size:12.5px;
}

/* =========================
   AUTH (Login) Center Layout
   ========================= */
body.auth .container{
  max-width: 720px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 18px;
}

body.auth .header{
  margin-bottom: 18px;
  justify-content: center;
}

body.auth .brand{
  justify-content: center;
}

/* Logo más grande en login */
body.auth .brand img{
  height: 90px;
  width: auto;
  border-radius: 22px;
  margin-bottom: 6px;
}

/* Centrar el card y que no sea tan ancho */
body.auth .card{
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

body.auth .content{
  padding: 22px;
}

/* Ajuste visual del botón en login */
body.auth button,
body.auth .btn{
  width: 100%;
  justify-content: center;
}

/* Labels */
body.auth label{
  display:block;
}

/* Card de login más compacta */
body.auth .card{
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}

body.auth .content{
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Inputs centrados y más angostos */
body.auth input{
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* Labels centrados */
body.auth label{
  text-align: center;
}

body.auth .btn{
  font-size: 18px;
  padding: 16px;
}

/* ===========================
   ENCUESTA PÚBLICA – UX/UI
   =========================== */

/* Contenedor principal */
.card {
  max-width: 720px;
  margin: 0 auto;
}

.card .content {
  padding: 28px 22px;
}

/* Título de la pregunta */
.card .h1 {
  font-size: 1.6rem;
  line-height: 1.3;
  margin-bottom: 12px;
}

/* Texto instructivo */
.card .p {
  font-size: 1rem;
  opacity: 0.85;
  margin-bottom: 24px;
}

/* Opciones */
.row {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 28px;
}

/* Tarjeta de opción */
.choice.option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 18px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.25s ease;
}

/* Hover (desktop) */
.choice.option:hover {
  background: rgba(255,255,255,0.06);
}

/* Seleccionado */
.choice.option.selected {
  background: rgba(48,146,255,0.12);
  border-color: rgba(48,146,255,0.7);
  box-shadow: 0 0 0 4px rgba(48,146,255,0.18);
}

/* Caja check */
.opt-box {
  margin-top: 4px;
}

/* Texto interno */
.opt-body .k {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.opt-body .k strong {
  font-size: 1.1rem;
}

.opt-body .k span {
  font-size: 0.85rem;
  opacity: 0.6;
}

.opt-body .p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.85;
}

/* Botonera */
.btnbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

/* Botón principal */
.btnbar button[data-submit] {
  height: 52px;
  font-size: 1.05rem;
  border-radius: 14px;
}

/* Botón volver */
.btnbar .btn.secondary {
  text-align: center;
  padding: 14px;
  border-radius: 14px;
}

/* Mensajes */
.notice {
  margin-top: 18px;
  padding: 14px 16px;
  font-size: 0.95rem;
}

/* ===========================
   MOBILE FIRST
   =========================== */
@media (max-width: 480px) {

  .card .content {
    padding: 22px 16px;
  }

  .card .h1 {
    font-size: 1.4rem;
  }

  .choice.option {
    padding: 16px;
  }

  .btnbar button[data-submit] {
    font-size: 1rem;
  }
}

.btn.danger{
  border: 1px solid rgba(255,80,80,.35);
  background: rgba(255,80,80,.10);
}
.btn.danger:hover{
  border-color: rgba(255,80,80,.55);
  background: rgba(255,80,80,.16);
}

/* =========================================================
   FIX MOBILE OVERFLOW (NO CAMBIA TU DISEÑO, SOLO EVITA ROTURA)
   ========================================================= */

/* 1) Cortar overflow fantasma en móviles */
html, body{
  max-width:100%;
  overflow-x:hidden;
}

/* 2) Evitar que cualquier imagen empuje el ancho */
img{
  max-width:100%;
  height:auto;
}

/* 3) La página nunca debe ser más ancha que el viewport */
.container{
  width:100%;
  max-width:1100px; /* mantiene tu diseño en desktop */
}

/* 4) El header en móvil debe poder bajar de línea */
.header{
  flex-wrap:wrap;
}

/* 5) Badge no debe empujar el ancho: que pueda partir texto */
.badge{
  max-width:100%;
  white-space:normal;
}

/* 6) En móvil: bajar un poco logo/títulos para que no empujen */
@media (max-width: 520px){
  .container{ padding:16px; }

  .brand img{ height:72px; }

  .brand .title strong{
    font-size:1.55em;
    line-height:1.05;
  }
  .brand .title span{
    font-size:.95em;
  }

  /* El badge baja solo si no cabe */
  .badge{
    margin-left:0;
  }
}

/* 7) El card siempre dentro del viewport */
.card{
  width:100%;
  max-width:720px; /* tu mismo ancho */
}
