:root {
    --fondo: #F5F3EE;
    --texto: #333333;
    --acento: #1A1A1A;
    --dorado: #B8974E;
    --balota-blanca: #FFFFFF;
    --balota-blanca-borde: #D9D2C0;
    --balota-negra: #0D0D0D;
    --exito: #4A6B4A;
    --alerta: #8B3A3A;
    --card-borde: #E4DFD3;
    --sombra: 0 2px 8px rgba(26, 26, 26, 0.08);
    --sombra-suave: 0 1px 2px rgba(26, 26, 26, 0.04), 0 6px 16px rgba(26, 26, 26, 0.07);
    --sombra-hover: 0 2px 4px rgba(26, 26, 26, 0.06), 0 10px 24px rgba(26, 26, 26, 0.11);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 17px;
    background-color: var(--fondo);
    background-image:
        radial-gradient(ellipse 800px 600px at 12% -8%, rgba(184, 151, 78, 0.07), transparent 60%),
        radial-gradient(ellipse 700px 550px at 105% 105%, rgba(26, 26, 26, 0.035), transparent 55%),
        repeating-linear-gradient(115deg, rgba(26, 26, 26, 0.015) 0px, rgba(26, 26, 26, 0.015) 1px, transparent 1px, transparent 4px);
    background-attachment: fixed;
    color: var(--texto);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

.contenedor {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    animation: entrada-suave 0.4s ease-out;
}

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

@media (prefers-reduced-motion: reduce) {
    .contenedor {
        animation: none;
    }
}

.encabezado {
    text-align: center;
    margin-bottom: 24px;
}

.logo-institucional {
    display: block;
    max-height: 96px;
    max-width: 60%;
    height: auto;
    width: auto;
    margin: 0 auto 12px;
}

.encabezado h1 {
    font-size: 1.6rem;
    line-height: 1.3;
    margin: 0 0 6px;
    color: var(--acento);
    letter-spacing: 0.01em;
}

.encabezado .subtitulo {
    font-size: 0.95rem;
    color: var(--dorado);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.logo-linea,
.separador-dorado {
    position: relative;
    width: 72px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--dorado), transparent);
    margin: 14px auto 0;
    border-radius: 2px;
}

.logo-linea::after,
.separador-dorado::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: var(--dorado);
    transform: translate(-50%, -50%) rotate(45deg);
    border-radius: 1px;
}

.separador-dorado {
    margin: 24px auto;
}

h2 {
    font-size: 1.25rem;
    line-height: 1.35;
    color: var(--acento);
    margin-top: 0;
}

p {
    margin: 0 0 16px;
    line-height: 1.6;
}

.card {
    background: #fff;
    border: 1px solid var(--card-borde);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--sombra-suave);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card a.card-link:active {
    transform: scale(0.99);
}

@media (hover: hover) {
    .card:has(a.card-link):hover {
        box-shadow: var(--sombra-hover);
        transform: translateY(-2px);
    }
}

.card h3 {
    margin: 0 0 6px;
    font-size: 1.2rem;
    line-height: 1.35;
    color: var(--acento);
}

.card .descripcion {
    font-size: 1rem;
    line-height: 1.55;
    color: #555;
    margin-bottom: 10px;
}

.card a.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.timer {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dorado);
    background: #FBF8F0;
    border: 1px solid #EDE3CB;
    border-radius: 20px;
    padding: 4px 12px;
    margin-top: 4px;
    box-shadow: 0 1px 3px rgba(184, 151, 78, 0.12);
}

.timer.vencido {
    color: var(--alerta);
    background: #FBF1F1;
    border-color: #EAD0D0;
}

label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--acento);
}

input[type=text],
input[type=password],
input[type=datetime-local],
textarea,
select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #CFC9BA;
    border-radius: 12px;
    font-size: 1.05rem;
    line-height: 1.5;
    margin-bottom: 16px;
    background: #fff;
    color: var(--texto);
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--dorado);
    box-shadow: 0 0 0 3px rgba(184, 151, 78, 0.15);
}

.btn {
    display: block;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    font-size: 1.1rem;
    line-height: 1.3;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(26, 26, 26, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}

.btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 1px 1px rgba(26, 26, 26, 0.05);
}

.btn-primario {
    background: var(--acento);
    color: #fff;
}

.btn-primario:active {
    opacity: 0.85;
}

.btn-dorado {
    background: var(--dorado);
    color: #fff;
}

.btn-secundario {
    background: #fff;
    color: var(--acento);
    border: 1px solid #CFC9BA;
}

.btn-pequeno {
    padding: 10px 14px;
    font-size: 0.85rem;
    width: auto;
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 8px;
}

.btn-exito {
    background: var(--exito);
    color: #fff;
}

.btn-alerta {
    background: var(--alerta);
    color: #fff;
}

@media (hover: hover) {
    .btn:hover {
        transform: translateY(-1px);
    }
    .btn-primario:hover, .btn-dorado:hover, .btn-exito:hover, .btn-alerta:hover {
        box-shadow: 0 6px 16px rgba(26, 26, 26, 0.18);
    }
    .btn-secundario:hover {
        border-color: var(--dorado);
        box-shadow: 0 4px 14px rgba(184, 151, 78, 0.18);
    }
}

.opciones-voto {
    display: flex;
    gap: 14px;
    margin: 24px 0;
}

.opcion-balota {
    flex: 1;
    background: #fff;
    border: 2px solid var(--card-borde);
    border-radius: 18px;
    padding: 24px 12px;
    text-align: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: var(--sombra-suave);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.opcion-balota:active {
    border-color: var(--dorado);
    transform: scale(0.97);
}

@media (hover: hover) {
    .opcion-balota:hover {
        border-color: var(--dorado);
        box-shadow: var(--sombra-hover);
        transform: translateY(-2px);
    }
}

.balota {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 12px;
}

.balota.blanca {
    background: var(--balota-blanca);
    border: 2px solid var(--balota-blanca-borde);
}

.balota.negra {
    background: var(--balota-negra);
}

.balota.grande {
    width: 96px;
    height: 96px;
}

.opciones-lista {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.opcion-custom {
    background: #fff;
    border: 2px solid var(--card-borde);
    border-radius: 14px;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1.4;
    box-shadow: var(--sombra-suave);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.opcion-custom:active {
    border-color: var(--dorado);
    transform: scale(0.98);
}

@media (hover: hover) {
    .opcion-custom:hover {
        border-color: var(--dorado);
        box-shadow: var(--sombra-hover);
        transform: translateY(-2px);
    }
}

.mensaje {
    text-align: center;
    padding: 32px 16px;
}

.mensaje .icono {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.mensaje.exito { color: var(--exito); }
.mensaje.alerta { color: var(--alerta); }

.modal-fondo {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 26, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
}

.modal-fondo.visible {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 20px;
    padding: 28px 22px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 16px 40px rgba(26, 26, 26, 0.25);
    animation: entrada-suave 0.25s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .modal {
        animation: none;
    }
}

.modal p {
    font-size: 1.1rem;
    line-height: 1.5;
    font-weight: 600;
    margin-bottom: 20px;
}

.badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge.abierta {
    background: #EAF2EA;
    color: var(--exito);
}

.badge.cerrada {
    background: #F2E9E9;
    color: var(--alerta);
}

.fila-acciones {
    display: flex;
    flex-wrap: wrap;
    margin-top: 10px;
}

.resultado-barra-wrap {
    margin-bottom: 14px;
}

.resultado-barra-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.resultado-barra-fondo {
    background: #EDE9DD;
    border-radius: 8px;
    height: 14px;
    overflow: hidden;
}

.resultado-barra {
    background: var(--dorado);
    height: 100%;
}

.error {
    background: #FBF1F1;
    border: 1px solid #EAD0D0;
    color: var(--alerta);
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

.exito-caja {
    background: #EEF3EE;
    border: 1px solid #D4E0D4;
    color: var(--exito);
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

.pie-link {
    text-align: center;
    margin-top: 8px;
}

.pie-link a {
    color: #888;
    font-size: 0.85rem;
    text-decoration: none;
}

.oculto {
    display: none !important;
}

.opciones-form-lista .opcion-form-item {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.opciones-form-lista .opcion-form-item input {
    margin-bottom: 0;
    flex: 1;
}

.opciones-form-lista .quitar-opcion {
    background: #fff;
    border: 1px solid #CFC9BA;
    border-radius: 10px;
    width: 44px;
    color: var(--alerta);
    font-weight: 700;
    cursor: pointer;
}

.checkbox-fila {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.checkbox-fila input {
    width: auto;
    margin: 0;
}

.checkbox-fila label {
    margin: 0;
    font-weight: 500;
}

.campo-password-wrap {
    position: relative;
    margin-bottom: 16px;
}

.campo-password-wrap input {
    margin-bottom: 0;
    padding-right: 44px;
}

.btn-toggle-password {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: #9A9484;
    transition: color 0.15s ease;
}

.btn-toggle-password:hover,
.btn-toggle-password:active {
    color: var(--dorado);
}

@media (min-width: 520px) {
    .contenedor {
        padding-top: 40px;
    }
}
