/* Modal de boas-vindas — visual minimal */

.boas-vindas-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.42);
}

.boas-vindas-overlay[hidden],
.boas-vindas-overlay[aria-hidden="true"] {
    display: none !important;
}

.boas-vindas-modal {
    width: min(480px, 100%);
    max-height: min(86vh, 680px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.16);
    overflow: hidden;
    pointer-events: auto;
}

/* HTML da programação / PDF / imagens precisam de largura de desktop */
.boas-vindas-modal--wide,
.boas-vindas-modal--pdf {
    width: min(1120px, 96vw);
    max-height: min(94vh, 980px);
}

.boas-vindas-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.15rem 1.25rem 0.35rem;
}

.boas-vindas-header h2 {
    margin: 0;
    padding-top: 0.15rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.boas-vindas-close {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #94a3b8;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.boas-vindas-close:hover,
.boas-vindas-close:focus-visible {
    background: #f1f5f9;
    color: #0f172a;
    outline: none;
}

.boas-vindas-body {
    padding: 0.5rem 1.25rem 0.25rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.boas-vindas-media {
    margin: 0 0 0.75rem;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
}

.boas-vindas-media--img img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 240px;
    object-fit: cover;
}

.boas-vindas-media--video {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #0f172a;
}

.boas-vindas-media--video iframe,
.boas-vindas-media--video video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.boas-vindas-pdf-pages {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin: 0;
}

.boas-vindas-pdf-pages img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: #f1f5f9;
}

.boas-vindas-pdf-pages img:not([src]) {
    min-height: 180px;
}

.boas-vindas-pdf-dl {
    margin: 0.65rem 0 0;
    text-align: right;
}

.boas-vindas-pdf-dl a {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e40af;
    text-decoration: none;
}

.boas-vindas-pdf-dl a:hover,
.boas-vindas-pdf-dl a:focus-visible {
    text-decoration: underline;
}

.boas-vindas-html {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.55;
    /* deixa o HTML usar a largura real do modal (não “caixa de celular”) */
    width: 100%;
    max-width: none;
}

.boas-vindas-modal--wide .boas-vindas-body {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.boas-vindas-modal--wide .boas-vindas-html > div {
    max-width: none !important;
}

.boas-vindas-html p:first-child {
    margin-top: 0;
}

.boas-vindas-html p:last-child {
    margin-bottom: 0;
}

.boas-vindas-footer {
    padding: 0.85rem 1.25rem 1.2rem;
    display: flex;
    justify-content: flex-end;
}

.boas-vindas-btn {
    appearance: none;
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: #1e40af;
    cursor: pointer;
}

.boas-vindas-btn:hover,
.boas-vindas-btn:focus-visible {
    background: #1e3a8a;
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.boas-vindas-close:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

body.high-contrast .boas-vindas-modal {
    background: #000 !important;
    border: 2px solid #fbbf24 !important;
}

body.high-contrast .boas-vindas-header h2,
body.high-contrast .boas-vindas-html,
body.high-contrast .boas-vindas-close {
    color: #fff !important;
}

body.high-contrast .boas-vindas-btn {
    background: #fbbf24 !important;
    color: #000 !important;
}

body.high-contrast .boas-vindas-pdf-dl a {
    color: #fbbf24 !important;
}

@media (max-width: 768px) {
    .boas-vindas-overlay {
        padding: 0.75rem;
        align-items: flex-end;
    }

    .boas-vindas-modal,
    .boas-vindas-modal--wide,
    .boas-vindas-modal--pdf {
        width: 100%;
        max-height: 88vh;
        border-radius: 16px 16px 12px 12px;
    }

    .boas-vindas-footer {
        justify-content: stretch;
    }

    .boas-vindas-footer .boas-vindas-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .boas-vindas-header h2 {
        font-size: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .boas-vindas-overlay {
        backdrop-filter: none;
    }
}
