:root {
    --portal-navy-950: #031a3c;
    --portal-navy-900: #06275b;
    --portal-navy-800: #0b3f86;
    --portal-blue: #1f76d2;
    --portal-green: #0c9c56;
    --portal-yellow: #f1c400;
    --portal-red: #d53d3d;
    --portal-bg: #f4f7fb;
    --portal-surface: #ffffff;
    --portal-border: #dbe4ef;
    --portal-text: #14213d;
    --portal-muted: #627087;
    --portal-radius: 18px;
    --portal-radius-lg: 26px;
    --portal-shadow: 0 16px 45px rgba(3, 26, 60, 0.10);
    --portal-content-width: 1720px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.uhamiaji-portal-os {
    margin: 0;
    background: var(--portal-bg);
    color: var(--portal-text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

body.portal-drawer-open {
    overflow: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.portal-skip-link {
    position: fixed;
    left: 16px;
    top: -80px;
    z-index: 9999;
    padding: 12px 16px;
    background: #fff;
    color: var(--portal-navy-900);
    border-radius: 8px;
}

.portal-skip-link:focus {
    top: 16px;
}

.portal-shell {
    width: 100%;
    min-height: 100vh;
    overflow-x: clip;
}

.portal-header {
    position: sticky;
    top: 0;
    z-index: 800;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 1px 0 rgba(3, 26, 60, 0.08);
    backdrop-filter: blur(14px);
    transition: transform 180ms ease;
}

.portal-header-inner {
    min-height: 112px;
    max-width: var(--portal-content-width);
    margin: 0 auto;
    padding: 12px 28px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 24px;
}

.portal-brand {
    display: block;
    min-width: 0;
}

.portal-brand img {
    display: block;
    width: min(760px, 100%);
    max-height: 96px;
    margin: 0 auto;
    object-fit: contain;
}

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

.portal-button {
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 750;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

.portal-button-primary {
    background: var(--portal-navy-900);
    color: #fff;
    box-shadow: 0 12px 25px rgba(6, 39, 91, 0.18);
}

.portal-button-ghost {
    background: #fff;
    border-color: #bcc9dc;
    color: var(--portal-navy-900);
}

.portal-user-action {
    font-weight: 700;
    color: var(--portal-navy-900);
}

.portal-icon-action {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #eef4fb;
}

.portal-icon-bell::before {
    content: "●";
    color: var(--portal-navy-900);
}

.portal-national-stripe {
    height: 5px;
    display: grid;
    grid-template-columns: 1fr .45fr 1.4fr 1fr;
}

.portal-national-stripe span:nth-child(1) { background: var(--portal-green); }
.portal-national-stripe span:nth-child(2) { background: var(--portal-yellow); }
.portal-national-stripe span:nth-child(3) { background: #050505; }
.portal-national-stripe span:nth-child(4) { background: #2ea9df; }

.portal-desktop-nav {
    border-bottom: 1px solid var(--portal-border);
}

.portal-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.portal-desktop-nav .portal-menu {
    min-height: 62px;
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 4px;
}

.portal-desktop-nav .portal-menu a {
    min-height: 62px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    font-weight: 680;
    color: var(--portal-text);
    border-bottom: 3px solid transparent;
}

.portal-desktop-nav .portal-menu a:hover,
.portal-desktop-nav .current-menu-item > a {
    color: var(--portal-green);
    border-bottom-color: var(--portal-green);
}

.portal-menu-toggle,
.portal-mobile-drawer,
.portal-mobile-bottom {
    display: none;
}

.portal-main {
    width: 100%;
}

.portal-home,
.portal-content-shell {
    max-width: var(--portal-content-width);
    margin: 0 auto;
    padding: 28px;
}

.portal-hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(340px, .82fr);
    gap: 24px;
}

.portal-hero-card,
.portal-track-card,
.portal-panel,
.portal-step-grid article,
.portal-page-card {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
}

.portal-hero-card {
    min-height: 410px;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    overflow: hidden;
    background: linear-gradient(135deg, #f9fcff 0%, #e8f2ff 100%);
}

.portal-hero-copy {
    padding: 54px 24px 54px 50px;
    align-self: center;
}

.portal-kicker,
.portal-card-kicker {
    color: var(--portal-green);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.portal-hero-copy h1 {
    margin: 16px 0;
    color: var(--portal-navy-900);
    font-size: clamp(38px, 4vw, 62px);
    line-height: 1.02;
    letter-spacing: -.04em;
}

.portal-hero-copy h1 span {
    display: block;
}

.portal-hero-copy p {
    max-width: 690px;
    color: var(--portal-muted);
    font-size: 17px;
    line-height: 1.7;
}

.portal-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.portal-hero-image {
    min-height: 410px;
    display: grid;
    place-items: center;
    padding: 32px;
}

.portal-hero-image img {
    width: 100%;
    height: 310px;
    object-fit: cover;
    border: 7px solid rgba(255, 255, 255, .9);
    border-radius: 22px;
    box-shadow: 0 30px 65px rgba(3, 26, 60, .24);
}

.portal-track-card {
    padding: 30px;
}

.portal-track-card h2,
.portal-panel h2 {
    margin: 8px 0;
    color: var(--portal-navy-900);
    font-size: 24px;
}

.portal-track-card p,
.portal-panel p {
    color: var(--portal-muted);
}

.portal-track-card form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.portal-track-card label {
    display: grid;
    gap: 7px;
}

.portal-track-card label span {
    font-size: 13px;
    font-weight: 750;
}

.portal-track-card input,
.portal-entry-content input,
.portal-entry-content select,
.portal-entry-content textarea {
    width: 100%;
    min-height: 50px;
    padding: 0 14px;
    border: 1px solid #c9d5e4;
    border-radius: 10px;
    background: #fff;
    color: var(--portal-text);
}

.portal-entry-content textarea {
    min-height: 130px;
    padding-top: 14px;
}

.portal-step-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.portal-step-grid article {
    min-height: 220px;
    padding: 24px 20px;
}

.portal-step-grid article > span {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e8f3ff;
    color: var(--portal-blue);
    font-weight: 850;
}

.portal-step-grid h2 {
    margin: 20px 0 8px;
    font-size: 17px;
    color: var(--portal-navy-900);
}

.portal-step-grid p {
    margin: 0;
    color: var(--portal-muted);
    font-size: 14px;
    line-height: 1.6;
}

.portal-home-lower {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(320px, .8fr);
    gap: 24px;
    margin-top: 24px;
}

.portal-panel {
    padding: 30px;
}

.portal-document-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.portal-document-grid > div {
    min-height: 72px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    background: #f9fbfe;
}

.portal-document-grid span {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e8f3ff;
    color: var(--portal-blue);
    font-weight: 850;
}

.portal-document-grid p {
    margin: 0;
    color: var(--portal-text);
    font-size: 14px;
}

.portal-content-shell {
    min-height: 60vh;
}

.portal-page-card {
    width: 100%;
    padding: clamp(24px, 4vw, 52px);
}

.portal-page-header h1 {
    margin-top: 0;
    color: var(--portal-navy-900);
    font-size: clamp(32px, 4vw, 52px);
}

.portal-entry-content {
    max-width: none;
}

.portal-entry-content > *:first-child {
    margin-top: 0;
}

.portal-list-card {
    padding: 20px 0;
    border-bottom: 1px solid var(--portal-border);
}

.portal-error-card {
    text-align: center;
    padding-block: 80px;
}

.portal-footer {
    margin-top: 18px;
    padding: 46px 28px 24px;
    background: radial-gradient(circle at 90% 0%, rgba(31, 118, 210, .18), transparent 30%), var(--portal-navy-950);
    color: #fff;
}

.portal-footer-grid {
    max-width: var(--portal-content-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr .8fr .8fr 1fr;
    gap: 42px;
}

.portal-footer-grid section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.portal-footer-grid h2 {
    margin: 0 0 4px;
    font-size: 15px;
}

.portal-footer-grid a,
.portal-footer-grid p,
.portal-footer-brand span {
    color: rgba(255, 255, 255, .76);
    font-size: 13px;
}

.portal-footer-brand img {
    width: min(330px, 100%);
    padding: 8px 10px;
    border-radius: 10px;
    background: #fff;
}

.portal-footer-brand small {
    color: #5ee897;
    font-weight: 750;
}

.portal-footer-bottom {
    max-width: var(--portal-content-width);
    margin: 34px auto 0;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .62);
    font-size: 12px;
}

.portal-footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.portal-footer-menu li {
    margin-bottom: 8px;
}

/* Tablet interface: distinct split dashboard-style layout */
@media (min-width: 761px) and (max-width: 1180px) {
    .portal-header-inner {
        min-height: 92px;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 10px 18px;
    }

    .portal-brand img {
        max-height: 76px;
    }

    .portal-account-actions .portal-button {
        min-height: 42px;
        padding-inline: 14px;
    }

    .portal-desktop-nav .portal-menu {
        justify-content: flex-start;
        overflow-x: auto;
        padding-inline: 14px;
        scrollbar-width: none;
    }

    .portal-desktop-nav .portal-menu::-webkit-scrollbar {
        display: none;
    }

    .portal-home,
    .portal-content-shell {
        padding: 20px;
    }

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

    .portal-hero-card {
        grid-template-columns: 1.2fr .8fr;
        min-height: 340px;
    }

    .portal-hero-copy {
        padding: 38px;
    }

    .portal-hero-image,
    .portal-hero-image img {
        min-height: 340px;
        height: 250px;
    }

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

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

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

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

/* Mobile app interface: deliberately different from desktop */
@media (max-width: 760px) {
    body.uhamiaji-portal-os {
        padding-bottom: calc(78px + env(safe-area-inset-bottom));
    }

    .portal-header {
        transition: transform 200ms ease;
    }

    .portal-header.is-hidden-mobile {
        transform: translateY(-100%);
    }

    .portal-header-inner {
        min-height: 74px;
        padding: 7px 10px;
        grid-template-columns: 44px minmax(0, 1fr) 42px;
        gap: 7px;
    }

    .portal-menu-toggle {
        width: 42px;
        height: 42px;
        display: grid;
        place-content: center;
        gap: 4px;
        border: 0;
        border-radius: 10px;
        background: transparent;
    }

    .portal-menu-toggle span {
        width: 22px;
        height: 2px;
        background: var(--portal-navy-900);
        border-radius: 3px;
    }

    .portal-brand img {
        width: 100%;
        max-height: 58px;
    }

    .portal-account-actions {
        justify-content: flex-end;
    }

    .portal-account-actions .portal-button,
    .portal-account-actions .portal-user-action {
        display: none;
    }

    .portal-desktop-nav {
        display: none;
    }

    .portal-mobile-drawer {
        position: fixed;
        inset: 0;
        z-index: 1100;
        display: block;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease, visibility 180ms ease;
    }

    .portal-mobile-drawer.is-open {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

    .portal-drawer-backdrop {
        position: absolute;
        inset: 0;
        border: 0;
        background: rgba(2, 15, 36, .66);
        backdrop-filter: blur(3px);
    }

    .portal-drawer-panel {
        position: relative;
        width: min(86vw, 360px);
        height: 100%;
        padding: 20px;
        display: flex;
        flex-direction: column;
        background: #fff;
        transform: translateX(-103%);
        transition: transform 220ms ease;
        box-shadow: 24px 0 60px rgba(3, 26, 60, .24);
    }

    .portal-mobile-drawer.is-open .portal-drawer-panel {
        transform: translateX(0);
    }

    .portal-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 14px;
        border-bottom: 1px solid var(--portal-border);
    }

    .portal-drawer-head button {
        width: 40px;
        height: 40px;
        border: 0;
        border-radius: 50%;
        background: #eef3f8;
        font-size: 25px;
    }

    .portal-mobile-nav .portal-menu {
        display: grid;
        gap: 5px;
        margin-top: 18px;
    }

    .portal-mobile-nav .portal-menu a {
        min-height: 50px;
        padding: 0 12px;
        display: flex;
        align-items: center;
        border-radius: 10px;
        font-weight: 700;
    }

    .portal-mobile-nav .portal-menu a:hover {
        background: #edf5ff;
        color: var(--portal-blue);
    }

    .portal-drawer-account {
        margin-top: auto;
        display: grid;
        gap: 10px;
    }

    .portal-home,
    .portal-content-shell {
        padding: 14px 12px 26px;
    }

    .portal-hero-layout {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .portal-hero-card {
        position: relative;
        min-height: 360px;
        display: block;
        border-radius: 18px;
        background: linear-gradient(145deg, #06275b 0%, #0b438d 100%);
        color: #fff;
    }

    .portal-hero-copy {
        position: relative;
        z-index: 3;
        padding: 24px 20px 154px;
    }

    .portal-kicker {
        color: #7ce7a8;
    }

    .portal-hero-copy h1 {
        max-width: 285px;
        color: #fff;
        font-size: 32px;
    }

    .portal-hero-copy p {
        max-width: 300px;
        color: rgba(255, 255, 255, .78);
        font-size: 14px;
    }

    .portal-hero-actions {
        position: absolute;
        left: 16px;
        right: 16px;
        bottom: 14px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 9px;
        margin: 0;
    }

    .portal-hero-actions .portal-button {
        min-height: 46px;
        padding-inline: 10px;
        font-size: 12px;
    }

    .portal-hero-actions .portal-button-primary {
        background: #fff;
        color: var(--portal-navy-900);
    }

    .portal-hero-actions .portal-button-ghost {
        background: rgba(255, 255, 255, .09);
        color: #fff;
        border-color: rgba(255, 255, 255, .32);
    }

    .portal-hero-image {
        position: absolute;
        right: -22px;
        bottom: 74px;
        min-height: 0;
        width: 180px;
        padding: 0;
        transform: rotate(4deg);
    }

    .portal-hero-image img {
        width: 180px;
        height: 116px;
        border-width: 4px;
        border-radius: 12px;
    }

    .portal-track-card,
    .portal-panel,
    .portal-page-card {
        padding: 20px;
        border-radius: 16px;
    }

    .portal-step-grid {
        display: flex;
        gap: 12px;
        margin: 14px -12px 0;
        padding: 0 12px 5px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .portal-step-grid::-webkit-scrollbar {
        display: none;
    }

    .portal-step-grid article {
        flex: 0 0 78vw;
        min-height: 175px;
        scroll-snap-align: start;
    }

    .portal-home-lower {
        display: flex;
        flex-direction: column;
        gap: 14px;
        margin-top: 14px;
    }

    .portal-document-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .portal-footer {
        padding: 32px 20px 24px;
    }

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

    .portal-footer-grid section:not(:first-child) {
        padding-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, .11);
    }

    .portal-footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        margin-top: 28px;
    }

    .portal-mobile-bottom {
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: 8px;
        z-index: 1000;
        min-height: 68px;
        display: block;
        border: 1px solid rgba(255, 255, 255, .12);
        border-radius: 18px;
        background: rgba(3, 26, 60, .97);
        box-shadow: 0 18px 44px rgba(3, 26, 60, .32);
        backdrop-filter: blur(14px);
    }

    .portal-bottom-menu {
        list-style: none;
        margin: 0;
        padding: 4px 3px calc(4px + env(safe-area-inset-bottom));
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .portal-bottom-menu li {
        min-width: 0;
    }

    .portal-bottom-menu a {
        min-height: 58px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        border-radius: 13px;
        color: rgba(255, 255, 255, .68);
        font-size: 9px;
        font-weight: 700;
    }

    .portal-bottom-menu .current-menu-item > a {
        background: rgba(255, 255, 255, .10);
        color: #66e39b;
    }

    .portal-bottom-icon {
        width: 21px;
        height: 21px;
        border: 2px solid currentColor;
        border-radius: 6px;
    }
}

@media (max-width: 390px) {
    .portal-hero-actions {
        grid-template-columns: 1fr;
    }

    .portal-hero-copy {
        padding-bottom: 205px;
    }

    .portal-hero-image {
        bottom: 120px;
        width: 150px;
    }

    .portal-hero-image img {
        width: 150px;
        height: 98px;
    }
}


/* Shellless edition: the theme does not render a header, footer or navigation. */
.portal-main {
    width: 100%;
    min-height: 100vh;
}

.portal-content-shell-full {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.portal-page-card-shellless {
    width: 100%;
    min-height: 100vh;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.portal-page-card-shellless .portal-entry-content {
    width: 100%;
    max-width: none;
    margin: 0;
}

body.uhamiaji-portal-os {
    padding-bottom: 0;
}

@media (max-width: 760px) {
    body.uhamiaji-portal-os {
        padding-bottom: 0;
    }

    .portal-content-shell-full,
    .portal-page-card-shellless {
        padding: 0;
    }
}
