/* ============================================================
   Encuestas Arenal — Frontend (estilos base sin tema)
   ============================================================ */

.ea-poll {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    max-width: 620px;
    margin: 24px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ── Cabecera ── */
.ea-poll-header { margin-bottom: 20px; }

.ea-poll-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px;
    line-height: 1.4;
}

.ea-poll-desc {
    font-size: 0.88rem;
    color: #6b7280;
    margin: 0;
}

/* ── Badges ── */
.ea-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 99px;
    margin-bottom: 10px;
}
.ea-badge-cerrada  { background: #fef3c7; color: #92400e; }
.ea-badge-borrador { background: #ede9fe; color: #5b21b6; }

/* ── Hint de selección múltiple ── */
.ea-poll-hint {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 12px;
    padding: 6px 10px;
    background: #f3f4f6;
    border-radius: 6px;
}

/* ── Opciones ── */
.ea-opciones { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }

.ea-opcion-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    user-select: none;
}
.ea-opcion-label:hover { border-color: #3b82f6; background: #eff6ff; }

.ea-opcion-input { width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; accent-color: #3b82f6; }

.ea-opcion-label:has(.ea-opcion-input:checked) {
    border-color: #3b82f6;
    background: #eff6ff;
}

.ea-opcion-texto { font-size: 0.95rem; color: #1f2937; }

/* ── Botón votar ── */
.ea-btn-votar {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.ea-btn-votar:hover  { background: #1d4ed8; }
.ea-btn-votar:active { transform: scale(.97); }
.ea-btn-votar:disabled { opacity: .6; cursor: default; }

/* ── Cambiar voto ── */
.ea-already-voted {
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 12px;
}
.ea-btn-cambiar {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    color: #374151;
    transition: background .15s;
}
.ea-btn-cambiar:hover { background: #f3f4f6; }

.ea-closed-msg { font-size: 0.9rem; color: #6b7280; margin-bottom: 12px; }

/* ── Loading / mensajes ── */
.ea-loading { font-size: 0.9rem; color: #6b7280; margin-top: 8px; }
.ea-message { font-size: 0.9rem; margin-top: 10px; padding: 8px 12px; border-radius: 6px; }
.ea-message.success { background: #d1fae5; color: #065f46; }
.ea-message.error   { background: #fee2e2; color: #991b1b; }

/* ── Resultados ── */
.ea-results.ea-hidden  { display: none; }
.ea-results.ea-visible { display: block; }

.ea-results-inner { margin-top: 12px; }

.ea-results-summary {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
}

.ea-bars { display: flex; flex-direction: column; gap: 12px; }

.ea-bar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }

.ea-bar-label {
    display: flex;
    align-items: center;
    gap: 6px;
    grid-column: 1;
}
.ea-bar-texto { font-size: 0.9rem; color: #1f2937; flex: 1; }
.ea-bar-pct   { font-size: 0.8rem; color: #6b7280; white-space: nowrap; }

.ea-your-vote-tag {
    font-size: 11px;
    background: #2563eb;
    color: #fff;
    border-radius: 4px;
    padding: 1px 5px;
    font-weight: 700;
}

.ea-bar-track {
    grid-column: 1;
    background: #f3f4f6;
    border-radius: 99px;
    height: 10px;
    overflow: hidden;
}
.ea-bar-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 99px;
    width: 0;
    transition: width .6s ease;
}
.ea-bar-fill-user { background: #2563eb; }

.ea-bar-count {
    grid-column: 2;
    grid-row: 1 / 3;
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
    align-self: center;
}

.ea-bar-row.ea-user-vote .ea-bar-texto { font-weight: 600; color: #1d4ed8; }

/* ── Error ── */
.ea-error { color: #991b1b; font-style: italic; font-size: 0.9rem; }

/* ── Responsive ── */
@media (max-width: 480px) {
    .ea-poll { padding: 16px; }
    .ea-poll-title { font-size: 1.05rem; }
    .ea-btn-votar { width: 100%; text-align: center; }
}
