:root {
    --pit-bg-main: #05080D;
    --pit-bg-deep: #020409;
    --pit-bg-panel: #0B1118;
    --pit-bg-card: #101820;
    --pit-bg-card-soft: #151E27;
    --pit-red: #E10600;
    --pit-red-bright: #FF120A;
    --pit-red-dark: #9B0500;
    --pit-red-soft: rgba(225, 6, 0, 0.16);
    --pit-white: #FFFFFF;
    --pit-text-main: #F4F4F4;
    --pit-text-soft: #C7CCD1;
    --pit-text-muted: #8A929A;
    --pit-graphite: #1A1F26;
    --pit-steel: #2A323C;
    --pit-metal: #384654;
    --pit-border: rgba(255, 255, 255, 0.10);
    --pit-border-strong: rgba(255, 255, 255, 0.18);
    --pit-navy: #07111A;
    --pit-ocean: #0D1D27;
    --pit-ocean-soft: #132936;
    --pit-success: #20C46B;
    --pit-warning: #F2A900;
    --pit-danger: #E10600;
    --pit-shadow-heavy: 0 24px 80px rgba(0, 0, 0, 0.50);
    --pit-shadow-red: 0 12px 30px rgba(225, 6, 0, 0.22);
    --pit-radius-lg: 22px;
    --pit-radius-md: 18px;
    --pit-radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--pit-bg-main);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--pit-bg-main);
    color: var(--pit-text-main);
    font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
}

.pit-biblioteca-shell {
    min-height: 100vh;
    padding: 48px;
    background:
        radial-gradient(circle at top left, rgba(225, 6, 0, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(56, 70, 84, 0.22), transparent 34%),
        linear-gradient(135deg, #020409 0%, #07111A 48%, #05080D 100%);
}

.pit-hero,
.pit-secao,
.pit-detalhe {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

.pit-hero {
    min-height: 320px;
    display: grid;
    grid-template-columns: 1.55fr .8fr;
    gap: 28px;
    align-items: stretch;
    padding: 36px;
    border-radius: var(--pit-radius-lg);
    background: linear-gradient(145deg, rgba(16, 24, 32, 0.98), rgba(5, 8, 13, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: var(--pit-shadow-heavy), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    position: relative;
    overflow: hidden;
}

.pit-hero::before,
.pit-secao::before,
.pit-detalhe::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(225, 6, 0, 0.12), transparent 22%),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 24%);
    opacity: 0.75;
}

.pit-hero > *,
.pit-secao > *,
.pit-detalhe > * {
    position: relative;
    z-index: 1;
}

.pit-eyebrow,
.pit-meta {
    color: var(--pit-red);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 12px;
    font-weight: 800;
}

.pit-hero h1 {
    color: var(--pit-white);
    font-size: clamp(38px, 5vw, 72px);
    line-height: .95;
    margin: 14px 0 18px;
    font-weight: 900;
    letter-spacing: -0.055em;
}

.pit-hero p {
    color: var(--pit-text-soft);
    font-size: 18px;
    line-height: 1.7;
    max-width: 820px;
    margin: 0;
}

.pit-hero-panel {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 28px;
    border-radius: var(--pit-radius-md);
    background: linear-gradient(145deg, rgba(21, 30, 39, 0.96), rgba(10, 16, 22, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid rgba(225, 6, 0, 0.75);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.pit-hero-panel strong {
    color: var(--pit-white);
    font-size: 28px;
    font-weight: 900;
    line-height: 1.08;
}

.pit-hero-panel span {
    color: var(--pit-text-muted);
    margin-top: 10px;
    line-height: 1.55;
}

.pit-filtros {
    max-width: 1180px;
    margin: 28px auto;
    display: grid;
    grid-template-columns: 1fr 220px 180px 130px;
    gap: 12px;
}

.pit-filtros input,
.pit-filtros select,
.pit-filtros button {
    min-height: 52px;
    border-radius: 999px;
    padding: 0 18px;
    color: var(--pit-text-main);
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid var(--pit-border);
    outline: none;
    font-family: inherit;
    font-weight: 700;
}

.pit-filtros input::placeholder {
    color: var(--pit-text-muted);
}

.pit-filtros button,
.pit-detalhe-actions button,
.pit-material a {
    background: linear-gradient(135deg, var(--pit-red), var(--pit-red-dark));
    color: var(--pit-white);
    border: 1px solid rgba(225, 6, 0, 0.75);
    box-shadow: var(--pit-shadow-red), inset 0 1px 0 rgba(255, 255, 255, 0.20);
    font-weight: 850;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    transition: .2s ease;
}

.pit-filtros button:hover,
.pit-detalhe-actions button:hover,
.pit-material a:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--pit-red-bright), #B80600);
}

.pit-btn-secondary {
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--pit-text-main) !important;
    border: 1px solid var(--pit-border) !important;
    box-shadow: none !important;
}

.pit-btn-secondary:hover {
    border-color: rgba(225, 6, 0, 0.55) !important;
    background: rgba(225, 6, 0, 0.08) !important;
}

.pit-secao {
    margin-top: 34px;
    padding: 28px;
    border-radius: var(--pit-radius-lg);
    background: linear-gradient(145deg, rgba(11, 17, 24, 0.76), rgba(5, 8, 13, 0.70));
    border: 1px solid rgba(255, 255, 255, 0.07);
    position: relative;
    overflow: hidden;
}

.pit-secao-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    margin-bottom: 18px;
}

.pit-secao-header h2 {
    color: var(--pit-white);
    margin: 0;
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.pit-secao-header h2::before {
    content: "";
    display: inline-block;
    width: 22px;
    height: 3px;
    background: var(--pit-red);
    margin-right: 10px;
    vertical-align: middle;
    border-radius: 999px;
}

.pit-secao-header span {
    color: var(--pit-text-muted);
    font-weight: 650;
}

.pit-carousel {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 310px);
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: thin;
}

.pit-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}

.pit-card,
.pit-trilha-card,
.pit-material,
.pit-questao,
.pit-empty {
    background: linear-gradient(145deg, rgba(21, 30, 39, 0.96), rgba(10, 16, 22, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid rgba(225, 6, 0, 0.65);
    border-radius: var(--pit-radius-md);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.pit-card {
    min-height: 350px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.pit-card:hover {
    transform: translateY(-5px);
    border-color: rgba(225, 6, 0, 0.72);
    background: linear-gradient(145deg, rgba(225, 6, 0, 0.10), rgba(10, 16, 22, 0.96));
}

.pit-thumb {
    height: 160px;
    background-size: cover;
    background-position: center;
    position: relative;
    background-color: var(--pit-ocean);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pit-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(225, 6, 0, 0.14);
    color: var(--pit-white);
    border: 1px solid rgba(225, 6, 0, 0.55);
    font-weight: 850;
    font-size: 12px;
    margin: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pit-badge-hot {
    color: var(--pit-white);
    background: linear-gradient(135deg, var(--pit-red-bright), var(--pit-red-dark));
    border-color: rgba(255, 255, 255, 0.18);
}

.pit-card-body {
    padding: 18px;
}

.pit-card-body h3 {
    min-height: 52px;
    margin: 9px 0;
    color: var(--pit-white);
    font-size: 20px;
    line-height: 1.18;
    font-weight: 900;
    letter-spacing: -0.025em;
}

.pit-card-body p {
    color: var(--pit-text-muted);
    font-size: 14px;
    min-height: 42px;
    line-height: 1.45;
}

.pit-card-footer {
    display: flex;
    justify-content: space-between;
    color: var(--pit-text-muted);
    font-size: 13px;
    margin-top: 10px;
    font-weight: 700;
}

.pit-progress {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.pit-progress-large {
    height: 12px;
    margin: 22px 0;
}

.pit-progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--pit-red-dark), var(--pit-red), var(--pit-white));
}

.pit-trilhas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.pit-trilha-card {
    padding: 24px;
}

.pit-trilha-card h3 {
    color: var(--pit-white);
    font-size: 24px;
    margin: 8px 0;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.pit-trilha-card p {
    color: var(--pit-text-muted);
    line-height: 1.55;
}

.pit-modulos {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.pit-modulos button {
    text-align: left;
    border: 1px solid var(--pit-border);
    border-radius: var(--pit-radius-sm);
    padding: 14px;
    color: var(--pit-text-main);
    background: rgba(255, 255, 255, 0.045);
    cursor: pointer;
    font-family: inherit;
    font-weight: 850;
    transition: .2s ease;
}

.pit-modulos button:hover {
    border-color: rgba(225, 6, 0, 0.55);
    background: rgba(225, 6, 0, 0.08);
    transform: translateY(-1px);
}

.pit-modulos small {
    display: block;
    color: var(--pit-text-muted);
    margin-top: 4px;
    font-weight: 650;
}

.pit-hidden {
    display: none;
}

.pit-empty {
    padding: 24px;
    color: var(--pit-text-muted);
    border-style: dashed;
    text-align: center;
}

.pit-detalhe {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    gap: 28px;
    align-items: stretch;
    padding: 28px;
    border-radius: var(--pit-radius-lg);
    background: linear-gradient(145deg, rgba(16, 24, 32, 0.98), rgba(5, 8, 13, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: var(--pit-shadow-heavy), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    position: relative;
    overflow: hidden;
}

.pit-detalhe-cover {
    min-height: 420px;
    border-radius: var(--pit-radius-md);
    background-size: cover;
    background-position: center;
    background-color: var(--pit-ocean);
    border: 1px solid rgba(255,255,255,.08);
}

.pit-detalhe-info {
    padding: 12px;
}

.pit-detalhe-info h1 {
    color: var(--pit-white);
    font-size: clamp(34px, 4vw, 60px);
    line-height: 1;
    margin: 12px 0 18px;
    font-weight: 900;
    letter-spacing: -0.055em;
}

.pit-detalhe-info p {
    color: var(--pit-text-soft);
    font-size: 18px;
    line-height: 1.7;
}

.pit-detalhe-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pit-detalhe-actions button {
    min-height: 52px;
    border-radius: 999px;
    padding: 0 22px;
    font-family: inherit;
}

.pit-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.pit-info-grid span {
    border: 1px solid var(--pit-border);
    border-radius: var(--pit-radius-sm);
    padding: 16px;
    background: rgba(255,255,255,.045);
    color: var(--pit-text-soft);
}

.pit-info-grid strong {
    color: var(--pit-white);
}

.pit-material-list,
.pit-questoes {
    display: grid;
    gap: 14px;
}

.pit-material {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 18px;
}

.pit-material h3,
.pit-questao h3 {
    color: var(--pit-white);
    margin: 8px 0;
    font-weight: 900;
}

.pit-material p,
.pit-questao p {
    color: var(--pit-text-muted);
    margin-bottom: 0;
}

.pit-material a {
    text-decoration: none;
    border-radius: 999px;
    padding: 13px 18px;
    white-space: nowrap;
}

.pit-questao {
    padding: 20px;
}

.pit-questao ol {
    color: var(--pit-text-soft);
    display: grid;
    gap: 8px;
    line-height: 1.5;
}

.pit-questao summary {
    cursor: pointer;
    color: var(--pit-red);
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--pit-bg-deep);
}

::-webkit-scrollbar-thumb {
    background: var(--pit-steel);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--pit-metal);
}

@media (max-width: 1100px) {
    .pit-hero,
    .pit-detalhe {
        grid-template-columns: 1fr;
    }

    .pit-filtros {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .pit-biblioteca-shell {
        padding: 24px;
    }

    .pit-hero,
    .pit-secao,
    .pit-detalhe {
        padding: 28px;
        border-radius: 18px;
    }

    .pit-hero h1,
    .pit-detalhe-info h1 {
        font-size: 34px;
    }
}

@media (max-width: 640px) {
    .pit-biblioteca-shell {
        padding: 16px;
    }

    .pit-filtros {
        grid-template-columns: 1fr;
    }

    .pit-info-grid {
        grid-template-columns: 1fr;
    }

    .pit-hero,
    .pit-secao,
    .pit-detalhe {
        padding: 22px;
    }

    .pit-material {
        align-items: stretch;
        flex-direction: column;
    }

    .pit-material a,
    .pit-detalhe-actions button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}