/* ==========================================================
   GlobalVote — estilos
   ========================================================== */

@font-face { font-family: "Century Gothic Paneuropean"; src: url("../../fonts/CenturyGothicPaneuropeanLight.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Century Gothic Paneuropean"; src: url("../../fonts/CenturyGothicPaneuropeanRegular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Century Gothic Paneuropean"; src: url("../../fonts/CenturyGothicPaneuropeanSemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Century Gothic Paneuropean"; src: url("../../fonts/CenturyGothicPaneuropeanBold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
    --gv-primary: #0a4c8f;
    --gv-primary-hover: #083d74;
    --gv-primary-dark: #062f5c;
    --gv-primary-soft: #e8f0fa;
    --gv-accent: #f28c1b;          /* laranja Halloween */
    --gv-accent-soft: #fff3e6;
    --gv-bg: #f3f5f8;
    --gv-surface: #ffffff;
    --gv-border: #dfe3ea;
    --gv-text: #1d2433;
    --gv-muted: #6b7280;
    --gv-radius: 12px;
    --gv-radius-sm: 8px;
    --gv-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    --gv-shadow-lg: 0 10px 30px rgba(16, 24, 40, .08);

    --bs-body-font-family: "Century Gothic Paneuropean", "Century Gothic", system-ui, sans-serif;
    --bs-body-color: var(--gv-text);
    --bs-body-bg: var(--gv-bg);
    --bs-primary: var(--gv-primary);
    --bs-primary-rgb: 10, 76, 143;
    --bs-link-color: var(--gv-primary);
    --bs-link-color-rgb: 10, 76, 143;
    --bs-link-hover-color: var(--gv-primary-hover);
}

html, body { min-height: 100%; }
body {
    display: flex;
    flex-direction: column;
    background: var(--gv-bg);
    color: var(--gv-text);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Bootstrap overrides ---------- */
.btn { border-radius: var(--gv-radius-sm); font-weight: 400; }
.btn-primary {
    --bs-btn-bg: var(--gv-primary);
    --bs-btn-border-color: var(--gv-primary);
    --bs-btn-hover-bg: var(--gv-primary-hover);
    --bs-btn-hover-border-color: var(--gv-primary-hover);
    --bs-btn-active-bg: var(--gv-primary-dark);
    --bs-btn-active-border-color: var(--gv-primary-dark);
    --bs-btn-disabled-bg: var(--gv-primary);
    --bs-btn-disabled-border-color: var(--gv-primary);
}
.btn-outline-primary {
    --bs-btn-color: var(--gv-primary);
    --bs-btn-border-color: var(--gv-primary);
    --bs-btn-hover-bg: var(--gv-primary);
    --bs-btn-hover-border-color: var(--gv-primary);
    --bs-btn-active-bg: var(--gv-primary-hover);
}
.btn-light { --bs-btn-bg: #f1f3f6; --bs-btn-border-color: #f1f3f6; }
.gv-btn-lg { padding: .7rem 1.6rem; font-size: 1.05rem; }
.form-check-input:checked { background-color: var(--gv-primary); border-color: var(--gv-primary); }
.form-check-input:focus, .gv-input:focus {
    border-color: #8fb3dc;
    box-shadow: 0 0 0 .2rem rgba(10, 76, 143, .15);
}
.alert { border-radius: var(--gv-radius-sm); }
.modal-content.gv-modal { border: 0; border-radius: var(--gv-radius); }

.gv-input { border-color: var(--gv-border); border-radius: var(--gv-radius-sm); padding: .65rem .9rem; }
.gv-label { font-weight: 600; margin-bottom: .4rem; }
.gv-mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .875rem; }
.gv-break { word-break: break-all; }

/* ---------- Layout ---------- */
.gv-container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.gv-main { flex: 1 0 auto; padding: 28px 0 40px; }
.gv-narrow { max-width: 860px; margin: 0 auto; }

.gv-topbar {
    background: var(--gv-surface);
    border-bottom: 1px solid var(--gv-border);
    position: sticky;
    top: 0;
    z-index: 1030;
}
.gv-topbar .navbar { padding: .6rem 0; }
.gv-logo { height: 46px; width: auto; }
.gv-brand-name { font-weight: 700; font-size: 1.3rem; color: var(--gv-text); letter-spacing: -.01em; }
.gv-topbar .nav-link { color: var(--gv-text); border-radius: var(--gv-radius-sm); padding: .45rem .8rem !important; }
.gv-topbar .nav-link:hover { background: var(--gv-bg); }
.gv-topbar .nav-link.active { color: var(--gv-primary); font-weight: 600; }
.gv-topbar .gv-logout { color: var(--gv-primary); }
.gv-user { display: flex; align-items: center; gap: .5rem; padding: .45rem .8rem; }
.navbar-toggler { border: 0; font-size: 1.7rem; color: var(--gv-primary); padding: 0 .25rem; }
.navbar-toggler:focus { box-shadow: none; }

.gv-lang {
    display: inline-flex;
    border: 1px solid var(--gv-border);
    border-radius: 999px;
    padding: 2px;
    background: var(--gv-surface);
}
.gv-lang a {
    font-size: .8rem;
    font-weight: 600;
    padding: .25rem .65rem;
    border-radius: 999px;
    color: var(--gv-muted);
    text-decoration: none;
}
.gv-lang a.active { background: var(--gv-primary); color: #fff; }

.gv-footer {
    flex-shrink: 0;
    text-align: center;
    color: var(--gv-muted);
    font-size: .85rem;
    padding: 20px 16px 28px;
}

/* ---------- Componentes ---------- */
.gv-card {
    background: var(--gv-surface);
    border: 1px solid var(--gv-border);
    border-radius: var(--gv-radius);
    box-shadow: var(--gv-shadow);
    padding: 24px;
}
.gv-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gv-border);
}
.gv-card-head h2, .gv-h2 { font-size: 1.1rem; font-weight: 700; margin: 0; }
.gv-h2 { margin-bottom: 1rem; }
.gv-card-foot { padding: 12px 20px; border-top: 1px solid var(--gv-border); }

.gv-badge {
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    padding: .15rem .6rem;
    border-radius: 999px;
    vertical-align: middle;
}
.gv-badge-admin { background: #fde8e4; color: #c2410c; }
.gv-badge-muted { background: #eef0f3; color: var(--gv-muted); }

.gv-avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gv-primary-soft);
    color: var(--gv-primary);
    font-weight: 700;
    font-size: .9rem;
}
.gv-avatar-sm { width: 36px; height: 36px; font-size: .8rem; }

.gv-search { position: relative; flex: 1 1 260px; }
.gv-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--gv-muted); pointer-events: none; }
.gv-search .gv-input { padding-left: 2.5rem; }
.gv-search-sm { max-width: 340px; }

/* ---------- Login ---------- */
.gv-login-page .gv-main { display: flex; align-items: center; }
.gv-auth {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1000px;
    margin: 0 auto;
    background: var(--gv-surface);
    border: 1px solid var(--gv-border);
    border-radius: 20px;
    box-shadow: var(--gv-shadow-lg);
    overflow: hidden;
}
.gv-auth-intro {
    position: relative;
    overflow: hidden;
    padding: 56px 48px;
    color: #fff;
    background: linear-gradient(160deg, #0b4f95 0%, #062f5c 100%);
}
.gv-kicker {
    display: inline-block;
    font-size: .85rem;
    font-weight: 600;
    color: #ffd29b;
    margin-bottom: .8rem;
}
.gv-auth-intro h1 { font-size: 2.1rem; font-weight: 700; margin-bottom: .75rem; }
.gv-auth-lead { opacity: .85; margin-bottom: 1.6rem; }
.gv-steps { list-style: none; padding: 0; margin: 0; position: relative; z-index: 1; }
.gv-steps li { display: flex; gap: 16px; margin-bottom: 1.4rem; }
.gv-steps li > span {
    flex: 0 0 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.gv-steps strong { display: block; font-weight: 700; }
.gv-steps small { display: block; font-size: .95rem; opacity: .8; }
.gv-auth-globe {
    position: absolute;
    right: -60px;
    bottom: -90px;
    font-size: 260px;
    line-height: 1;
    color: rgba(255, 255, 255, .05);
}
.gv-auth-form { padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; }
.gv-auth-form h2 { font-size: 1.7rem; font-weight: 700; margin-bottom: .3rem; }

/* ---------- Votação ---------- */
.gv-banner { margin: 0 0 16px; border-radius: var(--gv-radius); overflow: hidden; background: #000; box-shadow: var(--gv-shadow-lg); }
.gv-banner-btn { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.gv-banner img { display: block; width: 100%; max-height: 520px; object-fit: cover; }
.gv-zoom-hint {
    position: absolute;
    right: 12px;
    bottom: 12px;
    font-size: .8rem;
    color: #fff;
    background: rgba(0, 0, 0, .55);
    padding: .3rem .7rem;
    border-radius: 999px;
}
.gv-banner-empty {
    aspect-ratio: 16 / 6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255, 255, 255, .5);
    background: linear-gradient(135deg, #0b4f95, #062f5c 60%, #3b1d0a);
}
.gv-photo-modal { background: transparent; border: 0; }
.gv-photo-modal img { width: 100%; height: auto; border-radius: var(--gv-radius); }
.gv-photo-modal .btn-close { position: absolute; top: -36px; right: 0; opacity: 1; }

.gv-intro { margin-bottom: 16px; border-top: 4px solid var(--gv-accent); }
.gv-intro h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: .4rem; }
.gv-intro p { color: var(--gv-muted); margin: 0; }

.gv-state { text-align: center; padding: 40px 24px; }
.gv-state h2 { font-size: 1.35rem; font-weight: 700; }
.gv-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: #e3f6ec;
    color: #15803d;
}
.gv-state-icon-muted { background: #eef0f3; color: var(--gv-muted); }

.gv-list-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.gv-count { color: var(--gv-muted); font-size: .9rem; white-space: nowrap; }

.gv-candidates {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    padding-bottom: 96px; /* espaço para a barra fixa */
}
.gv-candidate {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--gv-surface);
    border: 1.5px solid var(--gv-border);
    border-radius: var(--gv-radius);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
    user-select: none;
}
.gv-candidate:hover { border-color: #b9c8db; }
.gv-candidate input { position: absolute; opacity: 0; pointer-events: none; }
.gv-candidate-name { flex: 1; font-weight: 600; line-height: 1.25; min-width: 0; overflow-wrap: anywhere; }
.gv-check { font-size: 1.3rem; color: var(--gv-accent); opacity: 0; transform: scale(.6); transition: .15s; }
.gv-candidate:has(input:checked),
.gv-candidate.is-selected {
    border-color: var(--gv-accent);
    background: var(--gv-accent-soft);
    box-shadow: 0 0 0 3px rgba(242, 140, 27, .15);
}
.gv-candidate:has(input:checked) .gv-avatar,
.gv-candidate.is-selected .gv-avatar { background: var(--gv-accent); color: #fff; }
.gv-candidate:has(input:checked) .gv-check,
.gv-candidate.is-selected .gv-check { opacity: 1; transform: scale(1); }
.gv-candidate:has(input:focus-visible) { outline: 2px solid var(--gv-primary); outline-offset: 2px; }

.gv-submit-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1020;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--gv-border);
    box-shadow: 0 -6px 20px rgba(16, 24, 40, .06);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.gv-submit-inner { max-width: 860px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.gv-selected { min-width: 0; }
.gv-selected small { display: block; color: var(--gv-muted); font-size: .8rem; }
.gv-selected strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Admin ---------- */
.gv-page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.gv-page-head h1 { font-size: 1.7rem; font-weight: 700; color: var(--gv-primary-dark); margin: 0; }

.gv-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.gv-stat {
    background: var(--gv-surface);
    border: 1px solid var(--gv-border);
    border-radius: var(--gv-radius);
    padding: 18px 20px;
}
.gv-stat strong { display: block; font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.gv-stat span { color: var(--gv-muted); font-size: .9rem; }

.gv-tabs { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 20px; overflow-x: auto; }
.gv-tabs a, .gv-filters button {
    display: inline-block;
    white-space: nowrap;
    padding: .55rem 1rem;
    border-radius: var(--gv-radius-sm);
    border: 1px solid var(--gv-border);
    background: var(--gv-surface);
    color: var(--gv-text);
    text-decoration: none;
}
.gv-tabs a.active, .gv-filters button.active { background: var(--gv-primary); border-color: var(--gv-primary); color: #fff; }
.gv-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.gv-filters button { padding: .4rem .85rem; font-size: .9rem; }

.gv-results { list-style: none; margin: 0; padding: 8px 0; }
.gv-results li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; }
.gv-results li + li { border-top: 1px solid #eef0f3; }
.gv-rank { width: 26px; text-align: center; font-weight: 700; color: var(--gv-muted); }
.gv-top-1 .gv-rank { color: #d4a017; }
.gv-top-2 .gv-rank { color: #8a94a6; }
.gv-top-3 .gv-rank { color: #b0703a; }
.gv-top-1 .gv-avatar { background: var(--gv-accent); color: #fff; }
.gv-result-body { flex: 1; min-width: 0; }
.gv-result-name { font-weight: 600; overflow-wrap: anywhere; }
.gv-result-votes { font-weight: 700; white-space: nowrap; }
.gv-result-votes small { font-weight: 400; color: var(--gv-muted); }
.gv-bar { height: 8px; margin-top: 6px; border-radius: 999px; background: #eef0f3; overflow: hidden; }
.gv-bar span { display: block; height: 100%; border-radius: inherit; background: var(--gv-primary); }
.gv-top-1 .gv-bar span { background: var(--gv-accent); }

.gv-simple-list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.gv-simple-list li { padding: 6px 0; border-bottom: 1px solid #eef0f3; font-size: .95rem; }
.gv-simple-list li:last-child { border-bottom: 0; }

.gv-table { --bs-table-bg: transparent; }
.gv-table thead th { font-weight: 600; font-size: .85rem; color: var(--gv-muted); background: #fafbfc; padding: 12px 16px; border-bottom-color: var(--gv-border); }
.gv-table td { padding: 12px 16px; border-color: #eef0f3; }
.gv-row-inactive td { opacity: .6; }
.gv-table .form-switch .form-check-input { width: 2.4em; height: 1.3em; cursor: pointer; }

.gv-banner-preview img { max-width: 100%; max-height: 260px; border-radius: var(--gv-radius-sm); border: 1px solid var(--gv-border); }

/* ---------- Responsivo ---------- */
@media (max-width: 991.98px) {
    .gv-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767.98px) {
    .gv-main { padding: 16px 0 32px; }
    .gv-logo { height: 38px; }
    .gv-brand-name { font-size: 1.1rem; }
    .gv-topbar .navbar-collapse { padding-top: .5rem; }
    .gv-topbar .navbar-nav { border-top: 1px solid var(--gv-border); padding-top: .5rem; }
    .gv-user { padding-left: .8rem; }

    .gv-auth { grid-template-columns: 1fr; border-radius: 16px; }
    .gv-auth-intro { padding: 28px 24px 12px; }
    .gv-auth-intro h1 { font-size: 1.5rem; }
    .gv-auth-lead { margin-bottom: 1rem; }
    .gv-steps li { margin-bottom: .9rem; }
    .gv-auth-form { padding: 28px 24px 32px; }

    .gv-card { padding: 18px; }
    .gv-card.p-0 { padding: 0; }
    .gv-intro h1 { font-size: 1.3rem; }
    .gv-banner img { max-height: 340px; }
    .gv-candidates { grid-template-columns: 1fr; gap: 8px; }
    .gv-page-head h1 { font-size: 1.35rem; }
    .gv-card-head { padding: 14px 16px; }
    .gv-search-sm { max-width: none; }
    .gv-results li { padding: 12px 16px; }
    .gv-table td, .gv-table thead th { padding: 10px 12px; }
}

@media (max-width: 420px) {
    .gv-brand-name { display: none; }
    .gv-stat { padding: 14px 16px; }
    .gv-stat strong { font-size: 1.3rem; }
    .gv-submit-inner .btn { padding: .65rem 1.1rem; }
}
