/* =========================================================================
   Urna eletrônica simulada — voto.tonproencio.com.br
   Mobile-first, vertical. A urna é uma foto frontal; o visor e a tecla
   CONFIRMA são camadas HTML posicionadas em % sobre ela — as % vieram de
   flood-fill nos pixels da própria foto (ver README): trocar a foto exige
   remedir, e `figure.urna` precisa manter aspect-ratio 1536/826 exato.
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }

/* As regras de classe abaixo definem `display`, o que venceria o
   `[hidden]` do user-agent — sem isto os estados escondidos aparecem. */
[hidden] { display: none !important; }

:root {
    --bg: #150e26;          /* plum da identidade do Ton */
    --bg-deep: #0a0712;
    --violet: #7c3aed;
    --violet-bright: #9d5cff;
    --gold: #d4a942;
    --gold-bright: #f0cd6e;
    --gold-deep: #a87f24;
    --green: #22c55e;
    --text: #f3f1f7;
    --muted: rgba(243, 241, 247, 0.58);
    --lcd: #d9e6f2;          /* visor aceso: azul-claro, como o real */
    --lcd-ink: #10151c;
    --lcd-line: #6b7f95;
    --font: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: Anton, Impact, "Arial Narrow", sans-serif;
    /* visor da urna em sans neutra, como o real */
    --font-lcd: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body.urna-page {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.6rem, 2.2vh, 1.2rem);
    padding: max(0.85rem, env(safe-area-inset-top)) 0.9rem max(0.9rem, env(safe-area-inset-bottom));
    background: var(--bg-deep);
    font-family: var(--font);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(95% 50% at 50% -8%, rgba(124, 58, 237, 0.38), transparent 62%),
        radial-gradient(70% 42% at 112% 108%, rgba(212, 169, 66, 0.2), transparent 60%),
        radial-gradient(60% 38% at -12% 55%, rgba(157, 92, 255, 0.12), transparent 62%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 68%);
}

/* ------------------------------------------------------- cabeçalho */

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    max-width: 480px;
    flex: none;
}

.brand__photo {
    width: 50px;
    height: 50px;
    flex: none;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 30%;
    padding: 2px;
    background: linear-gradient(145deg, var(--gold-bright), var(--gold-deep));
    box-shadow: 0 0 0 3px rgba(212, 169, 66, 0.16), 0 6px 18px rgba(0, 0, 0, 0.45);
}

.brand__id { min-width: 0; }

.brand__id strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    /* Folga vertical: o overflow:hidden (do ellipsis) cortava o
       circunflexo de "PROÊNCIO" com line-height apertado. */
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand__id span {
    display: block;
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand__num {
    margin-left: auto;
    flex: none;
    padding: 0.1rem 0.62rem 0.16rem;
    border-radius: 10px;
    background: linear-gradient(160deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
    color: #1c1204;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1.2;
    letter-spacing: 0.04em;
    box-shadow: 0 6px 20px -6px rgba(212, 169, 66, 0.55);
    font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------- palco */

.stage {
    flex: 1 1 auto;
    width: 100%;
    max-width: 480px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(0.7rem, 2.4vh, 1.35rem);
    min-height: 0;
}

/* --------------------------------------------------------- chamada */

.pitch { text-align: center; }

.pitch__eyebrow {
    margin: 0 0 0.4rem;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--gold-bright);
}

.pitch__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 7.6vw, 2.5rem);
    font-weight: 400;
    /* Anton é condensada e alta: abaixo de ~1.12 a cedilha de "ELEIÇÃO"
       encosta nos acentos da linha de baixo. */
    line-height: 1.14;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    text-wrap: balance;
}

.pitch__sub {
    margin: 0.55rem 0 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--muted);
    text-wrap: balance;
}

/* ------------------------------------------------------------ urna
   Sangra para cada lado: dá presença à urna sem cortar o visor
   (10.6%–57.9%) nem a tecla CONFIRMA (82.55%–91.86%). */

.urna-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    overflow: hidden;
    flex: none;
}

.urna {
    position: relative;
    margin: 0;
    flex: none;
    /* Teto do sangramento: acima de ~119% a tecla CONFIRMA (borda em
       91.86%) sairia da área visível do .urna-wrap. */
    width: 112%;
    max-width: min(680px, calc(46vh * 1536 / 826));
    aspect-ratio: 1536 / 826;
    container-type: inline-size;
}

.urna__body {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* A foto já vem com fundo navy. O fade em cima/embaixo dissolve a
       emenda com o fundo da página (o aparelho vai de 7,3% a 92,7%, então
       a faixa apagada não encosta nele). As laterais não precisam: ficam
       fora da área visível por causa do sangramento. */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 5.5%, #000 94.5%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 5.5%, #000 94.5%, transparent 100%);
}

/* ------------------------------------------------------------- o visor */

.urna__screen {
    position: absolute;
    font-family: var(--font-lcd);
    /* A tela desta foto é um trapézio (borda esquerda inclinada), não um
       retângulo: a caixa cobre os 4 cantos medidos e o clip-path recorta
       no formato exato — um retângulo interno deixava a lasca escura da
       tela real à mostra na esquerda. */
    left: 8.43%;
    top: 17.68%;
    width: 49.66%;
    height: 60.17%;
    clip-path: polygon(5.39% 0, 99.43% 0, 100% 100%, 0 100%);
    overflow: hidden;
    background: var(--lcd);
    color: var(--lcd-ink);
    container-type: inline-size;
}

/* --- estado 1: voto montado */

.vote {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* esquerda maior: no alto do visor a inclinação come ~5cqw */
    padding: 2.6cqw 3cqw 2.6cqw 6.4cqw;
}

.vote__main {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: stretch;
    gap: 2.5cqw;
}

.vote__col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.8cqw;
}

.vote__eyebrow {
    margin: 0;
    font-size: 4.1cqw;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 0.02em;
}

.vote__office {
    margin: 0 0 0.9cqw;
    /* Calibrado para "DEPUTADO ESTADUAL" caber em uma linha na coluna (folga ≥9% — a largura da fonte varia entre aparelhos).
       Sem nowrap de propósito: texto maior digitado no admin quebra
       em vez de ser cortado pelo overflow do visor. */
    font-size: 5cqw;
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.02em;
}

.vote__line {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 1.4cqw;
    font-size: 4.6cqw;
    line-height: 1.15;
    min-width: 0;
}

.vote__k { flex: none; }
.vote__line strong { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* dígitos em caixas, como no visor real */
.vote__digits { display: inline-flex; gap: 0.6cqw; }

.vote__digits b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.6cqw;
    padding: 0.2cqw 0.7cqw;
    border: 0.35cqw solid var(--lcd-ink);
    font-size: 5.6cqw;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    background: rgba(255, 255, 255, 0.55);
}

.vote__photo {
    flex: none;
    align-self: center;
    /* Largura fixa (não altura): sobra coluna para "DEPUTADO FEDERAL"
       caber em uma linha só, como no visor real. */
    width: 26%;
    height: auto;
    max-height: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: top center;
    border: 0.4cqw solid rgba(0, 0, 0, 0.45);
    background: #fff;
}

.vote__hint {
    flex: none;
    margin: 1.4cqw 0 0;
    padding-top: 1.4cqw;
    border-top: 0.35cqw solid var(--lcd-line);
    text-align: center;
    line-height: 1.15;
}

.vote__hint b { display: block; font-size: 3.8cqw; font-weight: 800; letter-spacing: 0.02em; }
.vote__hint span { display: block; font-size: 3.4cqw; font-weight: 500; }

/* --- estado 2: confirmado */

.done {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1cqw;
    text-align: center;
}

.done__title {
    margin: 0;
    font-size: 7cqw;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #15803d;
}

.done__fim {
    margin: 0;
    font-size: 17cqw;
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: 0.1em;
}

/* -------------------------------------------- tecla CONFIRMA (destaque)
   keyzone = retângulo exato da tecla na foto (só o anel pulsante).
   O botão de toque é maior: a tecla real dá ~34px no celular, abaixo do
   mínimo confortável. */

.urna__keyzone {
    position: absolute;
    left: 82.55%;
    top: 69.73%;
    width: 9.31%;
    height: 10.05%;
    pointer-events: none;
}

.urna__ring {
    position: absolute;
    inset: 0;
    border-radius: 14%;
    animation: keyPulse 1.7s ease-out infinite;
}

@keyframes keyPulse {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.9), 0 0 12px 2px rgba(34, 197, 94, 0.5); }
    70%  { box-shadow: 0 0 0 3.5cqw rgba(34, 197, 94, 0), 0 0 20px 6px rgba(34, 197, 94, 0.16); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0), 0 0 12px 2px rgba(34, 197, 94, 0); }
}

.urna__key {
    position: absolute;
    /* Cresce para a DIREITA (carcaça livre) em vez de para a esquerda,
       que invadiria a tecla CORRIGE. Garante ~45px no celular pequeno. */
    left: 82.1%;
    top: 60%;
    width: 12.6%;
    height: 30%;
    padding: 0;
    border: 0;
    border-radius: 8%;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.urna__key:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.urna__key:active { transform: translateY(1px); }

/* seta animada apontando para cima, logo abaixo da tecla */

.pointer {
    position: absolute;
    left: 85.5%;
    top: 83.5%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.8cqw;
    padding: 0.8cqw 1.4cqw;
    border-radius: 999px;
    background: rgba(10, 7, 18, 0.92);
    color: #6ee7a0;
    font-size: 2cqw;
    font-weight: 800;
    letter-spacing: 0.08em;
    white-space: nowrap;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
    animation: nudge 1.2s ease-in-out infinite;
    pointer-events: none;
}

.pointer svg { width: 2.8cqw; height: 2.8cqw; }

@keyframes nudge {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(-50%, -22%); }
}

/* ------------------------------------------------- chamada para a ação */

.cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    flex: none;
}

.cta__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    max-width: 420px;
    padding: 1.02rem 1.3rem;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, #2ee06a, #16a34a);
    color: #04210f;
    font-family: var(--font);
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 14px 32px -12px rgba(34, 197, 94, 0.75);
    animation: ctaPulse 2.2s ease-in-out infinite;
    -webkit-tap-highlight-color: transparent;
}

.cta__btn:active { transform: translateY(1px); }
.cta__btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

@keyframes ctaPulse {
    0%, 100% { box-shadow: 0 14px 32px -12px rgba(34, 197, 94, 0.75), 0 0 0 0 rgba(34, 197, 94, 0.34); }
    55%      { box-shadow: 0 14px 32px -12px rgba(34, 197, 94, 0.75), 0 0 0 12px rgba(34, 197, 94, 0); }
}

.cta__note {
    margin: 0;
    font-size: 0.72rem;
    color: var(--muted);
}

/* ------------------------------------------------------ prova social */

.proof {
    margin: 0;
    flex: none;
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
}

.proof strong {
    color: var(--text);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------- depois do voto */

.after {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
    animation: rise 0.45s ease-out both;
}

.after__note { margin: 0; font-size: 0.9rem; line-height: 1.45; color: rgba(238, 242, 248, 0.85); }

.after__share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    padding: 1rem 1.2rem;
    border-radius: 14px;
    background: #25d366;
    color: #06240f;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 14px 32px -12px rgba(37, 211, 102, 0.7);
}

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

@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- pé */

.foot {
    flex: none;
    width: 100%;
    max-width: 520px;
    text-align: center;
    color: rgba(238, 242, 248, 0.38);
}

.foot__sim { margin: 0; font-size: 0.63rem; line-height: 1.5; }
.foot__legal { margin: 0.45rem 0 0; font-size: 0.6rem; line-height: 1.5; }

/* ----------------------------------------------------------- telinhas */

@media (max-height: 720px) {
    .pitch__sub { display: none; }
    .cta__btn { padding: 0.9rem 1.2rem; font-size: 0.96rem; }
    .foot__sim { font-size: 0.58rem; }
}

@media (prefers-reduced-motion: reduce) {
    .urna__ring, .pointer, .cta__btn, .after { animation: none; }
    .pointer { transform: translateX(-50%); }
}
