:root {
    --gz-green: #4f8a00;
    --gz-green-dark: #315d00;
    --gz-green-soft: #edf5e5;
    --gz-page: #f5f9ef;
    --gz-border: #d7e3ca;
    --gz-text: #17230f;
    --gz-muted: #65715d;
    --gz-white: #ffffff;
    --gz-shadow: 0 10px 28px rgba(39, 67, 20, .08);
}

html {
    min-height: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    background: var(--gz-page);
    color: var(--gz-text);
    font-family: 'Inter', sans-serif;
}

.portal-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
}

.portal-header {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--gz-border);
}

.portal-header-inner {
    min-height: 78px;
    display: flex;
    align-items: center;
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    text-decoration: none;
}

.portal-brand-mark {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--gz-green-soft);
    border: 1px solid #dce9d0;
}

.portal-brand-mark img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.portal-brand-copy {
    min-width: 0;
}

.portal-brand-name,
.portal-brand-subtitle {
    display: block;
}

.portal-brand-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.16rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.portal-brand-subtitle {
    margin-top: 2px;
    color: var(--gz-muted);
    font-size: .78rem;
    line-height: 1.35;
}

.portal-main {
    flex: 1 0 auto;
    padding: 62px 0 64px;
}

.portal-intro {
    max-width: 720px;
    margin-bottom: 34px;
}

.portal-eyebrow {
    display: inline-block;
    margin-bottom: 9px;
    color: var(--gz-green-dark);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.portal-intro h1 {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -.04em;
    line-height: 1.05;
}

.portal-intro p {
    max-width: 620px;
    margin: 14px 0 0;
    color: var(--gz-muted);
    font-size: 1rem;
    line-height: 1.7;
}

.portal-app-card {
    height: 100%;
    min-height: 218px;
    display: flex;
    flex-direction: column;
    padding: 26px;
    border: 1px solid var(--gz-border);
    border-radius: 14px;
    background: var(--gz-white);
    box-shadow: var(--gz-shadow);
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.portal-app-card:hover,
.portal-app-card:focus-visible {
    border-color: #a9c58e;
    box-shadow: 0 14px 34px rgba(39, 67, 20, .13);
    transform: translateY(-3px);
}

.portal-app-card:focus-visible {
    outline: 2px solid rgba(79, 138, 0, .35);
    outline-offset: 3px;
}

.portal-app-icon {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 23px;
    border-radius: 50%;
    color: var(--gz-green-dark);
    background: var(--gz-green-soft);
    border: 1px solid #d9e7cd;
    font-size: 1.05rem;
}

.portal-app-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.portal-app-title-row h2 {
    min-width: 0;
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.22rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.25;
}

.portal-app-arrow {
    flex: 0 0 auto;
    color: var(--gz-green);
    font-size: .86rem;
}

.portal-app-status {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1f3ee;
    color: #7a8175;
    font-size: .68rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.portal-app-content {
    min-width: 0;
}

.portal-app-content p {
    margin: 9px 0 0;
    color: var(--gz-muted);
    font-size: .88rem;
    line-height: 1.65;
}

.portal-app-card-disabled {
    cursor: default;
    opacity: .78;
}

.portal-app-card-disabled .portal-app-icon {
    filter: grayscale(.2);
}

.portal-footer {
    flex: 0 0 auto;
    border-top: 1px solid var(--gz-border);
    background: rgba(255, 255, 255, .55);
}

.portal-footer-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--gz-muted);
    font-size: .75rem;
}

.portal-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1080;
    width: min(320px, calc(100vw - 32px));
    max-width: 320px;
    padding: 11px 14px;
    border: 1px solid var(--gz-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--gz-shadow);
    color: var(--gz-text);
    font-size: .82rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease;
}

.portal-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 767.98px) {
    .portal-header-inner {
        min-height: 70px;
    }

    .portal-main {
        padding: 44px 0 48px;
    }

    .portal-intro {
        margin-bottom: 28px;
    }

    .portal-intro h1 {
        font-size: clamp(1.85rem, 8vw, 2.5rem);
    }

    .portal-intro p {
        margin-top: 12px;
        font-size: .94rem;
        line-height: 1.6;
    }

    .portal-app-card {
        min-height: 0;
        padding: 22px;
    }
}

@media (max-width: 575.98px) {
    .portal-header-inner {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .portal-brand {
        gap: 10px;
    }

    .portal-brand-mark {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        border-radius: 10px;
    }

    .portal-brand-mark img {
        width: 31px;
        height: 31px;
    }

    .portal-brand-name {
        font-size: 1.05rem;
    }

    .portal-brand-subtitle {
        font-size: .72rem;
    }

    .portal-main {
        padding-top: 36px;
    }

    .portal-eyebrow {
        margin-bottom: 8px;
        font-size: .7rem;
    }

    .portal-app-title-row {
        gap: 8px;
    }

    .portal-app-title-row h2 {
        font-size: 1.1rem;
    }

    .portal-app-content p {
        font-size: .84rem;
        line-height: 1.6;
    }

    .portal-footer-inner {
        min-height: 0;
        padding-top: 16px;
        padding-bottom: 16px;
        align-items: flex-start;
        justify-content: center;
        flex-direction: column;
        gap: 4px;
        font-size: .72rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-app-card,
    .portal-toast {
        transition: none;
    }
}

.form-control:focus {
    border-color: #8eb66c;
    box-shadow: 0 0 0 .2rem rgba(79, 138, 0, .12);
}

.btn-success {
    --bs-btn-bg: #4f8a00;
    --bs-btn-border-color: #4f8a00;
    --bs-btn-hover-bg: #315d00;
    --bs-btn-hover-border-color: #315d00;
    --bs-btn-active-bg: #315d00;
    --bs-btn-active-border-color: #315d00;
}
