/* HSA eVote — Reusable UI components (control, reports, login, live status) */

.control-brand-banner {
    background: var(--hsa-white);
    border-radius: var(--evote-card-radius);
    border-top: 3px solid var(--hsa-gold);
    border-bottom: 1px solid #E8E4DC;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.control-brand-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

@media (min-width: 576px) {
    .control-brand-inner {
        flex-direction: row;
        text-align: right;
        justify-content: space-between;
        align-items: center;
    }
}

.control-brand-banner .hsa-logo-full {
    max-width: min(200px, 70vw);
    margin: 0;
}

.control-brand-company {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hsa-gold-darker);
    margin: 0 0 0.25rem;
    line-height: 1.4;
}

.control-brand-meeting {
    font-size: 0.95rem;
    color: var(--hsa-black-soft);
    font-weight: 600;
}

.control-brand-date {
    font-size: 0.85rem;
    color: var(--hsa-gray);
}

.control-schedule-hint {
    font-size: 0.85rem;
    color: var(--hsa-gray);
    padding: 0.65rem 1rem;
    margin-bottom: 1rem;
    background: var(--hsa-gold-light);
    border-radius: 0.5rem;
    border-right: 3px solid var(--hsa-gold);
}

.control-status-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: var(--evote-card-radius);
    margin-bottom: 1.25rem;
    border: 1px solid #E8E4DC;
    background: var(--hsa-white);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.control-status-strip .live-status-hint {
    margin-right: auto;
    width: auto;
    flex: 1 1 200px;
}

.control-voting-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 2rem;
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
}

.control-voting-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.control-voting-badge--open {
    background: rgba(25, 135, 84, 0.1);
    color: #146c43;
    border: 1px solid rgba(25, 135, 84, 0.3);
}

.control-voting-badge--open::before {
    background: var(--evote-success);
    box-shadow: 0 0 0 2px rgba(25, 135, 84, 0.2);
}

.control-voting-badge--closed {
    background: rgba(107, 107, 107, 0.08);
    color: var(--hsa-gray);
    border: 1px solid #dee2e6;
}

.control-voting-badge--closed::before {
    background: #adb5bd;
}

.control-stat-card .display-6 {
    font-size: calc(1.75rem + 1.5vw);
    line-height: 1.1;
}

.control-stat-pct {
    font-size: 0.875rem;
    color: var(--hsa-gray);
    margin-top: 0.35rem;
    font-weight: 600;
}

.control-open-panel {
    background: var(--hsa-white);
    border-radius: var(--evote-card-radius);
    border: 1px solid rgba(25, 135, 84, 0.25);
    border-top: 3px solid var(--evote-success);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 10px rgba(25, 135, 84, 0.08);
}

.control-open-panel-title {
    font-weight: 700;
    color: #146c43;
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.control-open-panel .btn-success {
    font-size: 1.05rem;
    padding: 0.65rem 1.75rem;
    min-height: var(--evote-touch-min);
    font-weight: 700;
}

.control-active-panel {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.06) 0%, var(--hsa-white) 100%);
    border-radius: var(--evote-card-radius);
    border: 1px solid rgba(25, 135, 84, 0.25);
    border-top: 3px solid var(--evote-success);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.control-countdown {
    font-size: 1.35rem;
    font-weight: 700;
    color: #146c43;
    font-variant-numeric: tabular-nums;
}

.qr-control-card {
    border-top: 3px solid var(--hsa-gold);
}

.qr-control-card .card-header {
    background: var(--hsa-gold-light);
    font-weight: 600;
    color: var(--hsa-black);
    border-bottom: 1px solid rgba(245, 184, 0, 0.35);
}

.qr-brand-logo {
    max-width: min(220px, 70vw) !important;
}

.qr-code-image {
    max-width: min(280px, 80vw);
    padding: 0.75rem;
    background: #fff;
    border: 2px solid var(--hsa-gold);
    border-radius: 0.75rem;
}

.qr-display img {
    max-width: min(280px, 80vw);
    height: auto;
}

.vote-url-link {
    word-break: break-all;
    font-size: 0.875rem;
}

.qr-actions-header .btn {
    min-height: 2rem;
    white-space: nowrap;
}

.qr-action-toast-container {
    z-index: 1100;
}

@media (max-width: 575.98px) {
    .qr-control-card .card-header {
        flex-direction: column;
        align-items: stretch !important;
    }

    .qr-actions-header {
        width: 100%;
    }

    .qr-actions-header .btn-group,
    .qr-actions-header .btn {
        flex: 1 1 auto;
    }

    .qr-actions-header .btn-group {
        display: flex;
        width: 100%;
    }

    .qr-actions-header .btn-group > .btn {
        flex: 1 1 0;
    }
}

.report-brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    background: var(--hsa-white);
    border-radius: var(--evote-card-radius);
    border-top: 3px solid var(--hsa-gold);
    border-bottom: 1px solid #E8E4DC;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

@media (min-width: 576px) {
    .report-brand-header {
        flex-direction: row;
        text-align: right;
        justify-content: space-between;
        align-items: center;
    }
}

.report-brand-header .hsa-logo-full {
    max-width: 200px;
    margin: 0;
}

.report-brand-heading {
    font-weight: 700;
    color: var(--hsa-gold-darker);
}

.report-brand-sub {
    font-size: 0.9rem;
    color: var(--hsa-gray);
}

.report-card {
    border-top: none;
}

.report-card > .card-header {
    background: var(--hsa-gold-light);
    font-weight: 600;
}

.report-charts-section {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #E8E4DC;
    margin-bottom: 1.5rem;
}

.report-section-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

@media (min-width: 576px) {
    .report-section-header {
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
    }
}

.report-section-title {
    font-weight: 700;
    color: var(--hsa-gold-darker);
    padding-right: 0.75rem;
    border-right: 3px solid var(--hsa-gold);
}

.report-section-hint {
    font-size: 0.8rem;
    color: var(--hsa-gray);
}

.report-chart-card {
    border-top: 3px solid var(--hsa-gold);
    border-radius: var(--evote-card-radius);
    overflow: hidden;
}

.report-chart-card > .card-header {
    background: var(--hsa-gold-light);
    font-weight: 600;
    color: var(--hsa-black);
    border-bottom: 1px solid rgba(245, 184, 0, 0.35);
}

.report-chart-body {
    position: relative;
    min-height: 260px;
    padding: 1rem;
}

.report-chart-body--doughnut {
    min-height: 280px;
    max-width: 320px;
    margin: 0 auto;
}

.report-chart-body--tall {
    min-height: 300px;
}

.report-chart-toggle .btn.active {
    background: var(--hsa-gold);
    border-color: var(--hsa-gold);
    color: var(--hsa-black);
}

.report-table-heading {
    font-weight: 700;
    color: var(--hsa-black-soft);
    margin-bottom: 0.75rem;
}

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    padding-top: calc(1rem + var(--evote-safe-top));
    padding-bottom: calc(1rem + var(--evote-safe-bottom));
    background: linear-gradient(165deg, var(--hsa-black) 0%, var(--hsa-black-soft) 35%, var(--hsa-gray-light) 35%);
}

.login-card {
    width: 100%;
    max-width: 420px;
}

.login-card-inner {
    border-top: 3px solid var(--hsa-gold);
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--hsa-gray);
    font-weight: 500;
}

.live-status-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    background: #fff;
}

.live-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #6c757d;
}

.live-status-dot.connected {
    background: #198754;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.25);
    animation: live-pulse 2s ease-in-out infinite;
}

.live-status-dot.connecting {
    background: #ffc107;
    animation: live-blink 1s ease-in-out infinite;
}

.live-status-dot.disconnected {
    background: #dc3545;
}

.live-status-text {
    font-size: 0.9rem;
    font-weight: 600;
}

.live-status-hint {
    font-size: 0.8rem;
    color: #6c757d;
    width: 100%;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes live-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
