/* "Como isso acontece na prática" (v14) — painel premium com navegação
   manual entre 3 casos (tabs ARIA). Escopo: só os seletores abaixo, todos
   prefixados .dll-hist-*, dentro de #historias.dll-section. Não toca em
   .dll-story-* (classes antigas, já não usadas neste arquivo) nem em
   nenhum outro componente da home. */

#historias {
    --hist-offwhite: #FBF9F5;
    --hist-offwhite-alt: #F2EEE6;
    --hist-navy: #2C3853;
    --hist-vinho: #7E0101;
    --hist-vinho-suave: rgba(126, 1, 1, .16);
    --hist-branco: #FFFFFF;
    background: var(--hist-navy);
}

.dll-hist-painel {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    text-align: left;
    color: var(--hist-navy);
}

/* ---------- navegação (tablist) ---------- */
.dll-hist-tablist {
    display: flex;
    gap: 8px;
    margin: 0 0 18px;
    padding: 6px;
    background: rgba(251, 249, 245, .08);
    border: 1px solid rgba(251, 249, 245, .22);
    border-radius: 14px;
}

.dll-hist-tab {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 14px;
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 10px;
    color: var(--hist-offwhite);
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: .1px;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.dll-hist-tab:hover {
    background: rgba(251, 249, 245, .08);
}

.dll-hist-tab:focus-visible {
    outline: 2px solid var(--hist-offwhite);
    outline-offset: 2px;
}

.dll-hist-tab__indice {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .5px;
    color: rgba(251, 249, 245, .6);
    transition: color .18s ease;
}

.dll-hist-tab[aria-selected="true"] {
    background: rgba(251, 249, 245, .1);
    border-bottom-color: var(--hist-vinho);
    color: var(--hist-branco);
}

.dll-hist-tab[aria-selected="true"] .dll-hist-tab__indice {
    color: #ff8a8a;
}

/* ---------- painel ---------- */
.dll-hist-panels {
    position: relative;
}

.dll-hist-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: 0;
    background: linear-gradient(160deg, var(--hist-offwhite) 0%, var(--hist-offwhite-alt) 100%);
    border: 1px solid var(--hist-vinho-suave);
    border-radius: 20px;
    box-shadow: 0 24px 60px -32px rgba(10, 14, 24, .55);
    overflow: hidden;
    min-height: 380px;
}

.dll-hist-panel + .dll-hist-panel {
    margin-top: 16px;
}

/* Sem JS: os 3 painéis ficam empilhados e visíveis (conteúdo nunca some).
   .dll-hist-painel--js é adicionada só depois que o script liga; a partir
   daí, painéis inativos recebem [hidden] via JS e esta regra deixa de ter
   efeito prático (mas continua correta caso o [hidden] falhe por algum
   motivo). */
.dll-hist-painel--js .dll-hist-panel[hidden] {
    display: none;
}

.dll-hist-painel--js .dll-hist-panel {
    animation: dllHistFade .2s ease both;
}

@keyframes dllHistFade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dll-hist-panel__contexto {
    padding: 34px 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-right: 1px solid rgba(44, 56, 83, .1);
}

.dll-hist-panel__selo {
    align-self: flex-start;
    padding: 5px 12px;
    background: var(--hist-vinho-suave);
    border: 1px solid rgba(126, 1, 1, .35);
    border-radius: 999px;
    color: var(--hist-vinho);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.dll-hist-panel__servico {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: rgba(44, 56, 83, .55);
}

.dll-hist-panel__titulo {
    margin: 0;
    font-size: clamp(21px, 2vw, 26px);
    font-weight: 800;
    line-height: 1.25;
    color: var(--hist-navy);
}

.dll-hist-panel__resumo {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #414d68;
}

.dll-hist-panel__resultado {
    margin: 4px 0 0;
    padding-top: 12px;
    border-top: 1px dashed rgba(44, 56, 83, .18);
    font-size: 14px;
    line-height: 1.6;
    color: var(--hist-navy);
}

.dll-hist-panel__resultado strong {
    color: var(--hist-vinho);
}

.dll-hist-panel__cta {
    align-self: flex-start;
    margin-top: 10px;
    padding: 11px 20px;
    background: var(--hist-vinho);
    color: var(--hist-branco);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .18s ease, transform .18s ease;
}

.dll-hist-panel__cta:hover {
    background: #5e0000;
}

.dll-hist-panel__cta:focus-visible {
    outline: 2px solid var(--hist-navy);
    outline-offset: 3px;
}

/* ---------- fluxo de 3 etapas ---------- */
.dll-hist-fluxo {
    margin: 0;
    padding: 34px 32px 34px 28px;
    list-style: none;
    background: var(--hist-branco);
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.dll-hist-fluxo__item {
    position: relative;
    display: flex;
    gap: 16px;
    padding-left: 4px;
}

.dll-hist-fluxo__item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 23px;
    top: 48px;
    bottom: -22px;
    width: 1px;
    background: rgba(44, 56, 83, .18);
}

.dll-hist-fluxo__marco {
    position: relative;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hist-offwhite);
    border: 1.5px solid rgba(126, 1, 1, .4);
    border-radius: 50%;
    color: var(--hist-vinho);
}

.dll-hist-fluxo__icone {
    display: flex;
    width: 20px;
    height: 20px;
}

.dll-hist-fluxo__icone svg {
    width: 100%;
    height: 100%;
}

.dll-hist-fluxo__num {
    position: absolute;
    top: -9px;
    right: -6px;
    padding: 1px 5px;
    background: var(--hist-navy);
    color: var(--hist-branco);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .3px;
}

.dll-hist-fluxo__corpo {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 4px;
}

.dll-hist-fluxo__titulo {
    font-size: 14px;
    font-weight: 700;
    color: var(--hist-navy);
}

.dll-hist-fluxo__texto {
    font-size: 13px;
    line-height: 1.55;
    color: #4b5570;
}

/* ---------- responsivo ---------- */
@media (max-width: 900px) {
    .dll-hist-panel {
        grid-template-columns: 1fr;
    }
    .dll-hist-panel__contexto {
        border-right: 0;
        border-bottom: 1px solid rgba(44, 56, 83, .1);
    }
}

@media (max-width: 560px) {
    .dll-hist-tablist {
        gap: 6px;
        padding: 5px;
    }
    .dll-hist-tab {
        flex-direction: column;
        gap: 3px;
        padding: 8px 4px;
        font-size: 11px;
        line-height: 1.2;
        text-align: center;
    }
    .dll-hist-tab__indice {
        font-size: 10px;
    }
    .dll-hist-panel__contexto,
    .dll-hist-fluxo {
        padding: 22px 18px;
    }
    .dll-hist-panel {
        min-height: 0;
    }
}

/* ---------- acessibilidade ---------- */
@media (prefers-reduced-motion: reduce) {
    .dll-hist-tab,
    .dll-hist-tab__indice,
    .dll-hist-panel__cta {
        transition: none;
    }
    .dll-hist-painel--js .dll-hist-panel {
        animation: none;
    }
}
