/* Practice Exams — módulos / blocos (seleção e exibição) */
:root {
    --pe-primary: #5624d0;
    --pe-primary-dark: #3f1a9e;
    --pe-accent: #7c4dff;
    --pe-border: #e2e5ec;
    --pe-muted: #6a6f73;
    --pe-ink: #1c1d1f;
}

/* Painel de seleção (setup) */
.pe-blocks-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(86, 36, 208, 0.35) transparent;
}
.pe-blocks-panel::-webkit-scrollbar { width: 6px; }
.pe-blocks-panel::-webkit-scrollbar-thumb {
    background: rgba(86, 36, 208, 0.28);
    border-radius: 999px;
}

.pe-block-row {
    --blk-accent: #5624d0;
    --blk-accent-soft: #7c4dff;
    --blk-bg: #faf8ff;
    --blk-border: rgba(86, 36, 208, 0.18);
    --blk-shadow: rgba(86, 36, 208, 0.12);

    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px 12px 16px;
    border-radius: 14px;
    border: 1.5px solid var(--blk-border);
    background: linear-gradient(135deg, #fff 0%, var(--blk-bg) 100%);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s, background 0.18s;
    overflow: hidden;
}
.pe-block-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--blk-accent-soft), var(--blk-accent));
    border-radius: 14px 0 0 14px;
    opacity: 0.85;
    transition: width 0.18s, opacity 0.18s;
}
.pe-block-row:hover {
    border-color: var(--blk-accent);
    box-shadow: 0 6px 20px var(--blk-shadow);
    transform: translateY(-1px);
}
.pe-block-row:hover::before { width: 5px; opacity: 1; }

.pe-block-row input[type="checkbox"] {
    position: relative;
    z-index: 1;
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--blk-accent);
    cursor: pointer;
}

.pe-block-chip-num {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--blk-accent-soft), var(--blk-accent));
    box-shadow: 0 4px 12px var(--blk-shadow);
}

.pe-block-info {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}
.pe-block-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--pe-ink, #1c1d1f);
    line-height: 1.35;
}

.pe-block-count {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--blk-accent);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--blk-border);
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.pe-block-row:has(input:checked) {
    border-color: var(--blk-accent);
    background: linear-gradient(135deg, var(--blk-bg) 0%, #fff 100%);
    box-shadow: 0 8px 24px var(--blk-shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.pe-block-row:has(input:checked)::before { width: 6px; opacity: 1; }
.pe-block-row:has(input:checked) .pe-block-count {
    background: var(--blk-accent);
    color: #fff;
    border-color: transparent;
}

/* Paleta harmoniosa — 8 tons distintos e coesos */
.pe-block-tone-1 { --blk-accent: #5624d0; --blk-accent-soft: #7c4dff; --blk-bg: #f6f2ff; --blk-border: rgba(86, 36, 208, 0.22); --blk-shadow: rgba(86, 36, 208, 0.16); }
.pe-block-tone-2 { --blk-accent: #4338ca; --blk-accent-soft: #6366f1; --blk-bg: #eef2ff; --blk-border: rgba(67, 56, 202, 0.22); --blk-shadow: rgba(67, 56, 202, 0.16); }
.pe-block-tone-3 { --blk-accent: #0d9488; --blk-accent-soft: #14b8a6; --blk-bg: #ecfdf5; --blk-border: rgba(13, 148, 136, 0.22); --blk-shadow: rgba(13, 148, 136, 0.16); }
.pe-block-tone-4 { --blk-accent: #0369a1; --blk-accent-soft: #0ea5e9; --blk-bg: #f0f9ff; --blk-border: rgba(3, 105, 161, 0.22); --blk-shadow: rgba(3, 105, 161, 0.16); }
.pe-block-tone-5 { --blk-accent: #7c3aed; --blk-accent-soft: #a78bfa; --blk-bg: #f5f3ff; --blk-border: rgba(124, 58, 237, 0.22); --blk-shadow: rgba(124, 58, 237, 0.16); }
.pe-block-tone-6 { --blk-accent: #0891b2; --blk-accent-soft: #22d3ee; --blk-bg: #ecfeff; --blk-border: rgba(8, 145, 178, 0.22); --blk-shadow: rgba(8, 145, 178, 0.16); }
.pe-block-tone-7 { --blk-accent: #059669; --blk-accent-soft: #34d399; --blk-bg: #ecfdf5; --blk-border: rgba(5, 150, 105, 0.22); --blk-shadow: rgba(5, 150, 105, 0.16); }
.pe-block-tone-8 { --blk-accent: #be185d; --blk-accent-soft: #f472b6; --blk-bg: #fdf2f8; --blk-border: rgba(190, 24, 93, 0.2); --blk-shadow: rgba(190, 24, 93, 0.14); }

.pe-blocks-hint {
    font-size: 13px;
    color: var(--pe-muted, #6a6f73);
    margin: 0 0 10px;
    line-height: 1.5;
}

.pe-blocks-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.pe-blocks-actions button {
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--pe-border, #e2e5ec);
    background: #fff;
    color: var(--pe-muted, #6a6f73);
    cursor: pointer;
    transition: all 0.15s;
}
.pe-blocks-actions button:hover,
.pe-blocks-actions button:focus {
    border-color: var(--pe-primary, #5624d0);
    color: var(--pe-primary, #5624d0);
    background: #f6f2ff;
    outline: none;
}
.pe-blocks-actions .pe-blocks-action-primary {
    border-color: rgba(86, 36, 208, 0.35);
    color: var(--pe-primary, #5624d0);
    background: linear-gradient(135deg, #faf8ff, #f3f0ff);
}

/* Chip de módulo (briefing) */
.pe-block-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 0;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #3f1a9e;
    background: linear-gradient(135deg, #f6f2ff, #ede9fe);
    border: 1.5px solid rgba(86, 36, 208, 0.2);
    box-shadow: 0 4px 14px rgba(86, 36, 208, 0.1);
}
.pe-block-badge i {
    font-size: 18px;
    color: var(--pe-primary, #5624d0);
}

/* Grid de módulos (página de detalhes) */
.pe-blocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
@media (max-width: 575px) {
    .pe-blocks-grid { grid-template-columns: 1fr; }
}

.pe-block-card {
    --blk-accent: #5624d0;
    --blk-accent-soft: #7c4dff;
    --blk-bg: #faf8ff;
    --blk-border: rgba(86, 36, 208, 0.18);
    --blk-shadow: rgba(86, 36, 208, 0.12);

    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 18px 16px;
    border-radius: 16px;
    border: 1.5px solid var(--blk-border);
    background: linear-gradient(160deg, #fff 0%, var(--blk-bg) 100%);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    text-decoration: none !important;
    color: inherit !important;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    overflow: hidden;
    min-height: 100%;
}
.pe-block-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--blk-accent-soft), var(--blk-accent));
}
.pe-block-card:hover {
    border-color: var(--blk-accent);
    box-shadow: 0 12px 32px var(--blk-shadow);
    transform: translateY(-3px);
}
.pe-block-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-left: 6px;
}
.pe-block-card-num {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--blk-accent-soft), var(--blk-accent));
    box-shadow: 0 4px 14px var(--blk-shadow);
}
.pe-block-card-title {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
    color: var(--pe-ink, #1c1d1f);
    margin: 0;
}
.pe-block-card-desc {
    font-size: 13px;
    line-height: 1.55;
    color: var(--pe-muted, #6a6f73);
    margin: 0;
    padding-left: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pe-block-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-left: 6px;
    margin-top: auto;
}
.pe-block-card-stat {
    font-size: 12px;
    font-weight: 700;
    color: var(--blk-accent);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--blk-border);
    padding: 4px 10px;
    border-radius: 999px;
}
.pe-block-card-cta {
    margin-left: auto;
    font-size: 12px;
    font-weight: 800;
    color: var(--blk-accent);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pe-block-card:hover .pe-block-card-cta { text-decoration: underline !important; }

.pe-block-card--static {
    cursor: default;
}
.pe-block-card--static:hover {
    transform: none;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.pe-pdp-blocks-intro {
    font-size: 15px;
    line-height: 1.6;
    color: var(--muted, #6a6f73);
    margin: 0 0 18px;
    max-width: 640px;
}

@media (max-width: 575px) {
    .pe-block-row {
        flex-wrap: wrap;
        padding: 12px 12px 12px 14px;
    }
    .pe-block-count {
        margin-left: 46px;
    }
}
