:root {
    --rotary-blue: #18478f;
    --rotary-yellow: #f7a81b;
    --rotary-text: #1f2d3d;
    --rotary-muted: #5f6b78;
    --rotary-bg: #f6f8fb;
    --rotary-card: #ffffff;
    --rotary-border: #d8dee7;
    --rotary-danger: #b42318;
    --radius: 14px;
    --shadow: 0 10px 22px rgba(24, 71, 143, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    color: var(--rotary-text);
    background:
        radial-gradient(circle at 8% 0%, rgba(247, 168, 27, 0.2) 0, transparent 28%),
        radial-gradient(circle at 95% 10%, rgba(24, 71, 143, 0.18) 0, transparent 30%),
        var(--rotary-bg);
    min-height: 100vh;
}

h1,
h2,
h3 {
    margin: 0 0 0.6rem;
    color: var(--rotary-blue);
}

h1 {
    font-size: clamp(1.65rem, 2.8vw, 2.55rem);
}

h2 {
    font-size: clamp(1.35rem, 2.2vw, 2rem);
}

h3 {
    font-size: clamp(1.1rem, 1.8vw, 1.45rem);
}

p {
    margin: 0;
}

a {
    color: var(--rotary-blue);
    text-decoration: none;
}

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
}

.site-topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--rotary-border);
    box-shadow: 0 5px 14px rgba(24, 71, 143, 0.08);
}

.site-topbar-inner {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 0.8rem;
}

.site-logo img {
    display: block;
    width: min(620px, 100%);
    margin: 0 auto;
    height: auto;
    border-radius: 10px;
    border: 1px solid #e4e9f3;
}

.site-footer {
    margin-top: 1.2rem;
    background: #ffffff;
    border-top: 1px solid var(--rotary-border);
    padding: 0.95rem 1rem;
    text-align: center;
}

.site-footer .footer-logo {
    display: block;
    margin: 0 auto 0.55rem;
    width: min(240px, 84vw);
    height: auto;
    border-radius: 8px;
    border: 1px solid #e4e9f3;
}

.site-footer p {
    color: #4b5563;
    font-size: 0.88rem;
    line-height: 1.4;
}

.site-footer a {
    color: var(--rotary-blue);
    text-decoration: underline;
    font-weight: 700;
}

.page-wrap,
.admin-wrap,
.telao-wrap {
    width: min(1100px, 92vw);
    margin: 1.8rem auto;
}

.page-center {
    min-height: calc(100vh - 180px);
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.card {
    background: var(--rotary-card);
    border: 1px solid var(--rotary-border);
    border-radius: var(--radius);
    padding: 1.2rem;
    box-shadow: var(--shadow);
}

.auth-card {
    width: min(480px, 92vw);
}

.stack {
    display: grid;
    gap: 0.8rem;
    margin-top: 1rem;
}

.grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    align-items: end;
}

.grid-two > .btn,
.grid-two > button,
.grid-two > a {
    grid-column: 1 / -1;
}

@media (max-width: 760px) {
    .grid-two {
        grid-template-columns: 1fr;
    }

    .site-logo img {
        width: 100%;
    }
}

label {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

input,
select,
button {
    font: inherit;
}

input,
select {
    width: 100%;
    border: 1px solid var(--rotary-border);
    border-radius: 10px;
    padding: 0.7rem 0.75rem;
    background: #fff;
}

input:focus,
select:focus {
    outline: 2px solid rgba(24, 71, 143, 0.25);
    border-color: var(--rotary-blue);
}

.btn {
    border: 0;
    border-radius: 10px;
    padding: 0.72rem 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    position: relative;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.btn:hover {
    filter: brightness(0.97);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--rotary-blue);
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: var(--rotary-blue);
    border: 1px solid var(--rotary-blue);
}

.btn-warning {
    background: #fef0c7;
    color: #92400e;
    border: 1px solid #f7a81b;
}

.btn-danger {
    background: #ffe9e7;
    color: var(--rotary-danger);
    border: 1px solid #f9b7b1;
}

.btn-large {
    padding: 0.95rem 1.2rem;
    font-size: 1.02rem;
}

.btn.is-loading {
    pointer-events: none;
    color: transparent !important;
}

.btn.is-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.95);
    border-top-color: transparent;
    border-radius: 50%;
    position: absolute;
    animation: btn-spin 0.7s linear infinite;
}

.btn-secondary.is-loading::after {
    border-color: rgba(24, 71, 143, 0.95);
    border-top-color: transparent;
}

.btn-warning.is-loading::after {
    border-color: rgba(146, 64, 14, 0.95);
    border-top-color: transparent;
}

.btn-danger.is-loading::after {
    border-color: rgba(180, 35, 24, 0.95);
    border-top-color: transparent;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

.eyebrow {
    color: var(--rotary-yellow);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.muted {
    color: var(--rotary-muted);
}

.brand-banner {
    margin-bottom: 1rem;
    text-align: center;
    padding: 1rem;
}

.vote-card {
    width: min(760px, 95vw);
    margin: 0 auto;
}

.options-grid {
    border: 0;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.8rem;
}

.option-item {
    border: 1px solid var(--rotary-border);
    border-radius: 12px;
    padding: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: #fff;
}

.option-item input[type="radio"] {
    width: 18px;
    height: 18px;
}

.option-label {
    font-weight: 700;
}

.message {
    border-radius: 10px;
    border: 1px solid transparent;
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.message.success {
    color: #14532d;
    border-color: #86efac;
    background: #ecfdf3;
}

.message.error {
    color: #7f1d1d;
    border-color: #f8b4b4;
    background: #fef2f2;
}

.message.info {
    color: #1e3a8a;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.admin-wrap {
    display: grid;
    gap: 1rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.admin-user-box {
    text-align: right;
    display: grid;
    gap: 0.45rem;
}

@media (max-width: 760px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-user-box {
        text-align: left;
    }
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.9rem;
}

.actions-row .btn {
    flex: 1 1 180px;
    text-align: center;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 0.85rem;
    -webkit-overflow-scrolling: touch;
}

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 640px;
}

th,
td {
    text-align: left;
    padding: 0.65rem;
    border-bottom: 1px solid var(--rotary-border);
    font-size: 0.93rem;
}

th {
    background: #eef3fb;
    color: #17366a;
    font-weight: 700;
}

.status-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-weight: 700;
    font-size: 0.78rem;
}

.status-draft {
    background: #f3f4f6;
    color: #374151;
}

.status-open {
    background: #dcfce7;
    color: #166534;
}

.status-closed {
    background: #fee2e2;
    color: #991b1b;
}

.telao-body {
    background: linear-gradient(140deg, #0d2f64, #18478f 40%, #0f2850);
    color: #fff;
}

.telao-body .site-topbar {
    background: #ffffff;
}

.telao-body .site-footer {
    background: rgba(255, 255, 255, 0.94);
}

.telao-wrap {
    width: min(1220px, 96vw);
}

.telao-header {
    text-align: center;
    margin-bottom: 1rem;
}

.telao-header .eyebrow {
    color: #ffd47a;
}

.telao-header h1 {
    font-size: clamp(1.8rem, 3vw, 3rem);
    color: #fff;
}

.telao-header .muted,
.telao-total {
    color: #dbeafe;
}

.telao-total.bump strong {
    display: inline-block;
    animation: total-pop 0.8s ease;
}

@keyframes total-pop {
    0% {
        transform: scale(1);
    }

    35% {
        transform: scale(1.22);
    }

    100% {
        transform: scale(1);
    }
}

.telao-card {
    background: rgba(255, 255, 255, 0.98);
}

.bars {
    display: grid;
    gap: 1rem;
}

.bar-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.65rem;
    align-items: center;
    transition: background-color 0.4s ease;
}

.bar-row.vote-hit {
    padding: 0.45rem;
    border-radius: 12px;
    background: rgba(247, 168, 27, 0.22);
    animation: vote-row-fade 1.4s ease;
}

@keyframes vote-row-fade {
    0% {
        background: rgba(247, 168, 27, 0.42);
    }

    100% {
        background: rgba(247, 168, 27, 0.05);
    }
}

.bar-label {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.bar-track {
    width: 100%;
    border-radius: 999px;
    background: #dde5f3;
    overflow: hidden;
    height: 24px;
}

.bar-fill {
    height: 24px;
    background: linear-gradient(90deg, var(--rotary-yellow), #f59e0b);
    border-right: 2px solid #e88a00;
    transition: width 0.7s ease;
}

.bar-row.vote-hit .bar-fill {
    animation: vote-fill-pulse 0.9s ease;
}

@keyframes vote-fill-pulse {
    0% {
        filter: brightness(1);
    }

    40% {
        filter: brightness(1.2);
    }

    100% {
        filter: brightness(1);
    }
}

.bar-meta {
    color: #0b2d5e;
    font-weight: 800;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 1024px) {
    .page-wrap,
    .admin-wrap,
    .telao-wrap {
        width: 94vw;
        margin: 1.2rem auto;
    }

    .card {
        padding: 1rem;
    }

    .admin-user-box {
        width: 100%;
    }

    .admin-user-box .btn {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .site-topbar-inner {
        padding: 0.65rem 0.75rem;
    }

    .site-logo img {
        border-radius: 8px;
    }

    .page-wrap,
    .admin-wrap,
    .telao-wrap {
        width: 94vw;
        margin: 1rem auto;
    }

    .brand-banner {
        padding: 0.55rem 0.25rem 0.8rem;
    }

    .vote-card {
        width: 100%;
    }

    .option-item {
        padding: 0.55rem;
    }

    .btn,
    .btn-large {
        width: 100%;
    }

    .actions-row {
        gap: 0.45rem;
    }

    .actions-row .btn {
        flex-basis: 100%;
    }

    table {
        min-width: 560px;
    }

    th,
    td {
        padding: 0.55rem;
        font-size: 0.86rem;
        white-space: nowrap;
    }

    .telao-header {
        margin-bottom: 0.75rem;
    }

    .telao-header h1 {
        font-size: clamp(1.55rem, 6.5vw, 2.15rem);
        line-height: 1.12;
    }

    .bars {
        gap: 0.8rem;
    }

    .bar-row {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .bar-meta {
        justify-self: end;
        font-size: 0.98rem;
    }

    .bar-track,
    .bar-fill {
        height: 18px;
    }

    .site-footer {
        padding: 0.85rem 0.75rem;
    }
}

@media (max-width: 520px) {
    .site-topbar-inner {
        padding: 0.55rem;
    }

    .site-logo img {
        border-radius: 6px;
    }

    .page-center {
        min-height: calc(100vh - 130px);
        padding: 0.9rem 0.65rem;
    }

    .card {
        border-radius: 12px;
        padding: 0.85rem;
    }

    .auth-card {
        width: 100%;
    }

    input,
    select,
    button {
        font-size: 16px;
    }

    label {
        font-size: 0.88rem;
    }

    .eyebrow {
        font-size: 0.82rem;
    }

    .message {
        font-size: 0.9rem;
        padding: 0.65rem 0.7rem;
    }

    table {
        min-width: 500px;
    }

    .site-footer .footer-logo {
        width: min(210px, 80vw);
    }

    .site-footer p {
        font-size: 0.78rem;
    }
}
