:root {
    --navy-950: #06183f;
    --navy-900: #08245b;
    --navy-850: #0a2d69;
    --navy-800: #0b377e;
    --blue-650: #135fba;
    --blue-600: #1769c2;
    --blue-100: #eaf3ff;
    --blue-050: #f5f9ff;
    --green-650: #0f7656;
    --green-600: #15805d;
    --green-100: #e8f6f0;
    --orange-500: #f5a400;
    --orange-100: #fff2cc;
    --ink-950: #152238;
    --ink-800: #283a56;
    --muted: #617086;
    --muted-2: #7b889a;
    --line: #dce4ee;
    --line-strong: #cbd6e4;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --background: #f3f6fa;
    --danger: #c93636;
    --radius-sm: .6rem;
    --radius-md: .9rem;
    --radius-lg: 1.25rem;
    --radius-xl: 1.65rem;
    --shadow-sm: 0 6px 20px rgba(6, 27, 69, .07);
    --shadow-md: 0 16px 44px rgba(6, 27, 69, .12);
    --shadow-lg: 0 28px 72px rgba(6, 27, 69, .17);
    --content: 1180px;
    --content-wide: 1480px;
    --focus: #ffcf5a;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink-950);
    background:
        radial-gradient(circle at 93% 5%, rgba(23, 105, 194, .075), transparent 30rem),
        linear-gradient(180deg, #f8fafc 0, var(--background) 55%, #f4f7fb 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.is-modal-open {
    overflow: hidden;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
    font: inherit;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    left: 1rem;
    top: -5rem;
    z-index: 2000;
    padding: .8rem 1rem;
    color: #fff;
    background: var(--navy-950);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    font-weight: 750;
}

.skip-link:focus {
    top: 1rem;
}

/* =========================================================
   CABEÇALHO / NAVEGAÇÃO — compartilhado por todas as páginas
   ========================================================= */
.site-header {
    position: relative;
    z-index: 50;
    width: 100%;
    background: rgba(255, 255, 255, .95);
    border-bottom: 1px solid rgba(203, 214, 228, .9);
    box-shadow: 0 4px 18px rgba(6, 27, 69, .045);
    backdrop-filter: blur(12px);
}

.site-header__inner {
    width: min(var(--content), calc(100% - 2rem));
    min-height: 78px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.4rem;
}

.site-header--wide .site-header__inner {
    width: min(var(--content-wide), calc(100% - 2rem));
}

.site-brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    text-decoration: none;
}

.site-brand img {
    width: 172px;
    height: auto;
    display: block;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .3rem;
    flex-wrap: wrap;
}

.site-nav a {
    position: relative;
    padding: .64rem .78rem;
    color: var(--ink-800);
    border-radius: .55rem;
    text-decoration: none;
    font-size: .84rem;
    font-weight: 720;
    transition: color .18s ease, background .18s ease;
}

.site-nav a:hover {
    color: var(--navy-900);
    background: #eef4fb;
}

.site-nav a[aria-current="page"] {
    color: var(--navy-900);
    background: var(--blue-100);
}

.site-nav__cta {
    margin-left: .25rem;
    color: #fff !important;
    background: var(--navy-900) !important;
    box-shadow: 0 5px 16px rgba(8, 36, 91, .18);
}

.site-nav__cta:hover {
    background: var(--navy-800) !important;
}

/* =========================================================
   COMPONENTES COMPARTILHADOS
   ========================================================= */
.page-shell {
    width: min(var(--content), calc(100% - 2rem));
    margin: 0 auto;
}

.page-shell--wide {
    width: min(var(--content-wide), calc(100% - 2rem));
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-bottom: 1rem;
    color: #ffd470;
    font-size: .76rem;
    font-weight: 850;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.button-row {
    display: flex;
    align-items: center;
    gap: .7rem;
    flex-wrap: wrap;
}

.button {
    min-height: 3.35rem;
    padding: .82rem 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .8rem;
    border: 1px solid transparent;
    border-radius: .78rem;
    font-weight: 820;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease,
        border-color .18s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button--primary {
    color: var(--navy-950);
    background: var(--orange-500);
    box-shadow: 0 11px 28px rgba(245, 164, 0, .2);
}

.button--primary:hover {
    background: #ffb719;
    box-shadow: 0 15px 34px rgba(245, 164, 0, .26);
}

.button--secondary {
    color: #fff;
    background: rgba(255, 255, 255, .09);
    border-color: rgba(255, 255, 255, .32);
}

.button--secondary:hover {
    background: rgba(255, 255, 255, .16);
}

.button.is-loading {
    opacity: .72;
    pointer-events: none;
}

.site-footer {
    width: min(var(--content), calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.15rem 0 1.6rem;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: .78rem;
}

.site-footer--wide {
    width: min(var(--content-wide), calc(100% - 2rem));
}

.site-footer p {
    margin: 0;
}

.site-footer nav {
    display: flex;
    gap: .95rem;
    flex-wrap: wrap;
}

.site-footer a {
    color: var(--navy-800);
    text-decoration: none;
    font-weight: 700;
}

.site-footer a:hover {
    text-decoration: underline;
    text-underline-offset: .2rem;
}

/* =========================================================
   PÁGINA INICIAL
   ========================================================= */
.page-home {
    display: flex;
    flex-direction: column;
}

.page-home .page-shell {
    flex: 1;
    padding-top: clamp(1rem, 2.5vw, 2rem);
}

.hero {
    position: relative;
    overflow: hidden;
    min-height: 570px;
    padding: clamp(2rem, 5.4vw, 4.8rem);
    color: #fff;
    background:
        linear-gradient(128deg, rgba(6, 24, 63, .98), rgba(11, 55, 126, .96)),
        var(--navy-950);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 4.5rem);
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.hero::before {
    width: 34rem;
    height: 34rem;
    right: -19rem;
    top: -22rem;
    border: 5.5rem solid rgba(255, 255, 255, .045);
}

.hero::after {
    width: 22rem;
    height: 22rem;
    left: -15rem;
    bottom: -16rem;
    border: 4rem solid rgba(23, 105, 194, .12);
}

.hero-copy,
.access-card {
    position: relative;
    z-index: 1;
}

.hero h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(2.2rem, 5vw, 4.3rem);
    line-height: 1.02;
    letter-spacing: -.045em;
}

.hero .lead {
    max-width: 680px;
    margin: 1.45rem 0 1.8rem;
    color: rgba(255, 255, 255, .82);
    font-size: clamp(1rem, 1.45vw, 1.16rem);
    line-height: 1.72;
}

.hero-actions {
    display: grid;
    gap: .9rem;
    width: min(100%, 630px);
}

.hero-actions__item {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-actions .button {
    min-width: 275px;
}

.button-help {
    flex: 1 1 220px;
    margin: 0;
    color: rgba(255, 255, 255, .62);
    font-size: .8rem;
    line-height: 1.45;
}

.access-card {
    padding: clamp(1.4rem, 3vw, 2rem);
    color: var(--ink-950);
    background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 1.15rem;
    box-shadow: 0 20px 48px rgba(0, 0, 0, .16);
}

.card-icon {
    width: 2.8rem;
    height: 2.8rem;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--green-600);
    border-radius: 50%;
    box-shadow: 0 7px 16px rgba(21, 128, 93, .2);
    font-size: 1.15rem;
    font-weight: 900;
}

.access-card h2 {
    margin: 1rem 0 .85rem;
    color: var(--navy-900);
    font-size: 1.42rem;
}

.access-card ol {
    margin: 0;
    padding-left: 1.3rem;
    color: var(--muted);
    line-height: 1.66;
}

.access-card li + li {
    margin-top: .58rem;
}

.domains {
    margin-top: 1.35rem;
    display: flex;
    flex-wrap: wrap;
    gap: .42rem;
}

.domains span {
    padding: .4rem .58rem;
    color: var(--navy-800);
    background: #edf4ff;
    border: 1px solid #cfe0f6;
    border-radius: .48rem;
    font-size: .69rem;
    font-weight: 850;
}

.support-strip {
    margin: 1.25rem 0 1.55rem;
    padding: 1.25rem 1.4rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.support-strip strong {
    color: var(--navy-900);
}

.support-strip p {
    margin: .28rem 0 0;
    color: var(--muted);
    font-size: .9rem;
}

.support-strip a {
    flex: 0 0 auto;
    padding: .72rem .95rem;
    color: var(--blue-600);
    background: var(--blue-050);
    border: 1px solid #d7e6f8;
    border-radius: .65rem;
    font-size: .86rem;
    font-weight: 820;
    text-decoration: none;
}

.support-strip a:hover {
    background: #edf5ff;
}

/* =========================================================
   PÁGINA DO FLUXO
   ========================================================= */
.page-flow {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-flow .site-header {
    position: sticky;
    top: 0;
}

.flow-main {
    flex: 1;
    padding: 1.5rem 0 2rem;
}

.flow-hero {
    margin-bottom: 1rem;
    padding: 1.25rem 1.35rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(135deg, #fff, #f7faff);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.flow-hero h1 {
    margin: 0;
    color: var(--navy-950);
    font-size: clamp(1.5rem, 2.6vw, 2.35rem);
    letter-spacing: -.025em;
}

.flow-hero p {
    max-width: 850px;
    margin: .45rem 0 0;
    color: var(--muted);
    line-height: 1.58;
}

.flow-help {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem .7rem;
    color: var(--navy-800);
    background: var(--blue-100);
    border: 1px solid #d5e5fa;
    border-radius: .6rem;
    font-size: .79rem;
    font-weight: 760;
}

.viewer {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.viewer-head {
    min-height: 62px;
    padding: .75rem .9rem .75rem 1.15rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
}

.viewer-title {
    display: grid;
    gap: .12rem;
}

.viewer-title strong {
    color: var(--navy-900);
    font-size: .95rem;
}

.viewer-title span {
    color: var(--muted);
    font-size: .77rem;
}

.viewer-actions {
    display: flex;
    gap: .45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tool-button {
    min-height: 2.45rem;
    padding: .5rem .7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    color: var(--navy-800);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: .58rem;
    cursor: pointer;
    text-decoration: none;
    font-size: .78rem;
    font-weight: 790;
    transition: border-color .18s ease, color .18s ease, background .18s ease,
        transform .18s ease;
}

.tool-button:hover {
    color: var(--navy-950);
    background: var(--blue-050);
    border-color: #b7cae2;
    transform: translateY(-1px);
}

.tool-button--dark {
    color: #fff;
    background: var(--navy-900);
    border-color: var(--navy-900);
}

.tool-button--dark:hover {
    color: #fff;
    background: var(--navy-800);
}

.image-wrap {
    padding: clamp(.7rem, 2vw, 1.35rem);
    text-align: center;
    overflow: auto;
    background:
        linear-gradient(#fff, #fff) padding-box,
        repeating-linear-gradient(45deg, #fafbfd 0, #fafbfd 8px, #f7f9fc 8px, #f7f9fc 16px) border-box;
}

#fluxo {
    display: block;
    width: min(100%, 1120px);
    height: auto;
    margin: 0 auto;
    background: #fff;
    border-radius: .45rem;
    box-shadow: 0 4px 20px rgba(6, 27, 69, .055);
    cursor: zoom-in;
    image-rendering: auto;
}

.viewer-caption {
    padding: .8rem 1rem;
    color: var(--muted);
    background: #fbfcfe;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: .78rem;
}

/* Lightbox do fluxograma */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    color: #fff;
    background: rgba(3, 10, 25, .965);
}

.lightbox.open {
    display: block;
}

.lb-toolbar {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    min-height: 62px;
    padding: .55rem .7rem .55rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .8rem;
    background: rgba(7, 25, 62, .96);
    border-bottom: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
    z-index: 2;
}

.lb-title {
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-weight: 790;
    font-size: .9rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.lb-actions {
    display: flex;
    gap: .38rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.lb-actions .tool-button {
    color: #fff;
    background: rgba(255, 255, 255, .09);
    border-color: rgba(255, 255, 255, .22);
}

.lb-actions .tool-button:hover {
    background: rgba(255, 255, 255, .16);
}

.lb-stage {
    position: absolute;
    inset: 62px 0 0;
    overflow: auto;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    touch-action: pan-x pan-y;
}

#fluxoZoom {
    display: block;
    max-width: none;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    box-shadow: 0 12px 42px rgba(0, 0, 0, .52);
}

/* =========================================================
   PÁGINA DE MEMORIAIS
   ========================================================= */
.page-memorials {
    width: 100%;
    min-height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #eef2f7;
}

.page-memorials .site-header {
    flex: 0 0 auto;
}

.report-header-note {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 650;
}

.report-main {
    width: 100%;
    min-width: 0;
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.report-shell {
    width: 100%;
    min-width: 0;
    min-height: 0;
    flex: 1;
    overflow: hidden;
    background: #fff;
    border-top: 1px solid var(--line);
}

.report-shell iframe {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: block;
    border: 0;
    background: #fff;
}

/* =========================================================
   RESPONSIVIDADE
   ========================================================= */
@media (max-width: 920px) {
    .site-header__inner {
        min-height: 70px;
    }

    .site-nav a:not(.site-nav__cta) {
        display: none;
    }

    .hero {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .access-card {
        max-width: 690px;
    }

    .flow-hero {
        flex-direction: column;
    }

    .flow-help {
        align-self: flex-start;
    }
}

@media (max-width: 650px) {
    .site-header__inner,
    .page-shell,
    .site-footer,
    .site-header--wide .site-header__inner,
    .page-shell--wide,
    .site-footer--wide {
        width: min(100% - 1rem, var(--content));
    }

    .site-header__inner {
        min-height: 64px;
    }

    .site-brand img {
        width: 142px;
    }

    .site-nav__cta {
        padding: .58rem .68rem !important;
        font-size: .76rem !important;
    }

    .page-home .page-shell {
        padding-top: .5rem;
    }

    .hero {
        padding: 1.45rem;
        border-radius: 1rem;
    }

    .hero h1 {
        font-size: clamp(2rem, 11.5vw, 3rem);
    }

    .hero-actions__item {
        display: grid;
        gap: .42rem;
    }

    .hero-actions .button {
        width: 100%;
        min-width: 0;
    }

    .button-help {
        flex: none;
    }

    .support-strip {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: .8rem;
    }

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .flow-main {
        padding: .6rem 0 1rem;
    }

    .flow-hero,
    .viewer {
        border-radius: .85rem;
    }

    .flow-hero {
        padding: 1rem;
    }

    .viewer-head {
        align-items: flex-start;
        flex-direction: column;
        padding: .8rem;
    }

    .viewer-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .tool-button .txt {
        display: none;
    }

    .image-wrap {
        padding: .35rem;
    }

    #fluxo {
        width: 100%;
        border-radius: .3rem;
    }

    .lb-toolbar {
        align-items: flex-start;
        min-height: 66px;
    }

    .lb-title {
        max-width: 36vw;
        padding-top: .5rem;
    }

    .lb-stage {
        inset: 66px 0 0;
        padding: .75rem;
    }

    .page-memorials .site-header__inner {
        width: calc(100% - 1rem);
    }

    .report-header-note {
        display: none;
    }
}

@media (max-width: 430px) {
    .site-brand img {
        width: 126px;
    }

    .site-nav__cta {
        font-size: 0 !important;
    }

    .site-nav__cta::after {
        content: "Acessar";
        font-size: .75rem;
    }
}

@media print {
    .page-flow .site-header,
    .page-flow .flow-hero,
    .page-flow .viewer-head,
    .page-flow .viewer-caption,
    .page-flow .site-footer,
    .page-flow .lightbox {
        display: none !important;
    }

    .page-flow,
    .page-flow .flow-main,
    .page-flow .page-shell--wide,
    .page-flow .viewer,
    .page-flow .image-wrap {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .page-flow #fluxo {
        width: 100% !important;
        max-width: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
