@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');

:root {
    --blue: #253f98;
    --blue-dark: #193281;
    --yellow: #ffd000;
    --red: #ef2b1a;
    --light: #eeeeee;
    --text: #111111;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--light);
    overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { text-decoration: none; }

.container { width: min(1040px, 86%); margin: 0 auto; }
.narrow { width: min(620px, 86%); margin: 0 auto; }

/* TOPO (idêntico à landing) */
.topbar {
    background: #29439B !important;
    background-color: #29439B !important;
    opacity: 1 !important;
}

.nav-wrap {
    width: min(1500px, 92%);
    min-height: 108px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: nowrap;
    margin: 0 auto;
}

.brand { display: flex; align-items: center; justify-content: center; flex: 0 0 92px; }
.brand img { width: 86px; height: 86px; object-fit: contain; }

.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex: 0 1 auto;
    min-width: 0;
}

.main-nav a {
    color: #fff;
    font-weight: 900;
    font-size: clamp(13px, .82vw, 16px);
    line-height: 1;
    padding: 10px 12px;
    border-right: 2px solid rgba(255,255,255,.34);
    white-space: nowrap;
    text-shadow: 0 1px 1px rgba(0,0,0,.25);
}

.main-nav a:first-child { border-left: 0; }
.main-nav a:hover { color: var(--yellow); }
.main-nav a.active { color: var(--yellow); }

.nav-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 900;
    font-size: 15px;
    line-height: 1.1;
    border: 3px solid transparent;
    transition: .15s;
    min-height: 46px;
    white-space: nowrap;
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
}

.btn:hover { filter: brightness(.98); transform: translateY(-1px); }
.btn-yellow { background: var(--yellow); border-color: var(--yellow); color: #000; padding: 9px 18px; text-align: center; }
.btn-outline { background: transparent; border-color: var(--yellow); color: var(--yellow); padding: 9px 18px; min-width: 102px; }
.btn-outline::before { content: '🔒'; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 2px solid var(--yellow); border-radius: 50%; font-size: 12px; margin-right: 7px; }
.menu-toggle { display: none; }

/* CABEÇALHO DA TELA DE CADASTRO */
.cadastro-hero { padding: 46px 0 8px; text-align: center; }
.cadastro-hero h1 {
    margin: 0 0 12px;
    color: var(--red);
    font-size: clamp(26px, 3.4vw, 38px);
    line-height: 1.05;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: -.3px;
}
.cadastro-hero p {
    margin: 0 auto;
    max-width: 560px;
    font-size: 17px;
    line-height: 1.4;
    color: #333;
}

/* SEÇÃO DO FORMULÁRIO */
.cadastro-form-section { padding: 24px 0 64px; }

form {
    background: #fff;
    padding: 32px 28px;
    border-radius: 14px;
    box-shadow: 0 4px 22px rgba(0,0,0,.10);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label { font-weight: 700; margin-top: 14px; font-size: 14px; color: #222; }

input, select {
    padding: 12px 14px;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    background: #fff;
    color: var(--text);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,63,152,.15);
}

.ajuda { font-size: 13px; color: #666; margin: 4px 0 0; }

/* Validação inline do cadastro (mensagem por campo, ao sair do campo) */
.msg-erro { display: none; color: var(--red); font-size: 13px; font-weight: 700; margin: 5px 0 0; }
.campo-invalido { border-color: var(--red) !important; background: #fff8f7; }
.ajuda-produtos { margin: -4px 0 12px; }

#itensProdutos { display: flex; flex-direction: column; gap: 4px; }

.produto-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.produto-item:first-child { padding-top: 0; }

.produto-item-campos {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 12px;
}

.produto-item-campos label { margin-top: 0; }

.select-produto-catalogo { margin-bottom: 6px; }
.select-produto-catalogo,
.input-modelo { width: 100%; }

.btn-remover-produto {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    margin-top: 26px;
    border: 1px solid #e0a8a3;
    border-radius: 50%;
    background: #fdecea;
    color: #ef2b1a;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.btn-remover-produto:hover { background: #fbd9d5; }

.btn-adicionar-produto {
    align-self: flex-start;
    margin: 6px 0 18px;
    padding: 10px 16px;
    background: #fff;
    border: 2px dashed #253f98;
    border-radius: 8px;
    color: #253f98;
    font-weight: 700;
    font-size: 14px;
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    cursor: pointer;
}

.btn-adicionar-produto:hover { background: #eef0fa; }

.aceites {
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.aceite-linha {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    font-size: 13.5px;
    line-height: 1.4;
    color: #333;
    margin-top: 0;
}

.aceite-linha input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin-top: 2px;
    padding: 0;
    accent-color: #253f98;
}

.aceite-linha span { flex: 1 1 auto; }

.aceite-linha a { color: #253f98 !important; font-weight: 700; }

.campo-oculto {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

button[type="submit"] {
    margin-top: 22px;
    background: #ffd000 !important;
    border: 0;
    padding: 15px;
    border-radius: 8px;
    font-weight: 900;
    font-size: 16px;
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    text-transform: uppercase;
    letter-spacing: .3px;
    cursor: pointer;
    transition: filter .15s, transform .15s;
}

button[type="submit"]:hover { filter: brightness(.97); transform: translateY(-1px); }
button[type="submit"]:disabled { opacity: .6; cursor: default; transform: none; }

.status-envio {
    text-align: center;
    font-size: 14px;
    color: #555;
    min-height: 20px;
}

.alerta {
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alerta-erro {
    background: #fdecea;
    color: var(--red);
    border: 1px solid #f5c2c0;
    font-weight: 600;
}

.alerta-sucesso {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 22px rgba(0,0,0,.10);
    text-align: center;
    padding: 40px 28px;
}

.alerta-sucesso h2 { color: var(--red); text-transform: uppercase; font-weight: 900; margin: 0 0 14px; }
.alerta-sucesso p { margin: 0 0 10px; line-height: 1.5; }

/* RODAPÉ (idêntico à landing) */
.footer { background: #253f98 !important; color: #fff; text-align: left; padding: 0; }

.footer-legal {
    width: min(1120px, 86%);
    margin: 0 auto;
    padding: 34px 0 28px;
    text-align: center;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.18);
}

.footer-content {
    width: min(1120px, 86%);
    margin: 0 auto;
    padding: 42px 0 34px;
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr;
    gap: 48px;
    align-items: flex-start;
}

.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.footer-brand img, .footer img { width: 82px; height: auto; margin: 0; }
.footer-brand p { margin: 0; max-width: 270px; font-size: 13px; line-height: 1.45; font-weight: 500; color: #fff; }

.footer-links h4 { margin: 0 0 16px; color: var(--yellow); font-size: 16px; line-height: 1; font-weight: 900; text-transform: uppercase; }
.footer-links a { display: block; margin: 0 0 12px; color: #fff; font-size: 14px; line-height: 1.25; font-weight: 700; text-decoration: none; }
.footer-links a:hover { color: var(--yellow); }

.footer-copy { border-top: 1px solid rgba(255,255,255,.18); text-align: center; padding: 24px 20px 28px; }
.footer-dev { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; font-size: 11px; font-weight: 700; letter-spacing: .4px; color: rgba(255,255,255,.75); }
.footer-dev img { width: 68px; height: auto; }
.footer-creditos { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 34px; margin-bottom: 10px; }
.footer-creditos .footer-dev { margin-bottom: 0; }
.footer-regulador img { width: auto; height: 42px; }
.footer-copy p, .footer p { font-size: 13px; line-height: 1.35; font-weight: 700; margin: 0; color: #fff; }

/* RESPONSIVO — MENU (idêntico à landing, incluindo o ajuste "V8" que estreita
   a faixa de menu desktop compacto e move o breakpoint mobile de 1180 pra
   1220px — sem isso o menu fica espremido entre 1180 e 1220px de largura) */
@media (min-width: 1181px) {
    .nav-wrap { width: min(1360px, 94%); min-height: 98px; gap: 14px; justify-content: center; }
    .brand { flex: 0 0 76px; }
    .brand img { width: 74px; height: 74px; }
    .main-nav { flex: 0 1 auto; min-width: 0; overflow: visible; }
    .main-nav a { font-size: 13px; padding: 9px 9px; letter-spacing: -.15px; }
    .nav-actions { gap: 9px; }
    .btn { font-size: 13px; min-height: 42px; border-radius: 7px; }
    .btn-yellow { padding: 8px 15px; }
    .btn-outline { padding: 8px 15px; min-width: 96px; }
    .btn-outline::before { width: 21px; height: 21px; font-size: 11px; margin-right: 6px; }
}

@media (min-width: 1181px) and (max-width: 1500px) {
    .nav-wrap { width: 98%; gap: 8px; }
    .brand { flex-basis: 66px; }
    .brand img { width: 62px; height: 62px; }
    .main-nav a { font-size: 11.5px; padding: 8px 6px; border-right-width: 1px; }
    .btn { font-size: 12px; min-height: 38px; }
    .btn-yellow { padding: 7px 10px; }
    .btn-outline { padding: 7px 10px; min-width: 80px; }
    .btn-outline::before { width: 19px; height: 19px; font-size: 10px; margin-right: 5px; }
}

@media (max-width: 1220px) {
    .topbar { border-bottom: 3px solid #fff; }
    .nav-wrap { width: 92%; min-height: auto; flex-wrap: wrap; justify-content: space-between; padding: 10px 0; }
    .brand { flex-basis: auto; }
    .brand img { width: 64px; height: 64px; }
    .menu-toggle { display: inline-flex; margin-left: auto; background: var(--yellow); color: #000; border: 0; border-radius: 7px; font-size: 26px; font-weight: 900; padding: 8px 13px; line-height: 1; cursor: pointer; }
    .main-nav, .nav-actions { display: none; width: 100%; }
    .main-nav.open, .nav-actions.open { display: flex; }
    .main-nav { flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 10px 0 4px; }
    .main-nav a { border: 0; border-bottom: 1px solid rgba(255,255,255,.25); font-size: 16px; padding: 14px 2px; text-align: left; }
    .nav-actions { padding: 8px 0 10px; gap: 10px; }
    .nav-actions.open { display: flex; flex-wrap: wrap; }
}

@media (max-width: 640px) {
    .container, .narrow { width: 88%; }
    .cadastro-hero { padding: 32px 0 6px; }
    .cadastro-form-section { padding: 18px 0 46px; }
    form { padding: 24px 18px; }
    .footer { padding: 0; }
    .footer-content { grid-template-columns: 1fr; gap: 30px; text-align: left; }
    .footer-brand { align-items: flex-start; }
    .produto-item-campos { grid-template-columns: 1fr; gap: 6px; }
    .produto-item { align-items: center; }
    .btn-remover-produto { margin-top: 0; }
}

/* AJUSTE EXCLUSIVO FIREFOX — mesmo problema conhecido da landing (ver
   public_html/css/style.css): sem isso, o Firefox renderiza o azul e o
   amarelo da marca com um filtro/opacidade mais claro do que o real. */
@-moz-document url-prefix() {
    .topbar,
    .footer {
        background: #253f98 !important;
        background-color: #253f98 !important;
        background-image: none !important;
        color: #fff !important;
        opacity: 1 !important;
        filter: none !important;
        mix-blend-mode: normal !important;
    }

    .btn-yellow {
        background: #ffd000 !important;
        background-color: #ffd000 !important;
        border-color: #ffd000 !important;
        color: #000 !important;
        filter: none !important;
        opacity: 1 !important;
    }

    .btn-outline,
    .btn-outline::before {
        color: #ffd000 !important;
        border-color: #ffd000 !important;
        background: transparent !important;
        filter: none !important;
        opacity: 1 !important;
    }

    .btn:hover { filter: none !important; }

    .main-nav a:hover,
    .main-nav a:focus,
    .main-nav a:active {
        color: #ffd000 !important;
        opacity: 1 !important;
        filter: none !important;
        text-shadow: none !important;
    }

    .footer-links h4 { color: #ffd000 !important; }

    .footer-links a,
    .footer-legal,
    .footer-copy p,
    .footer-dev span {
        color: #fff !important;
    }

    .footer-links a:hover { color: #ffd000 !important; }

    .aceite-linha a { color: #253f98 !important; }
}

/* OVERLAY DE ENVIO
   Cobre a tela enquanto o comprovante sobe. No rodapé (.status-envio) a
   mensagem passava despercebida e o participante achava que tinha travado —
   chegou a reenviar o mesmo comprovante por isso. No meio da tela, com o
   fundo bloqueado, fica claro que é para aguardar. */
.overlay-envio {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(25, 50, 129, .93);
}

.overlay-envio[hidden] { display: none; }

.overlay-envio-caixa {
    width: 100%;
    max-width: 420px;
    padding: 34px 28px;
    border-radius: 14px;
    background: #fff;
    text-align: center;
    box-shadow: 0 12px 44px rgba(0, 0, 0, .32);
}

.overlay-envio-spinner {
    width: 54px;
    height: 54px;
    margin: 0 auto 20px;
    border: 6px solid #e3e6ef;
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: girar-envio 1s linear infinite;
}

@keyframes girar-envio { to { transform: rotate(360deg); } }

.overlay-envio-titulo {
    margin: 0 0 10px;
    color: var(--blue);
    font-size: 20px;
    font-weight: 800;
}

.overlay-envio-texto {
    margin: 0;
    color: #555;
    font-size: 15px;
    line-height: 1.55;
}

.overlay-envio-aviso {
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid #e3e6ef;
    color: var(--blue-dark);
    font-size: 14px;
    font-weight: 700;
}

/* Quem prefere menos animação (acessibilidade) vê o círculo parado. */
@media (prefers-reduced-motion: reduce) {
    .overlay-envio-spinner { animation: none; }
}
