:root {
    --bg: #0d0f14;
    --bg-elevated: #161a22;
    --bg-hover: #1e2430;
    --border: #262d3a;
    --text: #e8eaf0;
    --text-dim: #98a0b3;
    /* Dourado do app de TV (Theme.xaml: Accent = Brand) em todo o site desde 2026-11-20.
       Texto sobre dourado e sempre --accent-ink: branco sobre amarelo nao se le. */
    --accent: #f3c234;
    --accent-hover: #ffd558;
    --accent-ink: #17130a;
    --accent-rgb: 243, 194, 52;
    --rail: #0a0c11;
    --danger: #e5484d;
    --success: #30a46c;
    --warning: #f5a524;
    --radius: 10px;
    --topbar-h: 56px;
}

/* A fonte dos apps (Resources/Fonts do UneStar.Tv), servida daqui: sem CDN. */
@font-face {
    font-family: "Open Sans";
    src: url("fonts/OpenSans-Regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "Open Sans";
    src: url("fonts/OpenSans-Semibold.ttf") format("truetype");
    font-weight: 600 800;
    font-display: swap;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 { font-weight: 650; letter-spacing: -0.01em; }

/* O FocusOnNavigate poe o foco no h1 a cada pagina (leitor de tela); o contorno nao serve
   para quem enxerga. */
h1:focus { outline: none; }

/* ---------- Shell ---------- */

.app-shell { min-height: 100vh; min-height: 100dvh; }

.app-main {
    padding: calc(var(--topbar-h) + 1.5rem) 1.5rem 4rem;
    max-width: 1600px;
    margin: 0 auto;
}

.bare-main { min-height: 100vh; }

/* Tela do player: sem padding e sem teto de largura, ao contrario do .app-main — a pagina
   se mede pela tela. So dvh, sem o 100vh de reserva de proposito: no celular o vh conta a
   barra do navegador, e um piso maior que a area visivel deixaria uma faixa rolando sob o
   player. Quem nao entende dvh (o WebKit do PS4) ignora a linha e fica com a altura do
   conteudo, que e o que a .player-page ja resolve. */
.player-main { min-height: 100dvh; }

.topbar {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 1.5rem;
    background: rgba(13, 15, 20, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.brand {
    font-weight: 700;
    font-size: 1.375rem;
    color: var(--accent);
}
.brand:hover { color: var(--accent-hover); }

.topnav { display: flex; gap: 0.25rem; flex: 1; overflow-x: auto; }

/* Pilulas do app de TV (HomePage.xaml): a ativa e dourada com texto escuro. */
.topnav-link {
    padding: 0.4rem 0.95rem;
    border-radius: 16px;
    color: #c9cfdb;
    font-size: 0.9375rem;
    font-weight: 600;
    white-space: nowrap;
}
.topnav-link:hover { background: var(--bg-hover); color: #fff; }
.topnav-link.active { background: var(--accent); color: var(--accent-ink); }
.topnav-link.active:hover { background: var(--accent-hover); color: var(--accent-ink); }

.topbar-right { display: flex; align-items: center; gap: 0.75rem; }
/* Formulario GET: some da barra por si so no celular, junto com o resto do topbar-menu. */
.topbar-search { margin: 0; }
.topbar-search input { width: 15rem; max-width: 100%; }

.topbar-search input { border-radius: 999px; padding-left: .9rem; }

/* Ainda usado pelo SupportLayout, que tem a barra propria. */
.topbar-user { color: var(--text-dim); font-size: 0.875rem; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Circulo com a inicial: o Perfil do app (ProfilePage.xaml), em miniatura. */
.topbar-profile { display: flex; align-items: center; gap: .6rem; color: var(--text); }
.topbar-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-weight: 600;
    font-size: .95rem;
    transition: background .15s ease, color .15s ease;
}
.topbar-profile:hover .topbar-avatar,
.topbar-profile.active .topbar-avatar { background: var(--accent); color: var(--accent-ink); }
.topbar-profile-label { display: none; }
.logout-form { margin: 0; }

.btn-link-plain {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
}
.btn-link-plain:hover { background: var(--bg-hover); color: var(--text); }

/* ---------- Menu hamburguer ---------- */

/* display:contents: no desktop o wrapper some do layout e .topnav / .topbar-right
   continuam sendo filhos diretos do flex da barra, exatamente como antes. */
.topbar-menu { display: contents; }

.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 38px;
    margin-left: auto;
    padding: 0 9px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
}
.nav-burger span {
    display: block;
    height: 2px;
    background: var(--text-dim);
    border-radius: 2px;
    transition: transform .2s ease, opacity .2s ease, background .2s ease;
}
.nav-burger:hover { background: var(--bg-hover); }
.nav-burger:hover span { background: var(--text); }

@media (max-width: 860px) {
    .nav-burger { display: flex; }

    /* backdrop-filter faz do elemento o bloco de contencao dos filhos position:fixed.
       Com ele ligado, o painel se alinharia pela CAIXA DE PADDING da barra e ficaria
       recuado 1.5rem de cada lado em vez de ir de ponta a ponta. O fundo quase opaco
       abaixo cobre a mesma funcao visual. */
    .topbar { backdrop-filter: none; background: rgba(13, 15, 20, .98); }

    /* Painel abaixo da barra fixa, nao dentro dela: a barra tem altura fixa. */
    .topbar-menu {
        display: none;
        position: fixed;
        top: var(--topbar-h);
        left: 0;
        right: 0;
        flex-direction: column;
        max-height: calc(100vh - var(--topbar-h));
        overflow-y: auto;
        padding: .75rem 1rem 1rem;
        background: rgba(13, 15, 20, .98);
        border-bottom: 1px solid var(--border);
        z-index: 99;
    }
    .nav-open .topbar-menu { display: flex; }

    .topnav { flex: none; flex-direction: column; gap: .15rem; overflow: visible; }
    .topnav-link { padding: .7rem .85rem; }

    .topbar-right {
        flex-direction: column;
        align-items: stretch;
        gap: .15rem;
        margin-top: .5rem;
        padding-top: .75rem;
        border-top: 1px solid var(--border);
    }
    /* No painel do hamburguer a caixa ocupa a largura toda, como os itens do menu. */
    .topbar-search { order: -1; margin-bottom: .5rem; }
    .topbar-search input { width: 100%; }

    .topbar-profile { padding: .45rem .85rem; border-radius: 8px; }
    .topbar-profile:hover { background: var(--bg-hover); color: var(--text); }
    .topbar-profile-label { display: inline; font-weight: 600; }
    .logout-form { display: flex; }
    .btn-link-plain { flex: 1; text-align: left; padding: .7rem .85rem; }

    /* As tres barras viram um X. O deslocamento e o gap (5px) + a altura (2px). */
    .nav-open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-open .nav-burger span:nth-child(2) { opacity: 0; }
    .nav-open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Entrar, cadastrar e as telas de aviso da conta ---------- */

/* Login, cadastro, conta bloqueada, acesso negado, usuario invalido e /Error usam todas o
   AuthShell: a pessoa que cai num aviso continua dentro da mesma marca do login. */

/* Dourado do icone do app. Desde 2026-11-20 e o destaque do site todo (o --accent); os
   nomes --brand ficam porque o resto deste bloco ja os usa. */
.auth {
    --brand: var(--accent);
    --brand-hover: var(--accent-hover);
    --brand-ink: var(--accent-ink);
    --field: rgba(255, 255, 255, .06);
    --field-border: rgba(255, 255, 255, .16);
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    isolation: isolate;
}

/* Fixo e com overflow proprio: o cadastro passa da altura da tela no celular, e o fundo
   nao pode rolar junto nem criar barra horizontal. */
.auth-backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: var(--bg);
}

.auth-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(700px 420px at 85% 8%, rgba(243, 194, 52, .14), transparent 70%),
        radial-gradient(ellipse at 50% 45%, rgba(13, 15, 20, .2) 0%, rgba(13, 15, 20, .8) 80%),
        linear-gradient(180deg, rgba(13, 15, 20, .75) 0%, rgba(13, 15, 20, .1) 30%, rgba(13, 15, 20, .45) 75%, var(--bg) 100%);
}

.auth-wall {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160vmax;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 14px;
    opacity: .85;
    transform: translate(-50%, -50%) rotate(-12deg);
    animation: auth-drift 90s linear infinite alternate;
}

@keyframes auth-drift {
    from { transform: translate(-50%, -50%) rotate(-12deg); }
    to { transform: translate(-46%, -54%) rotate(-12deg); }
}

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

/* padding-top no lugar de aspect-ratio: o WebKit do PS4 nao conhece aspect-ratio. */
.auth-tile {
    position: relative;
    display: block;
    padding-top: 150%;
    border-radius: 8px;
    background: linear-gradient(160deg, #3a3f4f, #11131a);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}

/* Brilho de capa e a faixa do titulo — o suficiente para ler como cartaz, nao como grade. */
.auth-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .16), transparent 55%);
}

.auth-tile::after {
    content: "";
    position: absolute;
    left: 12%;
    right: 34%;
    bottom: 9%;
    height: 5%;
    border-radius: 3px;
    background: rgba(255, 255, 255, .2);
}

/* Ciclo de 8 cores contra 10 colunas: a combinacao muda a cada linha e nao forma listra. */
.auth-tile:nth-child(8n+1) { background: linear-gradient(160deg, #4a2475, #140a26); }
.auth-tile:nth-child(8n+2) { background: linear-gradient(160deg, #0f5566, #061a21); }
.auth-tile:nth-child(8n+3) { background: linear-gradient(160deg, #8c2230, #22080d); }
.auth-tile:nth-child(8n+4) { background: linear-gradient(160deg, #9a6514, #24170a); }
.auth-tile:nth-child(8n+5) { background: linear-gradient(160deg, #1f4788, #0a1426); }
.auth-tile:nth-child(8n+6) { background: linear-gradient(160deg, #2f6340, #0b1a10); }
.auth-tile:nth-child(8n+7) { background: linear-gradient(160deg, #6b301c, #1a0c08); }

.auth-header {
    display: flex;
    align-items: center;
    padding: 1.5rem clamp(1rem, 4vw, 3.5rem);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    color: var(--text);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: .02em;
}

.auth-wordmark > span { color: var(--brand); }
.auth-brand img { border-radius: 10px; }

.auth-main {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    justify-items: center;
    gap: 2.5rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem clamp(1rem, 4vw, 3.5rem) 3rem;
}

@media (min-width: 960px) {
    .auth-main {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 27rem);
        justify-items: stretch;
        gap: 4.5rem;
    }

    .auth-main--solo { grid-template-columns: minmax(0, 27rem); justify-content: center; }

    /* O cartao vem primeiro no DOM; aqui a coluna de apresentacao passa para a esquerda. */
    .auth-pitch { order: -1; }
}

.auth-card {
    width: 100%;
    max-width: 27rem;
    padding: clamp(1.5rem, 5vw, 2.5rem);
    background: rgba(12, 14, 19, .8);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}

.auth-title { margin: 0 0 .35rem; font-size: 2rem; font-weight: 750; }

/* O FocusOnNavigate do Routes poe o foco no h1 ao abrir a pagina (leitor de tela); o
   contorno do navegador num titulo que nao e clicavel so parece defeito. */
.auth-title:focus { outline: none; }
.auth-lead { margin: 0 0 1.75rem; color: var(--text-dim); font-size: .95rem; line-height: 1.5; }

.auth-group { margin-bottom: 1rem; }

.auth-help { margin: .45rem .25rem 0; color: var(--text-dim); font-size: .8rem; }

/* Campos maiores e translucidos, como nas telas de streaming. */
.auth .form-floating > .form-control {
    height: 3.5rem;
    min-height: 3.5rem;
    color: var(--text);
    background: var(--field);
    border: 1px solid var(--field-border);
    border-radius: 10px;
}

.auth .form-floating > .form-control:focus {
    background: rgba(255, 255, 255, .09);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(243, 194, 52, .22);
}

/* O Bootstrap escurece o rotulo flutuante com a cor de texto do tema claro, e com seletor
   mais forte que o .form-floating > label do tema escuro: no campo escuro ele sumia. */
.auth .form-floating > label,
.auth .form-floating > .form-control:focus ~ label,
.auth .form-floating > .form-control:not(:placeholder-shown) ~ label,
.auth .form-floating > .form-control:-webkit-autofill ~ label { color: var(--text-dim); }

/* O Bootstrap 5.3 pinta um fundo atras do rotulo flutuante com --bs-body-bg, que e branco
   aqui: sairia uma tarja clara em cima do campo escuro. */
.auth .form-floating > .form-control ~ label::after { display: none; }

/* Sem isto o preenchimento automatico do Chrome pinta o campo de azul-claro. */
.auth .form-control:-webkit-autofill,
.auth .form-control:-webkit-autofill:hover,
.auth .form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 100px #1c1f26 inset;
    caret-color: var(--text);
    transition: background-color 9999s ease-out;
}

/* top fixo, e nao 50%: e a metade do campo de 3.5rem, venha ou nao mensagem embaixo. */
.auth-reveal {
    display: none;
    position: absolute;
    top: 1.75rem;
    right: .55rem;
    z-index: 3;
    transform: translateY(-50%);
    padding: .35rem .55rem;
    color: var(--text-dim);
    font-size: .8125rem;
    font-weight: 600;
    background: none;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.auth-reveal:hover { color: var(--text); background: rgba(255, 255, 255, .08); }
.auth-reveal:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.js-auth .auth-reveal { display: inline-flex; }
.js-auth .auth-field > .form-control { padding-right: 5.25rem; }

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: .25rem 0 1.5rem;
    color: var(--text-dim);
    font-size: .875rem;
}

.auth .form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.auth .form-check-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(243, 194, 52, .22); }

.btn-auth {
    display: block;
    width: 100%;
    padding: .9rem 1rem;
    color: var(--brand-ink);
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .1s ease;
}

.btn-auth:hover { color: var(--brand-ink); background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-auth:active { transform: scale(.99); }
.btn-auth:focus-visible { outline: 3px solid rgba(243, 194, 52, .5); outline-offset: 2px; }

.btn-auth-ghost {
    color: var(--text);
    background: rgba(255, 255, 255, .04);
    border-color: rgba(255, 255, 255, .22);
}

.btn-auth-ghost:hover { color: var(--text); background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .35); }

.auth-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.75rem 0 1rem;
    color: var(--text-dim);
    font-size: .8125rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, .12);
}

.auth-switch { margin: 1.5rem 0 0; color: var(--text-dim); font-size: .9rem; text-align: center; }
.auth-switch a { color: var(--text); font-weight: 600; }
.auth-switch a:hover { color: var(--brand); }

.auth-fine { margin: 1.5rem 0 0; color: #6f778a; font-size: .8125rem; text-align: center; }
.auth-fine--left { text-align: left; }

/* Selo no topo das telas de aviso: a cor diz a gravidade antes de ler o titulo. */
.auth-icon {
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 1.25rem;
    border-radius: 50%;
}

.auth-icon svg { width: 1.75rem; height: 1.75rem; }

.auth-icon--danger { color: #ff8a8e; background: rgba(229, 72, 77, .14); border: 1px solid rgba(229, 72, 77, .35); }
.auth-icon--warning { color: #f7c877; background: rgba(245, 165, 36, .14); border: 1px solid rgba(245, 165, 36, .35); }

.auth-errors { margin: 0 0 1rem; padding-left: 1.1rem; color: #ff9ea1; font-size: .875rem; }
.auth-errors:empty { display: none; }

.auth .alert { border-radius: 10px; font-size: .9rem; }

.auth-callout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .85rem;
    align-items: start;
    margin-bottom: 1.5rem;
    padding: 1rem 1.1rem;
    background: rgba(243, 194, 52, .08);
    border: 1px solid rgba(243, 194, 52, .3);
    border-radius: 12px;
}

.auth-callout svg { width: 30px; height: 30px; color: var(--brand); }
.auth-callout strong { display: block; margin-bottom: .25rem; color: var(--text); font-size: .95rem; }
.auth-callout p { margin: 0; color: var(--text-dim); font-size: .85rem; line-height: 1.5; }
.auth-callout b { color: var(--text); font-weight: 650; }

/* Sem JS e so a lista das regras; o js/auth.js acende cada uma ao ser cumprida. */
.auth-rules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .4rem .75rem;
    margin: .25rem 0 1.5rem;
    padding: 0;
    color: var(--text-dim);
    font-size: .8125rem;
    list-style: none;
}

.auth-rules li { display: flex; align-items: center; gap: .45rem; transition: color .15s ease; }

.auth-rules li::before {
    content: "";
    flex: none;
    width: .95rem;
    height: .95rem;
    border: 1.5px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    transition: background-color .15s ease, border-color .15s ease;
}

.auth-rules li.ok { color: var(--text); }

.auth-rules li.ok::before {
    background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / 70% no-repeat;
    border-color: var(--success);
}

@media (max-width: 380px) {
    .auth-rules { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Coluna de apresentacao ---------- */

.auth-pitch { width: 100%; max-width: 27rem; }

@media (min-width: 960px) {
    .auth-pitch { max-width: 34rem; }
}

/* A do login e so vitrine: no celular sairia embaixo do formulario, rolando a toa. */
@media (max-width: 959px) {
    .auth-pitch--wide { display: none; }
}

.auth-eyebrow {
    margin: 0 0 .9rem;
    color: var(--brand);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.auth-headline {
    margin: 0 0 1.25rem;
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.02em;
}

.auth-headline span { color: var(--brand); }
.auth-headline--sm { font-size: clamp(1.6rem, 3vw, 2.2rem); }

.auth-pitch-text { margin: 0 0 1.75rem; color: #b9c0cf; font-size: 1.05rem; line-height: 1.6; }

.auth-features { display: grid; gap: .7rem; margin: 0; padding: 0; list-style: none; }

.auth-features li { display: flex; align-items: center; gap: .7rem; color: var(--text); font-size: .95rem; }

.auth-features li::before {
    content: "";
    flex: none;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: rgba(243, 194, 52, .16) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23f3c234' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M4 8.5l2.5 2.5 5.5-6'/%3E%3C/svg%3E") center / 65% no-repeat;
}

.auth-steps { display: grid; gap: 1.1rem; margin: 0; padding: 0; list-style: none; counter-reset: auth-step; }

.auth-steps li {
    position: relative;
    padding-left: 3.25rem;
    counter-increment: auth-step;
}

.auth-steps li::before {
    content: counter(auth-step);
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    place-items: center;
    width: 2.3rem;
    height: 2.3rem;
    color: var(--brand-ink);
    font-weight: 800;
    background: var(--brand);
    border-radius: 50%;
}

.auth-steps strong { display: block; margin-bottom: .2rem; color: var(--text); font-size: 1rem; }
.auth-steps p { margin: 0; color: var(--text-dim); font-size: .9rem; line-height: 1.5; }

/* ---------- Bootstrap overrides para tema escuro ---------- */

.form-control, .form-select {
    background: #0f131a;
    border-color: var(--border);
    color: var(--text);
}
.form-control:focus, .form-select:focus {
    background: #0f131a;
    color: var(--text);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
}
.form-control::placeholder { color: #5b647a; }
.form-floating > label { color: var(--text-dim); }
.form-check-input { background-color: #0f131a; border-color: var(--border); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }

.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover, .btn-primary:focus-visible, .btn-primary:active { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn-primary:disabled, .btn-primary.disabled { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); opacity: .55; }
.btn-outline-light { border-color: var(--border); color: var(--text); }
.btn-outline-light:hover { background: var(--bg-hover); border-color: var(--border); color: var(--text); }

.table { color: var(--text); --bs-table-bg: transparent; --bs-table-color: var(--text); }
.table > :not(caption) > * > * { border-bottom-color: var(--border); background: transparent; }
.table thead th { color: var(--text-dim); font-weight: 600; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.04em; }

.alert { border: 1px solid var(--border); }
.alert-danger { background: rgba(229, 72, 77, 0.12); border-color: rgba(229, 72, 77, 0.35); color: #ff9ea1; }
.alert-success { background: rgba(48, 164, 108, 0.12); border-color: rgba(48, 164, 108, 0.35); color: #7ee2b0; }
.alert-warning { background: rgba(245, 165, 36, 0.12); border-color: rgba(245, 165, 36, 0.35); color: #f7c877; }
.alert-info { background: rgba(var(--accent-rgb), 0.12); border-color: rgba(var(--accent-rgb), 0.35); color: #f7d774; }

.modal-content { background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text); }
.modal-header, .modal-footer { border-color: var(--border); }

/* ---------- Convite para instalar (PWA) ---------- */

/* A visibilidade vem da classe no <html>, posta pelo js/pwa.js — mesmo arranjo do menu
   hamburguer e do "voltar ao topo", e pelo mesmo motivo: o convite e renderizado pelo
   Blazor, e um re-render limparia uma classe posta nele. */
.pwa-invite { display: none; }

.pwa-prompt .pwa-invite {
    display: grid;
    position: fixed;
    /* Rodape, nao centro da tela: e o alcance do polegar. */
    left: 1rem;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    /* Acima da .topbar (100) e do painel do menu (99); abaixo do #blazor-error-ui
       (1000) e da barra de carregamento (2000). */
    z-index: 500;
    grid-template-columns: auto 1fr auto;
    gap: .2rem .75rem;
    align-items: center;
    max-width: 30rem;
    margin: 0 auto;
    padding: .9rem 1rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
    animation: pwa-invite-in .22s ease-out;
}

@keyframes pwa-invite-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

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

.pwa-invite-icon {
    grid-area: 1 / 1 / 3 / 2;
    border-radius: 8px;
}

.pwa-invite-title {
    grid-column: 2;
    margin: 0;
    font-size: 1rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.pwa-invite-close {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: -.25rem -.25rem 0 0;
    padding: 0;
    font-size: .8rem;
    line-height: 1;
    color: var(--text-dim);
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.pwa-invite-close:hover { background: var(--bg-hover); color: var(--text); }

.pwa-invite-text {
    grid-column: 2 / 4;
    margin: 0;
    font-size: .875rem;
    line-height: 1.4;
    color: var(--text-dim);
}

.pwa-invite-text strong { color: var(--text); font-weight: 600; }

.pwa-invite-install {
    grid-column: 1 / 4;
    margin-top: .75rem;
    padding: .65rem 1rem;
    font: inherit;
    font-weight: 600;
    color: var(--accent-ink);
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 8px;
    cursor: pointer;
}

.pwa-invite-install:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* O Android ganha o botao; o iPhone, a instrucao do Compartilhar — la nenhum navegador
   dispara beforeinstallprompt, porque todos usam o WebKit do sistema. */
.pwa-only-ios { display: none; }
.pwa-ios .pwa-only-ios { display: block; }
.pwa-ios .pwa-only-android { display: none; }

/* Trava de CSS alem do resize do js/pwa.js: o convite e so de celular. */
@media (min-width: 861px) {
    .pwa-prompt .pwa-invite { display: none; }
}

/* ---------- Erro do Blazor ---------- */

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #111;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ---- Aviso do teste gratis (Components/Shared/TrialBadge.razor) ----
   Canto inferior direito, sempre na tela enquanto a conta esta no teste. Vidro escuro
   translucido: o pedido foi "transparente", e o catalogo continua visivel por tras. */

.trial-badge {
    position: fixed;
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    /* Acima da .topbar (100); abaixo do convite do PWA (500), que e dispensavel e some. */
    z-index: 450;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0 .9rem;
    max-width: calc(100vw - 32px);
    padding: .65rem .8rem .7rem 1rem;
    border: 1px solid rgba(243, 194, 52, .35);
    border-radius: 14px;
    background: rgba(13, 15, 20, .62);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(10px) saturate(140%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
    color: var(--text);
    line-height: 1.2;
    animation: trial-badge-in .25s ease-out;
}

@keyframes trial-badge-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

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

.trial-badge-title {
    grid-column: 1;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #f3c234;
}

.trial-badge-left {
    grid-column: 1;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.trial-badge-until {
    grid-column: 1;
    font-size: .72rem;
    color: var(--text-dim);
}

.trial-badge-cta {
    grid-column: 2;
    grid-row: 1 / 4;
    padding: .5rem .85rem;
    border-radius: 999px;
    background: #f3c234;
    color: #12141a;
    font-size: .85rem;
    font-weight: 700;
    white-space: nowrap;
}
.trial-badge-cta:hover { background: #ffd558; color: #12141a; }

/* Suporte: o campo de mensagem e uma barra fixa no rodape; o aviso sobe acima dele. */
.trial-badge--raised { bottom: calc(max(16px, env(safe-area-inset-bottom, 0px)) + 7.5rem); }

/* Paginas publicas: o botao redondo do Telegram (.site-float, 56px) ja ocupa o canto. */
.site .trial-badge { bottom: calc(max(16px, env(safe-area-inset-bottom, 0px)) + 68px); }

/* Convite do PWA aberto no celular: ele ocupa o rodape inteiro, o aviso fica por cima dele. */
.pwa-prompt .trial-badge { bottom: calc(max(16px, env(safe-area-inset-bottom, 0px)) + 11rem); }

@media (max-width: 480px) {
    .trial-badge { padding: .55rem .65rem .6rem .85rem; gap: 0 .7rem; }
    .trial-badge-left { font-size: .98rem; }
}
