/* ---------------- IMPORTA A FONTE INTER DO GOOGLE FONT ---------------- */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* ---------------- PRINCIPAIS CORES ---------------- */

:root{
  --vermelho: #D2003C;
  --azul: #0F0069;
  --branco: #ffffff;
  --amarelo: #FFCC00;
  --fundo-pagina: #ffffff;
  --fundo-superficie: #ffffff;
  --fundo-suave: #f1f1f4;
  --texto-principal: #15151a;
  --texto-secundario: #666670;
  --borda: #d5d5dc;
  --sombra: rgba(15, 0, 105, 0.10);
}

html[data-theme="dark"]{
  color-scheme: dark;
  --branco: #f7f7fb;
  --fundo-pagina: #111116;
  --fundo-superficie: #1c1c24;
  --fundo-suave: #282832;
  --texto-principal: #f5f5f7;
  --texto-secundario: #d0d0da;
  --borda: #3d3d49;
  --sombra: rgba(0, 0, 0, 0.38);
}

/* ---------------- DEFINE FONTE E ESPAÃ‡AMENTO DE TODAS AS TELAS ---------------- */

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

/* ---------------- TIRA BARRA DE ROLAGEM ---------------- */

html{
  scrollbar-width: none;
}

html::-webkit-scrollbar{
  display: none;
}
body{
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--fundo-pagina);
  color: var(--texto-principal);
  transition: background-color 0.22s ease, color 0.22s ease;
}

/* ---------------- DIV COLORIDA ---------------- */

.barra-gradiente{
    width: 100%;
    height: 15px;

    background: linear-gradient(
        to right,
        var(--azul),
        var(--vermelho),
        var(--amarelo)
    );
}

/* ---------------- BOTÃƒO DE CANCELAR TELAS AUDITOR ---------------- */

.cancelar {
    position: relative;
    z-index: 30;
    display: flex;
    align-items: center;
    width: 50px;
    height: 50px;
    padding: 0 16px;
    gap: 13px;
    margin-top: 40px;
    margin-left: 30px;
    border-radius: 999px;
    background-color: var(--vermelho);
    text-decoration: none;
    color: transparent;
    font-size: 0;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    box-sizing: border-box;
    transition: width 0.28s ease, color 0.2s ease, background-color 0.2s ease;
}

.cancelar img {
    width: 16px;
    flex: 0 0 16px;
    filter: brightness(0) invert(1);
}

.cancelar:hover,
.cancelar:focus-visible {
    width: 152px;
    color: var(--branco);
    font-size: 18px;
    background-color: #b10033;
}

/* ---------------- GUIA DE ETAPAS ---------------- */

main:has(> .etapas) {
    position: static;
    justify-content: center;
    gap: 0;
    padding-top: 95px;
}

main > .etapas{
    position: absolute;
    top: 55px;
    left: 50vw;
    z-index: 20;
    display: flex;
    align-items: flex-start;
    width: min(760px, calc(100vw - 180px));
    min-width: 0;
    height: auto;
    margin-top: 0;
    overflow: visible;
    transform: translateX(-50%);
    background: transparent;
    border: 0;
    border-radius: 0;
}

main > .etapas h3{
    display: none;
}

main > .etapas .etapa{
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 58px;
    padding: 0 8px;
    border: 0;
}

main > .etapas .etapa:not(:last-child)::after{
    position: absolute;
    top: 18px;
    left: calc(50% + 19px);
    width: calc(100% - 38px);
    height: 2px;
    background-color: #c8c7c7;
    content: "";
}

main > .etapas .etapa p{
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #5c5a5a;
}

.etapa span{
    position: relative;
    z-index: 1;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: #D9D9D9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.etapa.ativa{
    background-color: transparent;
}

.etapa.ativa span{
    background-color: var(--vermelho);
    color: var(--branco);
    box-shadow: 0 0 0 7px rgba(210, 0, 60, 0.16);
    animation: etapa-ativa-pulso 1.8s ease-in-out infinite;
}

.etapa.ativa p{
    color: var(--vermelho);
    animation: etapa-ativa-texto 0.35s ease-out both;
}

/* AÃ§Ãµes das etapas de equipe e esteira permanecem alinhadas. */
.botoes-fluxo-selecao {
    position: fixed !important;
    bottom: 65px !important;
    left: 50vw;
    z-index: 100;
    display: flex;
    justify-content: center;
    gap: 15px;
    width: max-content;
    margin: 0 !important;
    padding-bottom: 0 !important;
    transform: translateX(-50%);
}

.botoes-fluxo-selecao > button {
    width: 180px !important;
    height: 60px !important;
    border-radius: 6px;
    font-size: 28px !important;
    touch-action: manipulation;
}

.botoes-fluxo-selecao > button:not(:disabled),
.select-equipe,
.competicao,
.selecao-equipe,
.esteira,
.cancelar {
    transition:
        transform 0.16s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}

.botoes-fluxo-selecao > button:not(:disabled):active,
.select-equipe:active,
.competicao:active,
.selecao-equipe:active,
.esteira:active,
.cancelar:active {
    transform: scale(0.985);
}

@media (hover: hover) {
    .botoes-fluxo-selecao > button:not(:disabled):hover,
    .competicao:hover,
    .selecao-equipe:hover,
    .esteira:not(.esteira-ocupada):hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(15, 0, 105, 0.14);
    }
}

@keyframes etapa-ativa-pulso {
    0%, 100% { box-shadow: 0 0 0 7px rgba(210, 0, 60, 0.16); }
    50% { box-shadow: 0 0 0 11px rgba(210, 0, 60, 0.04); }
}

@keyframes etapa-ativa-texto {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
    main:has(> .etapas) {
        padding-top: 90px;
    }

    main > .etapas {
        width: calc(100vw - 32px);
        overflow-x: auto;
    }

    main > .etapas .etapa {
        min-width: 100px;
    }
}


.selects-equipe{
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.select-equipe{
    width: 650px;
    height: 60px;
    padding: 0 20px;
    font-size: 16px;
    border: 1px solid #999;
    border-radius: 4px;
    cursor: pointer;
}

.select-equipe.ativo{
    background-color: var(--vermelho);
    color: white;
    border: none;
    font-weight: 700;
}

/* ---------------- SELETOR GLOBAL DE TEMA ---------------- */

.tema-toggle {
    position: fixed;
    right: 26px;
    bottom: 26px;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #001e62;
    border-radius: 12px;
    background: #001e62;
    color: #fff;
    box-shadow: 0 8px 20px rgba(0, 30, 98, .24);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s ease, color .2s ease;
}

.tema-toggle:hover,
.tema-toggle:focus-visible {
    transform: translateY(-2px);
    background: #001e62;
    border-color: #001e62;
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 30, 98, .28);
}

.tema-icone {
    flex: 0 0 21px;
    width: 21px;
    height: 21px;
    display: grid;
    place-items: center;
    font-size: 24px;
    line-height: 1;
    text-align: center;
}

.tema-icone svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.tema-icone .icone-lua {
    fill: currentColor;
}

.tema-texto {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

html[data-theme="dark"] .tema-toggle {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #1d1d26;
    border-color: #3d3d4d;
    color: #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .28);
}

html[data-theme="dark"] .tema-toggle:hover,
html[data-theme="dark"] .tema-toggle:focus-visible {
    background: var(--amarelo);
    border-color: var(--amarelo);
    color: #17120a;
}

/* ---------------- PALETA ESCURA GLOBAL ---------------- */

html[data-theme="dark"] body,
html[data-theme="dark"] main,
html[data-theme="dark"] .conteudo {
    background-color: var(--fundo-pagina);
    color: var(--texto-principal);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background-color: var(--fundo-superficie);
    border-color: var(--borda);
    color: var(--texto-principal);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #9292a0;
    opacity: 1;
}

html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] input:-webkit-autofill:hover,
html[data-theme="dark"] input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--texto-principal);
    -webkit-box-shadow: 0 0 0 1000px var(--fundo-superficie) inset;
}

html[data-theme="dark"] main > .etapas {
    background-color: transparent;
    border-color: transparent;
}

html[data-theme="dark"] main > .etapas .etapa {
    border-color: transparent;
}

html[data-theme="dark"] main > .etapas .etapa:not(:last-child)::after {
    background-color: var(--borda);
}

html[data-theme="dark"] main > .etapas .etapa p {
    color: var(--texto-principal);
}

html[data-theme="dark"] main > .etapas .etapa span {
    background-color: #3a3a46;
    color: var(--texto-principal);
}

html[data-theme="dark"] main > .etapas .etapa.ativa {
    background-color: transparent;
}

html[data-theme="dark"] main > .etapas .etapa.ativa span {
    background-color: var(--vermelho);
    color: #fff;
}

html[data-theme="dark"] main > .etapas .etapa.ativa p {
    color: var(--vermelho);
}

html[data-theme="dark"] :is(
    .card,
    .modal,
    .modal-content,
    .modal-conteudo,
    .modal-finalizar-conteudo,
    .modal-checkpoint,
    .modal-editar-conteudo,
    .painel,
    .sidebar,
    .drawer,
    .bloco,
    .container-form,
    .form-container,
    .stats-card,
    .stat-card,
    .stats-barra-acao,
    .team-stat-body,
    .dash-kpi,
    .dash-card,
    .resumo-card,
    .evento-card,
    .equipe-card,
    .equipe-tab-bloco,
    .historico-equipe-bloco,
    .visao-equipe,
    .lista-card,
    .profile-card
) {
    background-color: var(--fundo-superficie);
    border-color: var(--borda);
    color: var(--texto-principal);
    box-shadow: 0 10px 30px var(--sombra);
}

html[data-theme="dark"] table,
html[data-theme="dark"] thead,
html[data-theme="dark"] tbody,
html[data-theme="dark"] tr {
    background-color: transparent;
    color: var(--texto-principal);
    border-color: var(--borda);
}

html[data-theme="dark"] th {
    background-color: var(--fundo-suave);
    color: var(--texto-principal);
}

html[data-theme="dark"] td,
html[data-theme="dark"] hr {
    border-color: var(--borda);
}

html[data-theme="dark"] :is(
    .tabela-checkpoints,
    .lista-equipes,
    .lista-eventos,
    .lista-turnos,
    .bandeja,
    .bandeja-item,
    .perfil-card
) {
    background-color: var(--fundo-superficie);
    border-color: var(--borda);
    color: var(--texto-principal);
}

html[data-theme="dark"] :is(
    tbody tr:hover td,
    .perfil-card.selecionado,
    .bandeja-item.selecionado
) {
    background-color: #341c29;
}

html[data-theme="dark"] :is(
    .modal-subtitulo,
    .texto-secundario,
    .descricao,
    .dash-kpi-sub,
    .dash-kpi-unit
) {
    color: var(--texto-secundario);
}

html[data-theme="dark"] .btn-ver-mais {
    background: var(--fundo-superficie);
    color: var(--texto-principal);
    border-color: var(--borda);
}

html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background-color:#fff"],
html[data-theme="dark"] [style*="background-color: #fff"] {
    background: var(--fundo-superficie) !important;
}

html[data-theme="dark"] [style*="color:#1a1a1a"],
html[data-theme="dark"] [style*="color: #1a1a1a"],
html[data-theme="dark"] [style*="color:#555"],
html[data-theme="dark"] [style*="color: #555"] {
    color: var(--texto-principal) !important;
}

/* MantÃ©m informaÃ§Ãµes auxiliares legÃ­veis sobre superfÃ­cies escuras. */
html[data-theme="dark"] :is(
    label,
    small,
    .texto-secundario,
    .descricao,
    .subtitulo,
    .modal-subtitulo,
    .relacao-horario,
    .grupo-vazio,
    .grupo-contador,
    .card-local,
    .dash-kpi-sub,
    .dash-kpi-unit
) {
    color: var(--texto-secundario) !important;
}

html[data-theme="dark"] :is(input, select, textarea)::placeholder {
    color: #b7b7c3 !important;
}

html[data-theme="dark"] :is(button, a, [role="button"]):disabled {
    color: #aaaab6;
}

@media (max-width: 700px) {
    .tema-toggle {
        right: 14px;
        bottom: 14px;
    }
}

@media (min-width: 901px) and (max-width: 1180px) {
    main {
        max-width: 100vw;
        padding-right: 40px;
        padding-left: 40px;
    }

    main:has(> .etapas) {
        gap: 48px;
        padding-top: 108px;
    }

    main > .etapas {
        width: min(760px, calc(100vw - 96px));
    }

    .conteudo,
    .conteudo-visao,
    .conteudo-stats,
    .conteudo-localidade,
    .conteudo-data-horario,
    .conteudo-equipes-gerente,
    .conteudo-atleta,
    .conteudo-imagem-evento,
    .conteudo-editar,
    .formulario-localidade,
    .formulario-data-horario,
    .formulario-equipes-gerente,
    .formulario-imagem-evento,
    #formAtleta,
    .campo-select,
    .campo-imagem-evento,
    .campo-foto-evento,
    .lista-atletas,
    .lista-agenda {
        width: min(100%, 820px) !important;
        max-width: 100% !important;
    }

    .select-equipe {
        width: min(100%, 760px);
    }

    .botoes-fluxo-selecao {
        bottom: 44px !important;
    }

    body:has(.Bem-vindo) main {
        padding-right: 40px;
        padding-left: 40px;
    }

    body:has(.Bem-vindo) .cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }

    body:has(.Bem-vindo) .card {
        aspect-ratio: 4 / 3;
    }
}

@media (max-width: 900px) {
    html {
        scrollbar-width: auto;
    }

    html::-webkit-scrollbar {
        display: initial;
    }

    body {
        overflow-x: hidden;
    }

    main {
        width: 100%;
        max-width: 100vw;
        min-height: auto;
        height: auto !important;
        margin-top: 28px;
        padding-right: 18px;
        padding-left: 18px;
        overflow-x: hidden;
    }

    body:has(main > .etapas) {
        overflow-y: auto;
    }

    main:has(> .etapas) {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 22px;
        padding-top: 98px;
        padding-bottom: 110px;
    }

    main > .etapas {
        top: 44px;
        width: calc(100vw - 24px);
        padding: 0 4px 8px;
        scrollbar-width: none;
    }

    main > .etapas::-webkit-scrollbar {
        display: none;
    }

    main > .etapas .etapa {
        min-width: 82px;
        padding: 0 4px;
    }

    main > .etapas .etapa p {
        max-width: 80px;
        font-size: 11px;
        line-height: 1.15;
        text-align: center;
        white-space: normal;
    }

    .etapa span {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    main > .etapas .etapa:not(:last-child)::after {
        top: 15px;
        left: calc(50% + 16px);
        width: calc(100% - 32px);
    }

    .conteudo,
    .conteudo-visao,
    .conteudo-stats,
    .conteudo-localidade,
    .conteudo-data-horario,
    .conteudo-equipes-gerente,
    .conteudo-atleta,
    .conteudo-imagem-evento,
    .conteudo-editar,
    .formulario-localidade,
    .formulario-data-horario,
    .formulario-equipes-gerente,
    .formulario-imagem-evento,
    #formAtleta,
    .campo-select,
    .campo-imagem-evento,
    .campo-foto-evento,
    .select-equipe,
    .lista-atletas,
    .lista-agenda,
    .card-resumo {
        width: 100% !important;
        max-width: 100% !important;
    }

    .conteudo,
    .conteudo-visao,
    .conteudo-stats,
    .conteudo-localidade,
    .conteudo-data-horario,
    .conteudo-equipes-gerente,
    .conteudo-atleta,
    .conteudo-imagem-evento,
    .conteudo-editar {
        margin-top: 0 !important;
        margin-left: 0 !important;
        min-width: 0;
    }

    .conteudo h1,
    .conteudo h2,
    .formulario-localidade h1,
    .formulario-data-horario h2,
    .formulario-equipes-gerente h2 {
        width: 100% !important;
        margin-bottom: 22px;
        font-size: clamp(26px, 8vw, 34px) !important;
        line-height: 1.12;
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    input,
    select,
    textarea,
    button {
        max-width: 100%;
    }

    .botoes,
    .botoes-fluxo-selecao,
    .botoes-localidade,
    .botoes-data-horario,
    .botoes-equipes-gerente {
        position: static !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        width: 100% !important;
        margin: 28px 0 0 !important;
        transform: none !important;
    }

    .botoes > button,
    .botoes-fluxo-selecao > button,
    .botoes-localidade > button,
    .botoes-data-horario > button,
    .botoes-equipes-gerente > button,
    .btn-proximo-localidade {
        width: 100% !important;
        height: 52px !important;
        min-height: 52px !important;
        font-size: 18px !important;
        margin: 0 !important;
    }

    .cancelar {
        width: 42px;
        height: 42px;
        margin: 18px 0 0 18px;
        padding: 0 13px;
    }

    .tema-toggle {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 520px) {
    main {
        padding-right: 14px;
        padding-left: 14px;
    }

    .botoes,
    .botoes-fluxo-selecao,
    .botoes-localidade,
    .botoes-data-horario,
    .botoes-equipes-gerente {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    body:has(.Bem-vindo) {
        background-attachment: scroll;
    }

    body:has(.Bem-vindo) header {
        height: 220px;
    }

    body:has(.Bem-vindo) header img {
        width: 132px;
    }

    body:has(.Bem-vindo) main {
        min-height: auto;
        margin: -96px 0 24px;
        padding: 118px 18px 48px;
        border-radius: 24px 24px 0 0;
    }
}

@media (max-width: 1180px) {
    .cancelar,
    .cancelar:hover,
    .cancelar:focus-visible {
        width: 50px;
        color: transparent;
        font-size: 0;
        background-color: var(--vermelho);
    }
}

@media (min-width: 901px) and (max-width: 1180px) {
    main > .etapas {
        left: calc(50% + 38px) !important;
        width: min(680px, calc(100vw - 150px)) !important;
    }
}

@media (max-width: 900px) {
    main > .etapas {
        left: calc(50% + 34px) !important;
        width: min(520px, calc(100vw - 112px)) !important;
        overflow: visible;
    }

    main > .etapas .etapa {
        min-width: 0 !important;
    }

    main > .etapas .etapa p {
        display: none !important;
    }

    .cancelar,
    .cancelar:hover,
    .cancelar:focus-visible {
        width: 42px;
        height: 42px;
        margin: 18px 0 0 18px;
        padding: 0 13px;
        color: transparent;
        font-size: 0;
    }
}

@media (max-width: 900px) {
    body:has(main > .etapas) .cancelar,
    body:has(main > .etapas) .cancelar:hover,
    body:has(main > .etapas) .cancelar:focus-visible {
        position: absolute;
        top: 50px;
        left: 28px;
        z-index: 40;
        display: grid;
        place-items: center;
        width: 34px;
        height: 34px;
        margin: 0;
        padding: 0;
        background-color: var(--vermelho);
        box-shadow: 0 10px 24px rgba(210, 0, 60, 0.22);
    }

    body:has(main > .etapas) .cancelar img {
        display: none;
    }

    body:has(main > .etapas) .cancelar::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 8px;
        height: 8px;
        border-bottom: 2.5px solid var(--branco);
        border-left: 2.5px solid var(--branco);
        border-radius: 1px;
        transform: translate(-35%, -50%) rotate(45deg);
    }

    body:has(main > .etapas) main > .etapas {
        top: 52px;
        left: 50% !important;
        width: min(244px, calc(100vw - 150px)) !important;
        padding: 0;
    }

    body:has(main > .etapas) main > .etapas .etapa {
        align-items: center;
        justify-content: center;
        min-height: 44px;
    }

    body:has(main > .etapas) .etapa span {
        display: grid;
        place-items: center;
        width: 28px;
        height: 28px;
        padding: 0;
        font-size: 13px;
        line-height: 1;
    }

    body:has(main > .etapas) main > .etapas .etapa:not(:last-child)::after {
        top: 50%;
        left: calc(50% + 14px);
        width: calc(100% - 28px);
        transform: translateY(-50%);
    }

    body:has(main > .etapas) .conteudo {
        align-items: center;
        width: 100% !important;
    }

    body:has(main > .etapas) .conteudo > h1,
    body:has(main > .etapas) .conteudo > h2 {
        width: min(100%, 360px) !important;
    }

    body:has(main > .etapas) .botoes-fluxo-selecao {
        position: fixed !important;
        right: auto !important;
        bottom: 24px !important;
        left: 50% !important;
        z-index: 80;
        grid-template-columns: 1fr !important;
        width: min(360px, calc(100vw - 36px)) !important;
        transform: translateX(-50%) !important;
    }

    body:has(main > .etapas) .botoes-fluxo-selecao > button {
        width: 100% !important;
        height: 52px !important;
        margin: 0 !important;
        font-size: 18px !important;
    }

    body:has(main > .etapas) .tema-toggle {
        display: none;
    }

    body:has(.opcoes-equipe) .opcoes-equipe {
        width: min(100%, 360px);
        flex-basis: auto;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    body:has(.opcoes-equipe) .selecao-equipe {
        width: 100%;
        border-radius: 9px;
        background-color: var(--fundo-superficie);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    }

    body:has(.opcoes-equipe) .selecao-topo {
        min-height: 54px;
        padding: 15px 16px;
        font-size: 17px;
    }
}

@media (max-width: 420px) {
    body:has(main > .etapas) main > .etapas {
        width: min(230px, calc(100vw - 132px)) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body,
    .tema-toggle {
        transition: none;
    }
}
