:root {
    --primary: #191919;
    --secondary: #d90429;
    --yellow: #ffd600;
    --white: #fff;
    --gray-light: #f7f7fa;
    --gray: #e6e6ea;
    --gray-dark: #222;
    --accent: #7c7c7c;
    --checkered: repeating-linear-gradient(45deg, #fff 0 10px, #191919 10px 20px);
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    background: var(--gray-light);
    color: var(--gray-dark);
    min-height: 100vh;
    box-sizing: border-box;
}

body {
    background: linear-gradient(120deg, #191919 0%, #393e46 100%) fixed;
    overflow-x: hidden;
}

main {
    margin-left: 160px;
    max-width: calc(100vw - 160px);
    width: 100%;
    padding: 2em 2.6em;
    background: #fff;
    min-height: 100vh;
    box-sizing: border-box;
    border-radius: 0;
    transition: margin-left 0.2s, width 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

.checkered {
    background: var(--checkered);
    height: 8px;
    border-radius: 8px;
    margin: 0 auto 24px auto;
    width: 180px;
    border: 2px solid var(--yellow);
    box-shadow: 0 2px 7px #2223;
}

.corrida-accent { color: var(--secondary); font-weight: 800; letter-spacing: 1.5px;}
.red { color: #d90429; }
.yellow { color: #ffd600; }
.black { color: #191919; }
.strong-red { color: #d90429; font-weight: bold; }
.strong-yellow { color: #ffd600; font-weight: bold; }
.strong-black { color: #191919; font-weight: bold; }

.btn {
    background: var(--secondary);
    color: #fff;
    border: none;
    padding: 0.6em 1.5em;
    border-radius: 25px;
    font-size: 1.13em;
    cursor: pointer;
    font-weight: 700;
    margin: 0.2em 0.3em;
    box-shadow: 0 2px 15px #d9042930;
    transition: background .17s, color .17s;
    text-decoration: none;
    display: inline-block;
}
.btn:hover { background: var(--yellow); color: var(--primary);}
.btn-dark { background: #191919 !important; color: #fff !important;}
.btn-dark:hover { background: var(--yellow) !important; color: #191919 !important;}
.btn-green { background: #24b300 !important; color: #fff !important;}
.btn-green:hover { background: var(--yellow) !important; color: #191919 !important;}
.center { text-align: center; }
.contact-help { margin-top: 2em; font-size: 0.98em; color: #777; }

.landing-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 2em;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 1.7em auto;
}
.landing-hero-img {
    flex: 1 1 320px;
    min-width: 240px;
    max-width: 380px;
}
.landing-hero-img img {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 3px 14px #19191940;
}
.landing-hero-content {
    flex: 2 1 350px;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.landing-hero-content h1 {
    font-size: 2.1em;
    color: #191919;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: .6em;
    margin-top: 0;
}
.landing-hero-sub {
    font-size: 1.15em;
    color: #222;
    margin-bottom: .7em;
    line-height: 1.5;
}
.hero-btns { margin: 1.3em 0; }

.landing-feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 2em;
    justify-content: center;
    margin: 2.5em 0;
    width: 100%;
    max-width: 1100px;
}
.landing-feature-card {
    flex: 1 1 220px;
    min-width: 220px;
    max-width: 330px;
    background: #fff;
    border-radius: 12px;
    padding: 1.6em 1.1em;
    box-shadow: 0 1px 8px #0001;
    text-align: left;
}
.landing-feature-card h3 {
    margin-bottom: 0.7em;
    font-size: 1.13em;
}
.landing-feature-card ul {
    font-size: 1em;
    text-align: left;
    line-height: 1.7;
    color: #444;
    list-style: square;
    padding-left: 1.2em;
}

.how-works {
    background: #fffbe7;
    padding: 1.3em 1.1em;
    border-radius: 10px;
    max-width: 800px;
    margin: 2.5em auto 0;
    width: 100%;
}
.how-works h3 { font-weight: 700; margin-top: 0;}
.how-works ol {
    margin: 1em 1.5em 0 1.2em;
    font-size: 1.08em;
    line-height: 1.7;
    color: #232;
}

/* MENU LATERAL */
.sidebar-nav {
    width: 230px;
    background: var(--primary);
    color: var(--yellow);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 0 2em 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    border-right: 5px solid var(--secondary);
    box-shadow: 3px 0 25px #1119;
    min-height: 100vh;
    transition: left 0.2s, width 0.2s;
}
.sidebar-logo {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 2.2em 2em 1em 2em;
}
.sidebar-logo-text {
    font-family: 'Orbitron', 'Bebas Neue', Arial, sans-serif;
    font-weight: 900;
    font-size: 2em;
    letter-spacing: 2px;
    color: #ffd600;
    text-shadow: 1px 2px 7px #000a;
}
.logo-dot { color: #d90429; }
.sidebar-user-block {
    width: 100%;
    padding: 0 2em 0.6em 2em;
    margin-bottom: 0.6em;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4em;
}
.sidebar-user {
    font-size: 1em;
    color: #ffd600;
    background: #222;
    padding: 0.4em 1em;
    border-radius: 13px;
    font-weight: 600;
    letter-spacing: .5px;
    box-shadow: 0 2px 8px #0003;
    margin-bottom: 0.2em;
    word-break: break-all;
}
.sidebar-saldo-chip {
    background: #ffd600;
    color: #191919;
    border-radius: 13px;
    padding: 0.22em 0.7em;
    font-size: .99em;
    font-weight: 700;
    margin-left: 0;
    box-shadow: 0 1px 4px #0001;
    margin-top: 2px;
    display: inline-block;
}
.sidebar-links {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 1.1em;
    gap: 2px;
}
.sidebar-links a {
    color: #ffd600;
    text-decoration: none;
    font-family: 'Montserrat', Arial, sans-serif;
    font-weight: 700;
    font-size: 0.8em;
    padding: 0.8em 1.6em 0.8em 2.1em;
    border-left: 5px solid transparent;
    transition: background 0.13s, color 0.13s, border 0.13s;
    border-radius: 0 18px 18px 0;
    margin-right: 10px;
    display: flex;
    align-items: center;
    gap: 0.65em;
    background: none;
}
.sidebar-links a.active,
.sidebar-links a:hover {
    background: #ffd600;
    color: #191919 !important;
    border-left: 5px solid #d90429;
    box-shadow: 2px 2px 7px #ffd60055;
    font-weight: 900;
    text-shadow: none;
}
.sidebar-links a span {
    color: inherit;
    font-size: 1.14em;
}
.sidebar-links a.logout {
    color: #ffd600 !important;
    margin-top: 2em;
    border-left: 5px solid #d90429;
    background: #d90429;
    border-radius: 0 18px 18px 0;
    font-weight: 700;
    transition: background 0.13s, color 0.13s, border 0.13s;
}
.sidebar-links a.logout:hover {
    background: #ffd600;
    color: #d90429 !important;
    border-left: 5px solid #d90429;
}
.menu-mobile-toggle {
    display: none;
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 1201;
    flex-direction: column;
    gap: 5px;
    width: 38px; height: 38px;
    justify-content: center;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px #0002;
    cursor: pointer;
}
.menu-mobile-toggle span {
    display: block;
    width: 28px; height: 4px;
    background: #222;
    border-radius: 3px;
}
.mobile-menu-overlay {
    display: none;
}

/* --------- MOBILE --------- */
@media (max-width: 900px) {
    .menu-mobile-toggle { display: flex !important; }
    .sidebar-nav {
        left: -270px;
        width: 220px;
        min-width: 0;
        padding: 0;
        transition: left .25s;
        box-shadow: none;
        z-index: 1202;
    }
    .sidebar-nav.menu-mobile-open {
        left: 0;
        transition: left .25s;
        box-shadow: 2px 0 18px #0005;
    }
    .sidebar-logo-text { display: block; }
    .sidebar-user-block { display:block;}
    .sidebar-links a {
        font-size: 0.8em;
        padding: 0.8em 1.6em 0.8em 2.1em;
        justify-content: flex-start;
    }
    .sidebar-links a span { display: inline; }
    .mobile-menu-overlay.menu-mobile-open {
        display: block;
        position: fixed;
        left: 0; top: 0; width: 100vw; height: 100vh;
        background: #0007;
        z-index: 1200;
        transition: opacity .2s;
    }
    main {
        margin-left: -10px !important;
        width: 100vw !important;
        max-width: 100vw !important;
        padding: 1.1em 0.7em !important;
        border-radius: 0;
        min-width: 0;
        box-sizing: border-box;
        align-items: stretch;
    }
    .checkered { width: 48px; }
    .landing-hero, .landing-feature-list {
        flex-direction: column;
        gap: 1.2em;
        align-items: stretch;
        width: 100%;
        max-width: 100vw;
    }
    .landing-hero-img { max-width: 100vw; min-width: 0; }
    .landing-hero-content {
        min-width: 0;
        padding: 0 0.5em;
        align-items: flex-start;
    }

.landing-hero-img img {
    width: 95%;
    border-radius: 15px;
    box-shadow: 0 3px 14px #19191940;
}


    .landing-hero-content h1, h1 {
        font-size: 1.35em !important;
        word-break: break-word;
    }
    .landing-feature-list { gap: 1em; }
    .landing-feature-card { max-width: 98vw; }
    .form-card { padding: 1.1em 0.5em; }
    .how-works {
        padding: 1.1em 0.5em;
        max-width: 100vw;
    }
    .contact-help { padding: 0 0.3em; }
}
@media (max-width: 600px) {
    .landing-hero-content h1, h1 { font-size: 1.15em !important;}
    .checkered { width: 38px; }
    .form-card, form, .form-box {
        padding: 1.1em 0.5em;
        max-width: 97vw;
    }
}

/* FORMULÁRIO BONITO, CENTRALIZADO E COMPACTO */
.form-card, form, .form-box {
    background: #f9f9fa;
    padding: 2em 1.2em;
    border-radius: 16px;
    max-width: 380px;
    width: 100%;
    margin: 2.5em auto 1.5em auto;
    box-shadow: 0 3px 16px #d9042915;
    display: flex;
    flex-direction: column;
    gap: 0.15em; /* Menor gap entre grupos de inputs */
    align-items: center;
}

.input-group, .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.08em;  /* Menor gap entre label e input */
    width: 100%;
    margin-bottom: 0; /* Remove espaço extra */
}

label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.12em;
    letter-spacing: 0.01em;
    font-size: 1em;
    padding-left: 0.1em;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='date'],
input[type='tel'],
textarea,
select {
    padding: 0.67em 1em;
    border-radius: 7px;
    border: 1.5px solid #dedede;
    font-size: 1.07em;
    background: #fff;
    box-shadow: 0 1px 8px #1919190b;
    transition: border-color .18s, box-shadow .18s;
    outline: none;
    color: #222;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 2px #ffd60055;
}

input[type='checkbox'],
input[type='radio'] {
    width: 18px;
    height: 18px;
    accent-color: var(--secondary);
    margin-right: 6px;
    margin-top: 0;
}

input[type='submit'],
button[type='submit'] {
    background: var(--secondary);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 1.13em;
    font-weight: 700;
    padding: 0.7em 1.9em;
    cursor: pointer;
    box-shadow: 0 2px 15px #d9042930;
    transition: background .16s, color .16s;
    margin-top: 1em;
    width: 100%;
}

input[type='submit']:hover,
button[type='submit']:hover {
    background: var(--yellow);
    color: var(--primary);
}

.form-error, .input-error {
    color: #d90429;
    background: #fff0f2;
    border-left: 4px solid #d90429;
    padding: 0.6em 1em;
    border-radius: 7px;
    font-size: 0.98em;
    margin-bottom: 0.7em;
    width: 100%;
    box-sizing: border-box;
}
.form-success {
    color: #24b300;
    background: #f0fff3;
    border-left: 4px solid #24b300;
    padding: 0.6em 1em;
    border-radius: 7px;
    font-size: 0.98em;
    margin-bottom: 0.7em;
    width: 100%;
    box-sizing: border-box;
}

input::placeholder, textarea::placeholder {
    color: #b2b2b2;
    font-style: italic;
    opacity: 1;
}

/* Botão de mostrar senha (se usado) */
.input-group .show-hide {
    position: absolute;
    right: 1.2em;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.1em;
    color: #888;
    cursor: pointer;
}


.sidebar-submenu-group {
    width: 100%;
}
.sidebar-admin-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.65em;
    font-size: 0.89em;
    font-weight: 700;
    color: #ffd600;
    padding: 0.8em 1.6em 0.8em 2.1em;
    border-left: 5px solid transparent;
    border-radius: 0 18px 18px 0;
    transition: background 0.13s, color 0.13s, border 0.13s;
}
.sidebar-admin-toggle:hover,
.sidebar-admin-toggle.active {
    background: #ffd600;
    color: #191919 !important;
    border-left: 5px solid #d90429;
}
.sidebar-submenu {
    display: none;
    flex-direction: column;
    padding-left: 2.4em;
    background: transparent;
}
.sidebar-submenu.show {
    display: flex;
}
.sidebar-submenu a {
    color: #ffd600;
    font-size: 0.89em;
    font-weight: 600;
    padding: 0.5em 0 0.5em 0.7em;
    border-left: none;
    border-radius: 0 14px 14px 0;
    background: none;
    transition: background 0.13s, color 0.13s;
}
.sidebar-submenu a.active,
.sidebar-submenu a:hover {
    background: #ffd600;
    color: #191919 !important;
}


.filtro-relatorio {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7em 1.1em;
    align-items: flex-end;
    justify-content: center;
    background: #f6f6fc;
    border-radius: 10px;
    padding: 12px 16px 10px 16px;
    margin: 0 auto 26px auto;
    max-width: 520px;
    box-shadow: 0 2px 10px #0001;
}
.filtro-relatorio .filtro-grupo {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 180px;
    flex: 1 1 200px;
}
.filtro-relatorio label {
    font-weight: 600;
    color: #333;
    font-size: 0.97em;
    margin-bottom: 2px;
}
.filtro-relatorio input[type="date"] {
    padding: 0.48em 1.1em;
    border-radius: 6px;
    border: 1.2px solid #dedede;
    font-size: 1.12em;
    background: #fff;
    color: #222;
    width: 100%;
    box-sizing: border-box;
}
.filtro-relatorio button,
.filtro-relatorio .reset-btn {
    background: var(--secondary, #d90429);
    color: #fff;
    border: none;
    border-radius: 18px;
    font-size: 1.07em;
    font-weight: 700;
    padding: 0.65em 2em;
    cursor: pointer;
    box-shadow: 0 1px 6px #d9042920;
    transition: background .16s, color .16s;
    text-decoration: none;
    display: inline-block;
    margin-top: 1.2em;
}
.filtro-relatorio button:hover,
.filtro-relatorio .reset-btn:hover {
    background: var(--yellow, #ffd600);
    color: var(--primary, #191919);
}
.filtro-relatorio .reset-btn {
    background: #bbb;
    color: #fff;
    margin-left: 0.2em;
}
.filtro-relatorio .reset-btn:hover {
    background: #888;
    color: #fff;
}
@media (max-width: 650px){
    .filtro-relatorio {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6em 0;
        padding: 2px 6px 8px 6px;
        max-width: 99vw;
    }
    .filtro-relatorio .filtro-grupo {
        min-width: 0;
        flex: 1 1 100%;
    }
    .filtro-relatorio button,
    .filtro-relatorio .reset-btn {
        margin-top: 0.7em;
    }
}


/* AJUSTE FINAL: TUDO ENCAIXA NO MOBILE SEMPRE */

/* 1. Força o main a ocupar toda a tela em mobile, sem rolar horizontalmente */
@media (max-width: 900px) {
  main {
    margin-left: 0px !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    padding-left: 0.0em !important;
    padding-right: 0.7em !important;
    border-radius: 0 !important;
    box-sizing: border-box;
    align-items: stretch !important;
    overflow-x: hidden !important;
  }
}

/* 2. HERO: força colunas a empilharem e quebra textos */
@media (max-width: 700px) {
  .landing-hero {
    flex-direction: column !important;
    gap: 1.2em !important;
    align-items: stretch !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
  }
  .landing-hero-img,
  .landing-hero-content {
    max-width: 100vw !important;
    min-width: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .landing-hero-content h1 {
    font-size: 1.19em !important;
    word-break: break-word;
    max-width: 100vw !important;
  }
}

/* 3. Blocos de features, como cards */
@media (max-width: 700px) {
  .landing-feature-list {
    flex-direction: column !important;
    gap: 1em !important;
    align-items: stretch !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
  }
  .landing-feature-card {
    max-width: 99vw !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
}

/* 4. Bloco de corridas: força largura máxima e scroll nas tabelas */
@media (max-width: 700px) {
  .proximas-corridas-bloco {
    max-width: 100vw !important;
    min-width: 0 !important;
    padding-left: 0.2em !important;
    padding-right: 0.2em !important;
    box-sizing: border-box !important;
    border-radius: 0.8em !important;
  }
}

/* 5. Tabela: esconde colunas, reduz padding, sempre cabe na tela */
@media (max-width: 520px) {
  .tabela-corridas-scroll {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    box-sizing: border-box;
  }
  .tabela-corridas {
    min-width: 360px !important; /* Permite o scroll horizontal se necessário */
    max-width: 100vw !important;
    font-size: 0.94em;
  }
  .tabela-corridas th, .tabela-corridas td {
    padding: 4px 2px !important;
    font-size: 0.83em !important;
    word-break: break-word;
    white-space: nowrap;
  }
  .tabela-corridas th:nth-child(5), .tabela-corridas td:nth-child(5), /* Round */
  .tabela-corridas th:nth-child(4), .tabela-corridas td:nth-child(4), /* Horário */
  .tabela-corridas .pais-nome {
    display: none !important;
  }
  .tabela-corridas td:nth-child(2) {
    white-space: normal !important;
    word-break: break-word;
    max-width: 90px !important;
  }
  .apostar-btn {
    padding: 3px 6px !important;
    font-size: 0.90em !important;
  }
}

/* 6. Bloco "como funciona" */
@media (max-width: 700px) {
  .how-works {
    max-width: 100vw !important;
    padding-left: 0.5em !important;
    padding-right: 0.5em !important;
    box-sizing: border-box !important;
  }
}

/* 7. Rodapé de contato */
@media (max-width: 700px) {
  .contact-help {
    padding-left: 0.2em !important;
    padding-right: 0.2em !important;
    word-break: break-word;
    font-size: 0.95em;
    min-width: 0 !important;
  }
}

/* 8. Impede que nada vaze horizontalmente do <body> */
body, html {
  overflow-x: hidden !important;
  width: 100vw !important;
  max-width: 100vw !important;
}
</style>