:root {
    --portal-red: #ed3338;
    --portal-red-dark: #c92b30;
    --portal-red-soft: #fff0f1;
    --portal-graphite: #373536;
    --portal-charcoal: #211f20;
    --portal-ink: #2f2c2d;
    --portal-muted: #6d696b;
    --portal-line: #e5e1e2;
    --portal-soft: #f7f6f6;
    --portal-white: #ffffff;
    --portal-shadow: 0 18px 48px rgba(55, 53, 54, .11);
}

body.portal-public {
    background: var(--portal-white);
    color: var(--portal-ink);
}

.portal-public .container {
    width: min(1180px, calc(100% - 40px));
}

/* Header */
.portal-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(229, 225, 226, .95);
}

.portal-header-row {
    min-height: 86px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 22px;
    padding: 7px 0;
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
}

.portal-logo {
    display: block;
    width: 78px;
    height: auto;
    object-fit: contain;
}

.portal-brand-copy {
    display: grid;
    gap: 2px;
    padding-left: 2px;
    border-left: 1px solid var(--portal-line);
}

.portal-brand-copy strong {
    color: var(--portal-graphite);
    font-size: .79rem;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.portal-brand-copy span {
    color: var(--portal-muted);
    font-size: .72rem;
    font-weight: 650;
}

.portal-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 26px;
}

.portal-nav a {
    color: #474345;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 750;
}

.portal-nav a:hover {
    color: var(--portal-red);
}

.portal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-link-button,
.portal-outline-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 10px;
    padding: 0 16px;
    text-decoration: none;
    font-size: .88rem;
    font-weight: 800;
}

.portal-link-button {
    background: var(--portal-red);
    color: #fff;
    box-shadow: 0 9px 22px rgba(237, 51, 56, .22);
}

.portal-link-button:hover {
    background: var(--portal-red-dark);
}

.portal-outline-button {
    color: var(--portal-graphite);
    border: 1px solid var(--portal-line);
    background: #fff;
}

/* Hero */
.portal-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 84% 16%, rgba(237, 51, 56, .28), transparent 24%),
        radial-gradient(circle at 72% 72%, rgba(237, 51, 56, .12), transparent 35%),
        linear-gradient(135deg, #171516 0%, #2b292a 52%, #3a3738 100%);
    color: #fff;
}

.portal-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to right, rgba(0,0,0,.25), rgba(0,0,0,.8));
}

.portal-hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: 70px;
    align-items: center;
    min-height: 560px;
    padding: 76px 0 82px;
}

.portal-kicker {
    margin: 0 0 14px;
    color: #ff7f83;
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}

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

.portal-hero-copy {
    max-width: 700px;
    margin: 22px 0 0;
    color: #ddd7d9;
    font-size: 1.05rem;
    line-height: 1.75;
}

.portal-search {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 760px;
    margin-top: 30px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .13);
    box-shadow: 0 18px 45px rgba(0, 0, 0, .16);
}

.portal-search-field {
    display: grid;
    gap: 8px;
}

.portal-search-label {
    color: #fff;
    font-size: .88rem;
    font-weight: 700;
}

.portal-search input {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    border: 0;
    border-radius: 9px;
    padding: 0 16px;
    background: #fff;
    color: var(--portal-ink);
    outline: none;
}

.portal-search input:focus {
    box-shadow: 0 0 0 3px rgba(237, 51, 56, .24);
}

.portal-search button {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 9px;
    background: var(--portal-red);
    color: #fff;
    font-weight: 850;
    cursor: pointer;
}

.portal-search button:hover {
    background: var(--portal-red-dark);
}

.portal-hero-note {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 14px 0 0;
    color: #c8bfc1;
    font-size: .82rem;
}

.portal-hero-note::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ed3338;
    box-shadow: 0 0 0 5px rgba(237, 51, 56, .13);
}

.portal-hero-panel {
    position: relative;
    padding: 26px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 24px;
    background:
        linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.045));
    box-shadow: 0 28px 70px rgba(0, 0, 0, .22);
    backdrop-filter: blur(10px);
}

.portal-hero-panel::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    right: -45px;
    bottom: -55px;
    border-radius: 50%;
    border: 26px solid rgba(237, 51, 56, .14);
}

.portal-panel-label {
    color: #ff8a8e;
    font-size: .75rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.portal-hero-panel h2 {
    margin: 8px 0 20px;
    font-size: 1.55rem;
    line-height: 1.2;
}

.portal-feature-list {
    display: grid;
    gap: 12px;
}

.portal-feature-item {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 13px;
    align-items: center;
    min-height: 64px;
    padding: 10px 12px;
    border-radius: 13px;
    background: rgba(255, 255, 255, .065);
}

.portal-feature-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(237, 51, 56, .14);
    color: #ff8589;
    font-weight: 900;
}

.portal-feature-item strong {
    display: block;
    margin-bottom: 2px;
    font-size: .92rem;
}

.portal-feature-item span {
    color: #c9c1c3;
    font-size: .79rem;
}

/* Intro */
.portal-intro {
    background: #fff;
    border-bottom: 1px solid var(--portal-line);
}

.portal-intro-grid {
    display: grid;
    grid-template-columns: 1.15fr repeat(3, .8fr);
    gap: 22px;
    align-items: stretch;
    padding: 34px 0;
}

.portal-intro-copy {
    padding: 10px 18px 10px 0;
}

.portal-intro-copy strong {
    display: block;
    color: var(--portal-graphite);
    font-size: 1rem;
}

.portal-intro-copy p {
    margin: 6px 0 0;
    color: var(--portal-muted);
    font-size: .88rem;
    line-height: 1.55;
}

.portal-intro-item {
    padding: 12px 16px;
    border-left: 1px solid var(--portal-line);
}

.portal-intro-item b {
    display: block;
    color: var(--portal-red);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.portal-intro-item span {
    display: block;
    margin-top: 4px;
    color: #3f4e61;
    font-size: .86rem;
}

/* Catalog */
.portal-catalog {
    padding: 74px 0 84px;
    background: var(--portal-soft);
}

.portal-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 26px;
    margin-bottom: 28px;
}

.portal-section-heading h2 {
    margin: 4px 0 0;
    color: var(--portal-graphite);
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    letter-spacing: -.025em;
}

.portal-section-heading p {
    margin: 0;
}

.portal-result-count {
    color: var(--portal-muted);
    font-size: .88rem;
    font-weight: 750;
    white-space: nowrap;
}

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

.portal-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 320px;
    overflow: hidden;
    border: 1px solid var(--portal-line);
    border-radius: 18px;
    background: #fff;
    padding: 22px;
    box-shadow: 0 12px 32px rgba(17, 45, 78, .055);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.portal-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 72px;
    height: 4px;
    background: var(--portal-red);
}

.portal-card:hover {
    transform: translateY(-3px);
    border-color: #d7c8ca;
    box-shadow: var(--portal-shadow);
}

.portal-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 22px;
}

.portal-card-badges {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.portal-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 850;
}

.portal-badge-pdf {
    background: var(--portal-red-soft);
    color: var(--portal-red);
}

.portal-badge-category {
    background: #eef1f5;
    color: #526174;
}

.portal-card h3 {
    margin: 0 0 12px;
    color: var(--portal-graphite);
    font-size: 1.18rem;
    line-height: 1.25;
}

.portal-card-meta {
    display: grid;
    gap: 8px;
    margin: 0 0 22px;
}

.portal-meta-row {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 12px;
    font-size: .83rem;
}

.portal-meta-row dt {
    color: #8a8587;
}

.portal-meta-row dd {
    margin: 0;
    color: #4f4b4c;
    overflow-wrap: anywhere;
}

.portal-card-action {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 46px;
    padding: 0 15px;
    border-radius: 10px;
    background: var(--portal-graphite);
    color: #fff;
    text-decoration: none;
    font-size: .87rem;
    font-weight: 850;
}

.portal-card-action:hover {
    background: var(--portal-red);
}

.portal-card-action span:last-child {
    font-size: 1.05rem;
}

.portal-empty {
    border: 1px dashed #c8d4df;
    border-radius: 18px;
    background: #fff;
    padding: 48px 26px;
    text-align: center;
}

.portal-empty h3 {
    margin: 0 0 7px;
    color: var(--portal-graphite);
}

.portal-empty p {
    margin: 0;
    color: var(--portal-muted);
}

/* CTA */
.portal-support {
    background: #fff;
    padding: 72px 0;
}

.portal-support-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.25fr auto;
    gap: 34px;
    align-items: center;
    padding: 38px 42px;
    border-radius: 22px;
    background:
        radial-gradient(circle at 90% 20%, rgba(237, 51, 56, .22), transparent 27%),
        linear-gradient(135deg, #1f1d1e, var(--portal-graphite));
    color: #fff;
}

.portal-support-card h2 {
    margin: 6px 0 10px;
    font-size: clamp(1.65rem, 3vw, 2.5rem);
}

.portal-support-card p {
    max-width: 720px;
    margin: 0;
    color: #d7ced0;
}

.portal-support-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.portal-support-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    padding: 0 17px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 850;
    font-size: .86rem;
}

.portal-support-primary {
    background: #fff;
    color: var(--portal-graphite);
}

.portal-support-secondary {
    border: 1px solid rgba(255,255,255,.25);
    color: #fff;
}

/* Footer */
.portal-footer {
    background: #171516;
    color: #ebe7e8;
    padding: 48px 0 22px;
}

.portal-footer-grid {
    display: grid;
    grid-template-columns: 1.25fr .8fr .9fr;
    gap: 46px;
}

.portal-footer h3 {
    margin: 0 0 14px;
    color: #fff;
    font-size: .92rem;
}

.portal-footer p,
.portal-footer a {
    color: #b8afb1;
    font-size: .84rem;
    line-height: 1.7;
}

.portal-footer a {
    text-decoration: none;
}

.portal-footer a:hover {
    color: #fff;
}

.portal-footer-brand {
    margin-bottom: 18px;
}

.portal-footer-logo {
    display: block;
    width: 190px;
    max-width: 100%;
    height: auto;
}

.portal-footer-links {
    display: grid;
    gap: 7px;
}

.portal-footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 38px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,.09);
    color: #8e8587;
    font-size: .76rem;
}

@media (max-width: 980px) {
    .portal-header-row {
        grid-template-columns: auto auto;
    }

    .portal-nav {
        display: none;
    }

    .portal-header-actions {
        justify-self: end;
    }

    .portal-hero-inner {
        grid-template-columns: 1fr;
        gap: 34px;
        min-height: auto;
        padding: 64px 0;
    }

    .portal-hero-panel {
        max-width: 720px;
    }

    .portal-intro-grid {
        grid-template-columns: 1fr 1fr;
    }

    .portal-intro-copy {
        grid-column: 1 / -1;
    }

    .portal-intro-item {
        border-left: 0;
        border-top: 1px solid var(--portal-line);
        padding: 16px 0 0;
    }

    .portal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-support-card {
        grid-template-columns: 1fr;
    }

    .portal-support-actions {
        justify-content: flex-start;
    }

    .portal-footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 680px) {
    .portal-public .container {
        width: min(100% - 26px, 1180px);
    }

    .portal-header-row {
        min-height: 66px;
        gap: 10px;
        padding: 6px 0;
    }

    .portal-logo {
        width: 47px;
        height: auto;
    }

    .portal-brand-copy {
        display: none;
    }

    .portal-outline-button {
        display: none;
    }

    .portal-link-button {
        min-height: 38px;
        padding: 0 12px;
        font-size: .8rem;
    }

    .portal-hero-inner {
        padding: 52px 0 58px;
    }

    .portal-hero h1 {
        font-size: clamp(2.15rem, 11vw, 3.2rem);
    }

    .portal-search {
        grid-template-columns: 1fr;
    }

    .portal-search button {
        min-height: 48px;
    }

    .portal-hero-panel {
        padding: 20px;
    }

    .portal-intro-grid {
        grid-template-columns: 1fr;
        padding: 24px 0;
    }

    .portal-intro-copy,
    .portal-intro-item {
        grid-column: auto;
        padding-right: 0;
    }

    .portal-catalog {
        padding: 54px 0 60px;
    }

    .portal-section-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .portal-grid {
        grid-template-columns: 1fr;
    }

    .portal-support {
        padding: 52px 0;
    }

    .portal-support-card {
        padding: 28px 24px;
    }

    .portal-support-actions {
        display: grid;
        width: 100%;
    }

    .portal-footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .portal-footer-bottom {
        flex-direction: column;
    }
}
