/**
 * Rede Premiada — Página pública premium
 */

:root {
    --ink: #0B1220;
    --ink-soft: #151E2E;
    --panel: #F7F4EE;
    --panel-strong: #FFFFFF;
    --line: rgba(11, 18, 32, 0.10);
    --text: #1A2332;
    --muted: #5E6B7A;
    --accent: #C4A35A;
    --cor-principal: var(--accent);
    --sucesso: #1F7A4C;
    --erro: #B42318;
    --radius: 18px;
    --font-display: "Cormorant Garamond", Georgia, serif;
    --font-body: "Outfit", "Segoe UI", sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--ink);
    min-height: 100vh;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.page {
    overflow-x: hidden;
}

/* ========== HERO ========== */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px 72px;
    color: #F7F4EE;
    isolation: isolate;
}

.hero-atmosphere {
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(1200px 700px at 70% -10%, rgba(196, 163, 90, 0.28), transparent 55%),
        radial-gradient(900px 600px at 10% 90%, rgba(70, 110, 160, 0.18), transparent 50%),
        linear-gradient(160deg, #070B14 0%, #121A2B 45%, #0B1220 100%);
    animation: atmosphereShift 14s ease-in-out infinite alternate;
}

.hero-grain {
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.35;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
    mix-blend-mode: soft-light;
}

.hero-inner {
    width: min(720px, 100%);
    text-align: center;
}

.brand-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}

.brand-logo {
    width: min(180px, 48vw);
    height: auto;
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.35));
}

.brand-name {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 5.4rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 0.95;
    color: #F7F4EE;
}

.hero-headline {
    font-family: var(--font-display);
    font-size: clamp(1.55rem, 4vw, 2.2rem);
    font-weight: 500;
    color: rgba(247, 244, 238, 0.92);
    margin-bottom: 12px;
}

.hero-support {
    font-size: 1.05rem;
    font-weight: 300;
    color: rgba(247, 244, 238, 0.68);
    max-width: 34ch;
    margin: 0 auto 32px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.hero-scroll {
    position: absolute;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    width: 28px;
    height: 44px;
    border: 1px solid rgba(247, 244, 238, 0.28);
    border-radius: 20px;
    display: grid;
    place-items: center;
}

.hero-scroll span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    animation: scrollDot 1.8s ease-in-out infinite;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 26px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.btn-accent {
    background: var(--accent);
    color: #14110B;
}

.btn-accent:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.btn-ghost {
    background: transparent;
    color: #F7F4EE;
    border-color: rgba(247, 244, 238, 0.28);
}

.btn-ghost:hover {
    border-color: rgba(247, 244, 238, 0.55);
    background: rgba(247, 244, 238, 0.04);
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.btn-submit {
    width: 100%;
    margin-top: 8px;
}

/* ========== PRIZE BAND ========== */
.prize-band {
    background:
        linear-gradient(90deg, rgba(196, 163, 90, 0.14), rgba(196, 163, 90, 0.04)),
        var(--ink-soft);
    border-top: 1px solid rgba(196, 163, 90, 0.25);
    border-bottom: 1px solid rgba(196, 163, 90, 0.15);
    color: #F7F4EE;
}

.prize-band-inner {
    width: min(920px, calc(100% - 48px));
    margin: 0 auto;
    padding: 36px 0;
    text-align: center;
}

.prize-label {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(247, 244, 238, 0.62);
    margin-bottom: 8px;
}

.prize-value {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 7vw, 4rem);
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
}

.prize-split {
    margin-top: 12px;
    color: rgba(247, 244, 238, 0.62);
    font-size: 0.95rem;
}

.prize-split span {
    margin: 0 8px;
    opacity: 0.5;
}

/* ========== SECTIONS ========== */
.section {
    background: var(--panel);
    padding: 72px 24px;
}

.section-head {
    width: min(720px, 100%);
    margin: 0 auto 32px;
    text-align: center;
}

.section-head h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 10px;
}

.section-head p {
    color: var(--muted);
    font-size: 1.05rem;
}

.cadastro-section {
    background:
        radial-gradient(700px 280px at 50% 0%, rgba(196, 163, 90, 0.12), transparent 70%),
        var(--panel);
}

/* ========== FORM ========== */
.form-panel {
    width: min(640px, 100%);
    margin: 0 auto;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(24px, 4vw, 40px);
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group label,
.field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
}

.form-group label em {
    font-style: normal;
    font-weight: 400;
    color: var(--muted);
}

.form-group input {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #FBF9F5;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.form-group input::placeholder {
    color: #9AA5B3;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
}

.help-text {
    display: block;
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--muted);
}

.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.radio-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding: 14px 16px;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    background: #FBF9F5;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.radio-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    pointer-events: none;
}

.radio-option span {
    display: block;
    width: 100%;
    text-align: center;
    line-height: 1.2;
    font-size: 1rem;
    font-weight: 500;
    color: var(--muted);
}

.radio-option:hover {
    border-color: rgba(196, 163, 90, 0.55);
    background: #fff;
    transform: translateY(-1px);
}

.radio-option:has(input:checked) {
    border-color: var(--accent);
    background: linear-gradient(180deg, rgba(196, 163, 90, 0.18) 0%, rgba(196, 163, 90, 0.08) 100%);
    box-shadow: inset 0 0 0 1px rgba(196, 163, 90, 0.25);
}

.radio-option:has(input:checked) span {
    color: var(--ink);
    font-weight: 700;
}

.radio-option:has(input:checked)::after {
    content: "";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

/* ========== RESULT ========== */
.resultado {
    margin-top: 20px;
    padding: 18px;
    border-radius: 12px;
    animation: slideDown 0.35s ease;
}

.resultado.sucesso {
    background: #E8F6EE;
    border: 1px solid rgba(31, 122, 76, 0.25);
    color: #145C39;
}

.resultado.erro {
    background: #FCEDED;
    border: 1px solid rgba(180, 35, 24, 0.25);
    color: #8A1C14;
}

.resultado h3 {
    font-family: var(--font-display);
    font-size: 1.45rem;
    margin-bottom: 8px;
}

.resultado .detalhes {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.resultado .detalhes p {
    margin: 6px 0;
    font-size: 0.95rem;
}

.resultado .numero-sorte {
    margin: 16px 0;
    padding: 18px;
    text-align: center;
    border-radius: 12px;
    background: rgba(196, 163, 90, 0.12);
    color: var(--ink);
    font-size: 1.15rem;
    font-weight: 600;
}

/* ========== HOW ========== */
.how-section {
    background:
        linear-gradient(180deg, #EFEBE3 0%, var(--panel) 100%);
    border-top: 1px solid var(--line);
}

.steps {
    width: min(860px, 100%);
    margin: 0 auto;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    counter-reset: step;
}

.steps li {
    counter-increment: step;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 22px 22px;
    position: relative;
}

.steps li::before {
    content: counter(step, decimal-leading-zero);
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 10px;
}

.steps strong {
    display: block;
    font-size: 1.05rem;
    color: var(--ink);
    margin-bottom: 6px;
}

.steps span {
    color: var(--muted);
    font-size: 0.95rem;
}

/* ========== FOOTER ========== */
.site-footer {
    background: var(--ink);
    color: rgba(247, 244, 238, 0.72);
    padding: 40px 24px 48px;
    border-top: 1px solid rgba(247, 244, 238, 0.08);
}

.footer-inner {
    width: min(860px, 100%);
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: #F7F4EE;
    margin-bottom: 14px;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 22px;
    margin-bottom: 18px;
}

.footer-nav a {
    color: rgba(247, 244, 238, 0.78);
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.footer-nav a:hover {
    color: var(--accent);
    border-color: rgba(196, 163, 90, 0.5);
}

.footer-copy {
    font-size: 0.88rem;
    color: rgba(247, 244, 238, 0.45);
}

/* ========== MOTION ========== */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.hero .reveal {
    opacity: 1;
    transform: none;
    animation: heroIn 0.9s ease both;
}

.hero .reveal-delay-1 { animation-delay: 0.12s; }
.hero .reveal-delay-2 { animation-delay: 0.22s; }
.hero .reveal-delay-3 { animation-delay: 0.32s; }

@keyframes heroIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes atmosphereShift {
    from {
        filter: hue-rotate(0deg) saturate(1);
        transform: scale(1);
    }
    to {
        filter: hue-rotate(8deg) saturate(1.08);
        transform: scale(1.03);
    }
}

@keyframes scrollDot {
    0% { transform: translateY(-8px); opacity: 0; }
    40% { opacity: 1; }
    100% { transform: translateY(10px); opacity: 0; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-loader {
    letter-spacing: 0.02em;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 720px) {
    .form-row,
    .steps,
    .radio-group {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 40px 20px 68px;
    }

    .section {
        padding: 56px 20px;
    }

    .form-panel {
        padding: 22px;
    }

    .prize-band-inner {
        width: calc(100% - 40px);
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal,
    .hero .reveal,
    .hero-atmosphere,
    .hero-scroll span {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
}

/* ========== PÁGINA VALIDAR ========== */
.page-validate {
    background: var(--panel);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    background: rgba(11, 18, 32, 0.96);
    border-bottom: 1px solid rgba(247, 244, 238, 0.08);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #F7F4EE;
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 600;
}

.topbar-logo {
    height: 36px;
    width: auto;
}

.topbar-nav {
    display: flex;
    gap: 18px;
}

.topbar-nav a {
    color: rgba(247, 244, 238, 0.65);
    font-size: 0.95rem;
    font-weight: 500;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
}

.topbar-nav a:hover,
.topbar-nav a.is-active {
    color: var(--accent);
    border-color: rgba(196, 163, 90, 0.55);
}

.validate-hero {
    position: relative;
    isolation: isolate;
    padding: 72px 24px 56px;
    color: #F7F4EE;
    text-align: center;
    overflow: hidden;
}

.validate-hero-inner {
    position: relative;
    width: min(680px, 100%);
    margin: 0 auto;
}

.validate-kicker {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(247, 244, 238, 0.55);
    margin-bottom: 12px;
}

.validate-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 7vw, 3.8rem);
    font-weight: 600;
    line-height: 1;
    margin-bottom: 12px;
}

.validate-hero p:last-child {
    color: rgba(247, 244, 238, 0.68);
    font-size: 1.05rem;
    max-width: 38ch;
    margin: 0 auto;
}

.validate-main {
    padding-top: 40px;
}

.input-action {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.input-action .btn {
    min-width: 120px;
}

.result-panel {
    width: min(640px, 100%);
    margin: 22px auto 0;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(22px, 4vw, 34px);
}

.result-ok {
    border-color: rgba(196, 163, 90, 0.35);
    box-shadow: 0 18px 40px rgba(11, 18, 32, 0.06);
}

.result-miss {
    text-align: center;
}

.result-status {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}

.result-miss .result-status {
    color: var(--erro);
}

.result-panel h2 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.3rem);
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 14px;
}

.result-copy {
    color: var(--muted);
    margin-bottom: 22px;
}

.lucky-number {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 8px 0 22px;
    padding: 22px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(196, 163, 90, 0.16), rgba(196, 163, 90, 0.06));
    border: 1px solid rgba(196, 163, 90, 0.28);
}

.lucky-number span {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
}

.lucky-number strong {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 7vw, 3.4rem);
    font-weight: 600;
    color: var(--ink);
    line-height: 1;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.result-grid > div {
    padding: 14px 16px;
    border-radius: 12px;
    background: #FBF9F5;
    border: 1px solid var(--line);
}

.result-grid span {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
}

.result-grid strong {
    color: var(--ink);
    font-size: 0.98rem;
    font-weight: 600;
    word-break: break-word;
}

.status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(31, 122, 76, 0.12);
    color: var(--sucesso) !important;
    font-size: 0.85rem !important;
}

.how-inline {
    width: min(860px, 100%);
    margin: 48px auto 0;
}

.how-inline h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 22px;
    color: var(--ink);
}

.steps-compact {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 720px) {
    .topbar {
        padding: 14px 16px;
        padding-top: calc(14px + env(safe-area-inset-top));
    }

    .topbar-brand span {
        font-size: 1.2rem;
    }

    .input-action,
    .result-grid,
    .steps-compact {
        grid-template-columns: 1fr;
    }

    .input-action .btn {
        width: 100%;
    }

    .validate-hero {
        padding: 56px 20px 40px;
    }
}

/* ========== APP MOBILE (visual de aplicativo) ========== */
.app-tabbar {
    display: none;
}

.install-banner {
    display: none;
}

@media (max-width: 900px) {
    body {
        padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }

    .page {
        min-height: 100dvh;
    }

    .hero {
        min-height: calc(100dvh - 72px);
        padding-top: calc(36px + env(safe-area-inset-top));
        padding-bottom: 88px;
    }

    .hero-scroll {
        bottom: 88px;
    }

    .brand-logo {
        width: min(140px, 42vw);
    }

    .brand-name {
        font-size: clamp(2.6rem, 12vw, 3.6rem);
    }

    .hero-actions {
        width: 100%;
    }

    .hero-actions .btn {
        flex: 1 1 140px;
        min-height: 54px;
    }

    .section {
        padding: 48px 16px 96px;
    }

    .form-panel,
    .result-panel {
        border-radius: 22px;
    }

    .site-footer {
        padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }

    .app-tabbar {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
        background: rgba(11, 18, 32, 0.94);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid rgba(247, 244, 238, 0.08);
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    }

    .app-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-height: 52px;
        border-radius: 14px;
        color: rgba(247, 244, 238, 0.55);
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        transition: color 0.2s ease, background 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .app-tab svg {
        width: 22px;
        height: 22px;
        fill: currentColor;
    }

    .app-tab.is-active {
        color: var(--accent);
        background: rgba(196, 163, 90, 0.12);
    }

    .install-banner[hidden] {
        display: none !important;
    }

    .install-banner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(78px + env(safe-area-inset-bottom));
        z-index: 110;
        padding: 14px 14px 14px 16px;
        border-radius: 16px;
        background: #151E2E;
        border: 1px solid rgba(196, 163, 90, 0.35);
        color: #F7F4EE;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    }

    .install-banner-text {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
    }

    .install-banner-text strong {
        font-size: 0.92rem;
    }

    .install-banner-text span {
        font-size: 0.78rem;
        color: rgba(247, 244, 238, 0.62);
    }

    .install-banner-actions {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
    }

    .btn-install {
        border: none;
        border-radius: 10px;
        background: var(--accent);
        color: #14110B;
        font-family: var(--font-body);
        font-weight: 700;
        font-size: 0.82rem;
        padding: 10px 12px;
        cursor: pointer;
    }

    .btn-install-close {
        border: none;
        background: transparent;
        color: rgba(247, 244, 238, 0.55);
        font-size: 1.4rem;
        line-height: 1;
        width: 32px;
        height: 32px;
        cursor: pointer;
    }
}

/* Modo instalado (PWA standalone) */
@media (display-mode: standalone) {
    .hero {
        padding-top: calc(28px + env(safe-area-inset-top));
    }

    .install-banner {
        display: none !important;
    }
}
