:root {
    --ink: #163b43;
    --muted: #64747a;
    --brand: #057f9a;
    --brand-dark: #0c2b50;
    --accent: #b01842;
    --surface: #ffffff;
    --line: #dce7ea;
    --soft: #f3f7f8;
    --shadow: 0 14px 34px rgba(16, 58, 68, .10);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: transparent;
    color: var(--ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body.modal-open { overflow: hidden; }

button, a { font: inherit; }

.documents-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 24px auto 42px;
}

.documents-heading {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 290px;
    gap: 24px;
    padding: 40px 42px;
    border-radius: 24px;
    overflow: hidden;
    color: #073b55;
    background-image: url("header-documentos-sms.png");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    box-shadow: var(--shadow);
}

.documents-heading > div:first-of-type {
    position: relative;
    z-index: 2;
    max-width: 55%;
}

.documents-heading div p {
    color: #315e6e;
}

.documents-heading .heading-mark {
    display: none;
}

.documents-heading::after {
    content: "";
    position: absolute;
    right: -45px;
    bottom: -80px;
    width: 240px;
    height: 240px;
    border: 42px solid rgba(255,255,255,.08);
    border-radius: 50%;
    pointer-events: none;
}

.eyebrow, .modal-kicker {
    display: block;
    margin-bottom: 5px;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.documents-heading h1 {
    margin: 0;
    font-size: clamp(1.65rem, 4vw, 2.4rem);
    line-height: 1.08;
}

.documents-heading p { margin: 8px 0 0; color: rgba(255,255,255,.84); }

.heading-mark {
    position: relative;
    z-index: 1;
    top: 22px;
    width: 70px;
    height: 70px;
    padding: 16px;
    flex: 0 0 auto;
    border-radius: 20px;
    background: rgba(255,255,255,.14);
    backdrop-filter: blur(8px);
}

.heading-mark svg { width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 1.7; }

.document-category { margin-top: 30px; }

.category-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    padding: 0 4px;
}

.category-heading h2 { margin: 0; font-size: 1.25rem; }
.category-heading span { color: var(--muted); font-size: .85rem; }

.document-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.document-card {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 6px 18px rgba(16,58,68,.055);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.document-card:hover {
    transform: translateY(-3px);
    border-color: rgba(5, 87, 154, 0.35);
    box-shadow: var(--shadow);
}

.document-open {
    display: flex;
    width: 100%;
    min-height: 112px;
    align-items: center;
    gap: 15px;
    padding: 18px;
    color: inherit;
    text-align: left;
    background: none;
    border: 0;
    border-radius: inherit;
    cursor: pointer;
}

.document-open:focus-visible { outline: 3px solid rgba(5,127,154,.35); outline-offset: 3px; }

.pdf-icon { width: 48px; height: 56px; flex: 0 0 auto; }
.pdf-icon svg { width: 100%; height: 100%; }
.pdf-icon .paper { fill: #fff; stroke: #d7e1e4; stroke-width: 2; }
.pdf-icon .fold { fill: none; stroke: #d7e1e4; stroke-width: 2; }
.pdf-icon .badge { fill: var(--accent); }
.pdf-icon text { fill: #fff; font-size: 9px; font-weight: 800; font-family: Arial, sans-serif; }

.document-copy { min-width: 0; flex: 1; }
.document-copy strong { display: block; line-height: 1.3; overflow-wrap: anywhere; }
.document-copy small { display: block; margin-top: 7px; color: var(--muted); }
.arrow { color: var(--brand); font-size: 1.35rem; transition: transform .2s ease; }
.document-card:hover .arrow { transform: translateX(3px); }

.empty-state {
    margin-top: 28px;
    padding: 46px 24px;
    text-align: center;
    border: 1px dashed #c7d6da;
    border-radius: 20px;
    background: var(--soft);
}
.empty-icon { display: inline-grid; place-items: center; width: 62px; height: 62px; border-radius: 16px; color: #fff; background: var(--accent); font-weight: 900; }
.empty-state h2 { margin: 15px 0 4px; }
.empty-state p { margin: 0; color: var(--muted); }

.pdf-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    place-items: center;
    padding: 18px;
}
.pdf-modal.is-open { display: grid; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 22, 27, .72); backdrop-filter: blur(4px); }
.modal-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(1080px, 96vw);
    height: min(820px, 94vh);
    overflow: hidden;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 28px 80px rgba(0,0,0,.32);
}
.modal-header, .modal-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; }
.modal-header { border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; max-width: 72vw; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-kicker { margin-bottom: 2px; color: var(--brand); }
.modal-close { width: 42px; height: 42px; border: 0; border-radius: 50%; color: var(--ink); background: var(--soft); font-size: 1.8rem; line-height: 1; cursor: pointer; }
.modal-viewer { min-height: 0; flex: 1; background: #e9eef0; }
.modal-viewer iframe { width: 100%; height: 100%; border: 0; }
.modal-actions { justify-content: flex-end; border-top: 1px solid var(--line); }
.modal-actions a { padding: 10px 16px; border-radius: 11px; font-size: .9rem; font-weight: 750; text-decoration: none; }
.secondary-action { color: var(--brand-dark); background: var(--soft); }
.primary-action { color: #fff; background: var(--brand-dark); }

@media (max-width: 820px) {
    .document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .documents-shell { width: min(100% - 20px, 1180px); margin-top: 10px; }
    .documents-heading { padding: 22px; border-radius: 18px; }
    .documents-heading p { font-size: .9rem; }
    .heading-mark { width: 56px; height: 56px; padding: 13px; border-radius: 16px; }
    .document-grid { grid-template-columns: 1fr; }
    .category-heading { align-items: center; }
    .modal-panel { width: 100%; height: 96vh; border-radius: 16px; }
    .modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .modal-actions a { text-align: center; }
}


.documents-back {
    position: absolute;
    z-index: 5;
    top: 14px;
    right: 28px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    backdrop-filter: blur(5px);
    transition:
        transform 0.22s ease,
        background-color 0.22s ease,
        box-shadow 0.22s ease;
}

.documents-back:hover,
.documents-back:focus-visible {
    color: #ffffff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.24);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
    transform: translateX(-4px);
}

.documents-back span {
    font-size: 1.15rem;
    transition: transform 0.22s ease;
}

.documents-back:hover span,
.documents-back:focus-visible span {
    transform: translateX(-3px);
}