/* Portal público — Betha Design System */

:root {
    --portal-primary: #3475c1;
    --portal-primary-dark: #295d99;
    --portal-bg: #ebedf0;
    --portal-surface: #ffffff;
    --portal-text: #222222;
    --portal-text-muted: #595959;
    --portal-border: #d9dde3;
    --portal-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
    --portal-shadow-hover: 0 8px 24px rgba(52, 117, 193, 0.12);
    --portal-header-bg: #1a1c1e;
    --portal-radius: 10px;
    --portal-radius-sm: 6px;
}

.portal-body {
    background-color: var(--portal-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.portal-body i.fas,
.portal-body i.far,
.portal-body i.fab {
    font-family: "Font Awesome 6 Free";
    font-style: normal;
    font-weight: 900;
    display: inline-block;
    line-height: 1;
}

.portal-body i.far { font-weight: 400; }
.portal-body i.fab { font-family: "Font Awesome 6 Brands"; font-weight: 400; }
.portal-body svg.svg-inline--fa { display: inline-block; vertical-align: -0.125em; }

.portal-body .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

/* ── Header ── */
.portal-header {
    background: var(--portal-header-bg);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
    position: sticky;
    top: 0;
    z-index: 100;
}

.portal-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    gap: 1rem;
}

.portal-header-entity {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.portal-brasao {
    width: 52px;
    height: 52px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.portal-brasao-img {
    width: 78%;
    height: auto;
    object-fit: contain;
}

.portal-header-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.65);
}

.portal-header-title {
    font-size: 1.05rem;
    font-weight: 400;
    color: #fff;
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-logo {
    height: 40px;
    width: auto;
}

/* ── Main ── */
.portal-main {
    flex: 1;
    padding: 1.75rem 0 3rem;
}

.portal-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ── Page head ── */
.portal-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--portal-border);
}

.portal-page-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--portal-primary);
    margin: 0 0 0.25rem;
}

.portal-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--portal-text);
    margin: 0 0 0.35rem;
}

.portal-page-subtitle {
    font-size: 0.9rem;
    color: var(--portal-text-muted);
    margin: 0;
}

.btn-portal-restrito {
    flex-shrink: 0;
    font-size: 0.82rem;
    padding: 0.45rem 1rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.btn-portal-restrito i,
.btn-portal-restrito svg {
    font-size: 0.8rem;
    opacity: 0.85;
}

/* ── Hero ── */
.portal-hero {
    margin-bottom: 1.75rem;
}

.portal-hero-row {
    align-items: stretch;
}

/* ── Cards ── */
.portal-card {
    background: var(--portal-surface);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
    border: 1px solid var(--portal-border);
    overflow: hidden;
    position: relative;
}

.portal-card-featured {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.portal-card-header-compact {
    padding: 0.75rem 1rem 0.75rem 1.25rem;
    align-items: center;
}

.portal-card-header-icon-sm {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
}

.portal-card-body-compact {
    padding: 1rem 1.15rem 1.15rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.portal-featured-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.portal-featured-details {
    flex: 1;
    min-width: 0;
}

.portal-pdf-icon-sm {
    width: 48px;
    height: 48px;
    margin: 0;
    flex-shrink: 0;
}

.portal-pdf-icon-sm .fas,
.portal-pdf-icon-sm svg.svg-inline--fa {
    font-size: 1.5rem;
}

.portal-edition-number-sm {
    font-size: 1.15rem;
    text-align: left;
    margin-bottom: 0.35rem;
}

.portal-featured-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.portal-featured-summary {
    font-size: 0.8rem;
    color: var(--portal-text-muted);
    line-height: 1.55;
    margin: 0;
}

.portal-featured-summary i,
.portal-featured-summary svg {
    color: var(--portal-primary);
    font-size: 0.72rem;
    margin-right: 0.15rem;
}

.portal-actions-compact {
    margin-top: auto;
    padding-top: 0.85rem;
    justify-content: flex-start;
}

.portal-actions-compact .btn {
    min-width: auto;
    font-size: 0.8rem;
    padding: 0.35rem 0.85rem;
}

.portal-loading-compact {
    padding: 0.25rem 0;
    justify-content: flex-start;
    font-size: 0.8rem;
}

.portal-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--portal-primary);
}

.portal-card-header {
    background: #f7f9fc;
    border-bottom: 1px solid var(--portal-border);
    padding: 1.1rem 1.25rem 1.1rem 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.portal-card-header-icon {
    width: 36px;
    height: 36px;
    background: #e8f0fa;
    border-radius: var(--portal-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--portal-primary);
}

.portal-card-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--portal-text);
    margin: 0;
}

.portal-card-subtitle {
    font-size: 0.78rem;
    color: var(--portal-text-muted);
    margin: 0.15rem 0 0;
}

.portal-card-body {
    padding: 1.5rem 1.25rem;
}

.portal-pdf-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(145deg, #fff5f5 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    border-radius: var(--portal-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.portal-pdf-icon .fas,
.portal-pdf-icon svg.svg-inline--fa {
    font-size: 2rem;
    color: #dc2626;
}

.portal-edition-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--portal-primary);
    text-align: center;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.portal-edition-meta {
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
}

.portal-meta-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--portal-text-muted);
    padding: 0.45rem 0.65rem;
    background: #f7f9fc;
    border-radius: var(--portal-radius-sm);
}

.portal-meta-row i,
.portal-meta-row svg {
    color: var(--portal-primary);
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.portal-meta-row strong {
    color: var(--portal-text);
    font-weight: 600;
    margin-right: 0.25rem;
}

.portal-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--portal-border);
}

.portal-actions .btn {
    min-width: 130px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.portal-loading {
    text-align: center;
    color: var(--portal-text-muted);
    font-size: 0.85rem;
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ── Intro ── */
.portal-intro {
    background: var(--portal-surface);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
    border: 1px solid var(--portal-border);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.portal-intro-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--portal-primary);
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.portal-intro p {
    font-size: 0.875rem;
    color: var(--portal-text-muted);
    line-height: 1.7;
    margin-bottom: 0.65rem;
}

.portal-intro-garantia {
    font-size: 0.85rem !important;
    font-style: italic;
    color: var(--portal-text) !important;
    border-left: 3px solid var(--portal-primary);
    padding-left: 0.85rem;
    margin-top: 0.5rem !important;
}

.portal-trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1.25rem;
}

.portal-trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--portal-primary-dark);
    background: #e8f0fa;
    border: 1px solid #c5d9f0;
    border-radius: 20px;
    padding: 0.35rem 0.75rem;
}

.portal-trust-badge i,
.portal-trust-badge svg {
    font-size: 0.7rem;
}

/* ── Stats grid ── */
.portal-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--portal-text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.portal-section-label i,
.portal-section-label svg {
    color: #2d8a4e;
}

.portal-stats {
    margin-bottom: 1.75rem;
}

.portal-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

.portal-stat-card {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-sm);
    padding: 1rem;
    box-shadow: var(--portal-shadow);
    text-align: center;
    transition: transform 0.15s, box-shadow 0.15s;
}

.portal-stat-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--portal-shadow-hover);
}

.portal-stat-icon {
    width: 36px;
    height: 36px;
    background: #e8f0fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.6rem;
    color: var(--portal-primary);
    font-size: 0.9rem;
}

.portal-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--portal-text);
    line-height: 1.2;
}

.portal-stat-label {
    font-size: 0.72rem;
    color: var(--portal-text-muted);
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.portal-stat-skeleton {
    height: 60px;
    background: linear-gradient(90deg, #f0f2f5 25%, #e8eaed 50%, #f0f2f5 75%);
    background-size: 200% 100%;
    animation: portal-shimmer 1.4s infinite;
    border-radius: 4px;
}

@keyframes portal-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Search ── */
.portal-search {
    margin-bottom: 1.75rem;
}

.portal-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.portal-search-header.is-open {
    border-bottom-color: var(--portal-border);
}

.portal-search-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--portal-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.portal-search-title i,
.portal-search-title svg {
    color: var(--portal-primary);
}

.portal-search-hint {
    font-size: 0.78rem;
    color: var(--portal-text-muted);
    margin: 0.2rem 0 0;
}

.portal-search-toggle {
    background: var(--portal-bg);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-sm);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--portal-text-muted);
    transition: background 0.15s;
    flex-shrink: 0;
}

.portal-search-toggle:hover {
    background: #dde1e8;
}

.portal-search-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.portal-search-body.is-open {
    max-height: 420px;
}

.portal-search-form {
    padding: 1.25rem;
}

.portal-search-form .form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--portal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.portal-search-form .form-control {
    border-radius: var(--portal-radius-sm);
    border-color: var(--portal-border);
    font-size: 0.9rem;
}

.portal-search-form .form-control:focus {
    border-color: var(--portal-primary);
    box-shadow: 0 0 0 3px rgba(52, 117, 193, 0.15);
}

.portal-search-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 0.5rem;
    flex-wrap: wrap;
}

/* ── Results ── */
.portal-results-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--portal-border);
}

.portal-results-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--portal-text);
    margin: 0 0 0.25rem;
}

.portal-results-count {
    font-size: 0.82rem;
    color: var(--portal-text-muted);
}

.portal-results-count .badge {
    font-size: 0.78rem;
    font-weight: 700;
}

.portal-editions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.portal-edition-card {
    background: var(--portal-surface);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
    border: 1px solid var(--portal-border);
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.portal-edition-card:hover {
    box-shadow: var(--portal-shadow-hover);
    transform: translateY(-3px);
    border-color: #b8cfe8;
}

.portal-edition-card-top {
    height: 4px;
    background: linear-gradient(90deg, var(--portal-primary) 0%, #4a8fd4 100%);
}

.portal-edition-card-top.extra {
    background: linear-gradient(90deg, #d97706 0%, #f59e0b 100%);
}

.portal-edition-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.portal-edition-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--portal-primary);
    margin-bottom: 0.5rem;
}

.portal-edition-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: auto;
    padding-top: 1rem;
    width: 100%;
    border-top: 1px solid var(--portal-border);
}

.portal-edition-card-actions .btn {
    font-size: 0.8rem;
    font-weight: 600;
    flex: 1;
    min-width: 110px;
    max-width: 150px;
}

/* ── Buttons & badges ── */
.btn-portal-outline {
    background-color: transparent;
    border: 1px solid var(--portal-primary);
    color: var(--portal-primary);
    font-weight: 600;
}

.btn-portal-outline:hover,
.btn-portal-outline:focus {
    background-color: var(--portal-primary);
    border-color: var(--portal-primary);
    color: #fff;
}

.badge-portal-normal {
    background-color: #e8f0fa;
    color: var(--portal-primary);
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.35em 0.7em;
    border-radius: 20px;
}

.badge-portal-extra {
    background-color: #fef3c7;
    color: #92400e;
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.35em 0.7em;
    border-radius: 20px;
}

/* ── Empty state ── */
.portal-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--portal-surface);
    border: 1px dashed var(--portal-border);
    border-radius: var(--portal-radius);
    margin-top: 0.5rem;
}

.portal-empty-icon {
    font-size: 2.5rem;
    color: #c5cdd8;
    margin-bottom: 1rem;
}

.portal-empty h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--portal-text);
    margin-bottom: 0.5rem;
}

.portal-empty p {
    font-size: 0.875rem;
    color: var(--portal-text-muted);
    margin: 0;
    max-width: 360px;
    margin-inline: auto;
}

/* ── Pagination ── */
.portal-pagination {
    margin-top: 1.75rem;
    display: flex;
    justify-content: center;
}

.portal-pagination .pagination {
    margin: 0;
    box-shadow: var(--portal-shadow);
    border-radius: var(--portal-radius-sm);
    overflow: hidden;
}

.portal-pagination .page-link {
    font-size: 0.85rem;
    font-weight: 600;
    border-color: var(--portal-border);
    padding: 0.5rem 0.85rem;
}

/* ── Overlay ── */
.portal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(2px);
    z-index: 9999;
}

/* ── 404 ── */
.portal-notfound {
    text-align: center;
    padding: 3rem 1rem;
}

.portal-notfound-icon {
    font-size: 3rem;
    color: var(--portal-primary);
    margin-bottom: 1rem;
}

.portal-notfound h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.portal-notfound p {
    color: var(--portal-text-muted);
    max-width: 480px;
    margin: 0 auto 1.5rem;
}

/* ── Responsive ── */
@media (max-width: 991px) {
    .portal-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .portal-page-head {
        flex-direction: column;
    }

    .portal-header-inner {
        padding: 0.75rem 1rem;
    }

    .portal-header-title {
        white-space: normal;
        font-size: 0.95rem;
    }

    .portal-logo {
        height: 34px;
    }

    .portal-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portal-editions-grid {
        grid-template-columns: 1fr;
    }

    .portal-page-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .portal-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}
