/* =========================================================
   ESTILO BASE
   Este arquivo NÃO define cores. Ele consome as variáveis
   de cor definidas em /temas/*.css (importado separadamente,
   de acordo com o tema escolhido pelo usuário).

   Ordem de import na página:
     1) /temas/<tema-escolhido>.css
     2) estilo-base.css
   ========================================================= */

:root {
    /* Única variável não relacionada a cor, mantida aqui
       para não depender do arquivo de tema. */
    --font-body: 'Satoshi', 'Inter', sans-serif;
}

body {
    background: var(--app-bg);
    color: var(--text-main);
    font-family: var(--font-body);
}

.logo {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2em;
    font-weight: 700;
    color:rgba(251, 191, 36);
}

.logo span {
    color: #379bda;
}

/* Otimizações Mobile para Touch */
.btn {
    min-height: 44px;
    /* Tamanho mínimo de toque */
    border-radius: 12px;
}

.form-control,
.form-select {
    min-height: 44px;
    border-radius: 10px;
}

/* Cards e Calendário Responsivos */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    position: relative;
}

.calendar-day.has-slots {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.calendar-day.selected {
    background: var(--primary) !important;
    color: var(--on-primary) !important;
}

/* Garante que o texto/número interno também herde a cor branca */
.calendar-day.selected span {
    color: var(--on-primary) !important;
}

.sidebar-nav {
    background-color: var(--sidebar-bg);
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
}

/* Aplica a cor também para o ícone dentro do link normal */
.sidebar-nav .nav-link i {
    color: inherit;
}

.sidebar-nav .nav-link.active {
    /* background: rgba(255, 255, 255, 0.494); */
    background: var(--sidebar-active-bg);
    border-radius: 0.25rem;
    color: var(--nav-highlight);
    font-weight: bold;
}

/* Garante que o ícone mude de cor junto com o texto quando estiver ativo */
/* .sidebar-nav .nav-link.active i {
    color: inherit;
} */

.section-card {
    border: 1px solid var(--card-border);
    background: var(--surface);
    border-radius: 1.5rem;
    padding: 2rem;
    margin-bottom: 1rem;
}

.section-title {
    /* display: flex; */
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
}


.section-title h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.section-title p {
    margin: .2rem 0 0;
    color: var(--text-muted);
    font-size: .93rem;
}

.loading {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--loading-overlay);
    z-index: 1100;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(10px);
    background: linear-gradient(135deg,
            var(--header-gradient-1),
            var(--header-gradient-2));
    box-shadow: 0 12px 32px var(--shadow-color);
}

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

/* Layout principal */
.layout-main {
    flex: 1;
    display: flex;
    min-height: 0;
}

/* Sidebar (apenas logado) */
.sidebar-shell {
    min-width: 240px;
    max-width: 360px;
    border-right: 1px solid var(--border-soft);
    box-shadow: 6px 0 24px var(--shadow-color);
}

.sidebar-nav {
    padding: 1.25rem 1rem 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.sidebar-nav li a,
.sidebar-nav li i {
    color: var(--sidebar-li-color);
}

.sidebar-title {
    font-size: .85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--text-muted);
    margin-bottom: .25rem;
}

.nav-vertical {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.nav-vertical a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .75rem;
    border-radius: .9rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: .95rem;
}

.nav-vertical a:hover {
    border-radius: 0.25rem;
    color: var(--nav-highlight);
}

.nav-vertical i {
    width: 1.1rem;
    text-align: center;
    color: var(--text-muted);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: .75rem;
    border-top: 1px dashed var(--sidebar-footer-border);
    font-size: .9rem;
    color: var(--text-muted);
}

/* Conteúdo */
.content-shell {
    flex: 1;
    /* padding: 1rem 1rem; */
    display: flex;
    justify-content: center;
    align-items: stretch;
    max-width: 100vw;
    box-sizing: border-box;
}

.page-inner {
    width: 100%;
    max-width: 92%;
}

/* Card de autenticação reaproveitável */
.auth-card {
    width: 100%;
    max-width: 600px;
    background: var(--shell-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    border-radius: 1.5rem;
    margin-inline: auto;
    padding: 1.5rem;
}

.helper-box {
    text-align: center;
    background: var(--helper-bg);
    border: 1px solid var(--helper-border);
    color: var(--text-muted);
    border-radius: 1rem;
    padding: .9rem 1rem;
    font-size: .93rem;
}

.success-box {
    text-align: center;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: 1rem;
    padding: .9rem 1rem;
    font-size: .93rem;
}

.old_warning-box {
    text-align: center;
    background: var(--warning-bg);
    border-radius: 1rem;
    padding: .9rem 1rem;
    font-size: .93rem;
}

.warning-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--warning-color);
    padding: 1rem 1.05rem;
    border-radius: 18px;
    /* background: rgb(247, 247, 8, 0.1); */
    background: var(--warning-bg);
    border: 1px dashed var(--warning-border);
}

.error-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--error-color);
    padding: 1rem 1.05rem;
    border-radius: 18px;
    background: var(--error-bg);
    border: 1px dashed var(--error-border);
}


/* Inputs e botões (globais) */
.form-label {
    font-weight: 600;
    margin-bottom: .45rem;
}

.form-control {
    min-height: 2.45rem;
    border-radius: 0.5rem;
    border-color: var(--input-border);
    padding-inline: 1rem;
}

.form-control:focus {
    border-color: var(--focus-border);
    box-shadow: 0 0 0 .25rem var(--focus-shadow);
}

.skip-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.05rem;
    border-radius: 18px;
    /* background: #f8fbff; */
    background: var(--skip-bg);
    border: 1px dashed var(--skip-border);
}

.btn {
    min-height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .4rem 1.5rem;
    border-radius: 50px;
    border: 0;
    text-decoration: none;
    /* PARA NÃO FICAR EM DUAS LINHAS */
    white-space: nowrap;
    /* overflow: hidden; */
}

.btn:hover {
    color: var(--btn-hover-color);
}

.btn-primary-soft {
    font-weight: 700;
    color: var(--on-primary);
    background: linear-gradient(135deg, var(--btn-primary-start), var(--btn-primary-end));
}

.btn-secondary-soft {
    font-weight: 700;
    color: var(--on-primary);
    background: linear-gradient(135deg, var(--btn-secondary-start), var(--btn-secondary-end));
}


/* Flash Messages */
#flash-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    /* Acima de tudo */
    width: 90%;
    max-width: 600px;
}

.alert {
    animation: slideDown 0.4s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* fim flash messages */

/* Animação suave para modal mobile */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Rodapé */
.app-footer {
    border-top: 1px solid var(--border-soft);
    padding: .85rem 1rem;
    font-size: .9rem;
    color: var(--text-muted);
    background: var(--footer-bg);
    backdrop-filter: blur(8px);
}

.app-footer .brand {
    font-weight: 600;
    color: var(--text-main);
}

@media (min-width: 992px) {
    .content-shell {
        padding: 1.75rem 2rem 2.5rem;
    }
}

@media (max-width: 991.98px) {
    .sidebar-shell {
        display: none;
    }

    .auth-card {
        max-width: 420px;
    }

    .offcanvas-sidebar {
        width: 260px;
        background: var(--offcanvas-bg);
    }
}

/* ===============================INICIO modal login desktop=========================== */

/* --- PARA TELAS GRANDES (DESKTOP / TABLETS) --- */
@media (min-width: 576px) {
    .modal-bottom-sheet {
        /* Define uma largura elegante e segura para o formulário no desktop */
        max-width: 420px !important;
        margin: 1.75rem auto;
    }

    .modal-bottom-sheet .modal-content {
        /* Bordas arredondadas por completo no desktop */
        border-radius: 16px !important;
    }
}

/* ===============================FIM modal login desktop=========================== */

@media (max-width: 575.98px) {
    .content-shell {
        padding: 1rem 0rem;
        /* justify-content: flex-start; */
    }

    .skip-box {
        display: block;
    }

    .skip-box a {
        margin-top: 1rem;
    }

    .hide-mobile {
        display: none;
    }

    .section-card {
        padding: 1rem;
    }

    /* .btn-primary-soft {
        width: 100%;
    } */

    .auth-card {
        max-width: 100%;
        border-radius: 1.25rem;
    }

    #flash-container {
        top: 64px;
        width: 94%;
    }

    .btn {
        min-height: 2.2rem;
        font-size: 0.8rem;
    }

    .warning-box {
        display: block;
    }

    .error-box {
        display: block;
    }

    .warning-box a {
        margin-top: 1rem;
    }

    /* ===============================modal login=========================== */
    .modal-bottom-sheet {
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0 !important;
        max-width: 100% !important;
        align-items: flex-end;
    }

    .modal-bottom-sheet .modal-content {
        border-radius: 24px 24px 0 0 !important;
        min-height: 320px;
        animation: slideUp 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    }

    /* ===============================FIM modal login=========================== */

}