:root {
    --portal-primary: #de0263;
    --portal-secondary: #fe6905;
    --portal-font-family: "Archivo", "Inter", sans-serif;

    --portal-charcoal: #141a23;
    --portal-charcoal-soft: #202833;
    --portal-mist: #ebeff7;
    --portal-grey: #899ba3;
    --portal-blush: #ffcce9;
    --portal-warm: #f7e3d5;

    --portal-white: #ffffff;
    --portal-text: #141a23;
    --portal-muted: #65737d;
    --portal-border: #dce3ec;
    --portal-border-strong: #c7d0db;
    --portal-surface: #ffffff;
    --portal-surface-soft: #f7f9fc;

    --portal-success: #147a55;
    --portal-success-bg: #e8f6ef;
    --portal-warning: #8a6100;
    --portal-warning-bg: #fff4d2;
    --portal-error: #b42318;
    --portal-error-bg: #fdeceb;

    --portal-shadow-small:
        0 2px 8px rgba(20, 26, 35, 0.06);

    --portal-shadow-medium:
        0 18px 48px rgba(20, 26, 35, 0.1);

    --portal-radius-small: 10px;
    --portal-radius: 16px;
    --portal-radius-large: 24px;

    --portal-gradient:
        linear-gradient(
            135deg,
            var(--portal-primary),
            var(--portal-secondary)
        );
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--portal-mist);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--portal-text);
    background: var(--portal-mist);
    font-family: var(--portal-font-family);
    -webkit-font-smoothing: antialiased;
}

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

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

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

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

.portal-public-body .portal-shell {
    background: transparent;
}

.portal-public-body .portal-main {
    position: relative;
    z-index: 1;
}

.portal-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(199, 208, 219, 0.85);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
}

.portal-header__accent {
    height: 3px;
    background: var(--portal-gradient);
}

.portal-header__inner {
    width: min(1180px, calc(100% - 40px));
    min-height: 74px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.portal-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.portal-brand__logo {
    width: auto;
    max-width: 220px;
    height: 43px;
    object-fit: contain;
    object-position: left center;
}

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

.portal-header__form {
    margin: 0;
}

.portal-nav-link,
.portal-nav-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--portal-radius-small);
    padding: 0 15px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.portal-nav-link {
    color: var(--portal-muted);
}

.portal-nav-link:hover {
    color: var(--portal-text);
    background: var(--portal-surface-soft);
}

.portal-nav-button {
    border: 1px solid var(--portal-primary);
    color: var(--portal-white);
    background: var(--portal-primary);
    cursor: pointer;
}

.portal-nav-button:hover {
    filter: brightness(0.92);
}

/* Events and Use Invite Code: quiet header buttons, styled like the language picker */

.portal-nav-pill {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    padding: 0 13px;
    color: var(--portal-text);
    background: var(--portal-white);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.portal-nav-pill:hover {
    border-color: var(--portal-border-strong);
    background: var(--portal-surface-soft);
}

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

.portal-main {
    width: min(1180px, calc(100% - 40px));
    flex: 1 0 auto;
    margin: 0 auto;
    padding: 64px 0 80px;
}

.portal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.68);
    background: var(--portal-charcoal);
}

.portal-footer__inner {
    width: min(1180px, calc(100% - 40px));
    min-height: 78px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    font-size: 13px;
}

.portal-footer__meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.portal-footer__divider {
    color: rgba(255, 255, 255, 0.3);
}

.portal-footer__link {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.portal-footer__link:hover {
    color: #fff;
}

.portal-powered {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
}

.portal-powered img {
    width: auto;
    height: 27px;
    filter: brightness(0) invert(1);
}

.portal-eyebrow {
    display: block;
    margin-bottom: 10px;
    color: var(--portal-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.portal-page-heading {
    max-width: 730px;
    margin-bottom: 38px;
}

.portal-page-heading h1,
.portal-auth__intro h1,
.portal-dashboard-heading h1 {
    margin: 0;
    color: var(--portal-charcoal);
    font-size: clamp(36px, 5vw, 54px);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.05;
}

.portal-page-heading p,
.portal-auth__intro > p,
.portal-dashboard-heading p {
    max-width: 660px;
    margin: 18px 0 0;
    color: var(--portal-muted);
    font-size: 17px;
    line-height: 1.7;
}

.portal-alert {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-radius: 13px;
    padding: 14px 16px;
    font-size: 14px;
}

.portal-alert__icon {
    width: 23px;
    height: 23px;
    flex: 0 0 auto;
}

.portal-alert__icon svg {
    width: 100%;
    height: 100%;
}

.portal-alert--success {
    border: 1px solid rgba(20, 122, 85, 0.18);
    color: var(--portal-success);
    background: var(--portal-success-bg);
}

.portal-alert--error {
    border: 1px solid rgba(180, 35, 24, 0.18);
    color: var(--portal-error);
    background: var(--portal-error-bg);
}

.portal-auth {
    min-height: 610px;
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(420px, 500px);
    align-items: center;
    gap: clamp(50px, 8vw, 112px);
}

.portal-auth__intro {
    max-width: 620px;
}

.portal-feature-list {
    margin-top: 38px;
    display: grid;
    gap: 18px;
}

.portal-feature {
    display: flex;
    align-items: center;
    gap: 15px;
}

.portal-feature__icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid
        color-mix(
            in srgb,
            var(--portal-primary) 18%,
            transparent
        );
    border-radius: 14px;
    color: var(--portal-primary);
    background:
        color-mix(
            in srgb,
            var(--portal-primary) 8%,
            white
        );
}

.portal-feature__icon svg {
    width: 23px;
    height: 23px;
}

.portal-feature div {
    min-width: 0;
}

.portal-feature h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 750;
}

.portal-feature p {
    margin: 4px 0 0;
    color: var(--portal-muted);
    font-size: 14px;
    line-height: 1.5;
}

.portal-auth-card {
    overflow: hidden;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-large);
    padding: 32px;
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow-medium);
}

.portal-selected-event {
    margin: -10px -10px 26px;
    border: 1px solid
        color-mix(
            in srgb,
            var(--portal-secondary) 20%,
            var(--portal-border)
        );
    border-radius: 16px;
    padding: 14px;
    background:
        color-mix(
            in srgb,
            var(--portal-secondary) 6%,
            white
        );
}

.portal-selected-event__label {
    display: block;
    margin-bottom: 9px;
    color: var(--portal-secondary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.portal-selected-event__content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-selected-event__image {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid var(--portal-border);
    border-radius: 11px;
    padding: 5px;
    background: var(--portal-white);
}

.portal-selected-event__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.portal-selected-event__details {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    gap: 3px;
}

.portal-selected-event__details strong,
.portal-selected-event__details span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-selected-event__details strong {
    font-size: 14px;
}

.portal-selected-event__details span {
    color: var(--portal-muted);
    font-size: 12px;
}

.portal-selected-event__content > a {
    color: var(--portal-secondary);
    font-size: 12px;
    font-weight: 750;
}

.portal-auth-card__heading {
    display: flex;
    align-items: center;
    gap: 15px;
}

.portal-auth-card__icon {
    width: 50px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 15px;
    color: var(--portal-white);
    background: var(--portal-gradient);
}

.portal-auth-card__icon svg {
    width: 23px;
    height: 23px;
}

.portal-auth-card__heading h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 780;
    letter-spacing: -0.025em;
}

.portal-auth-card__heading p {
    margin: 4px 0 0;
    color: var(--portal-muted);
    font-size: 14px;
}

.portal-form-message {
    margin-top: 22px;
    display: grid;
    gap: 4px;
    border-radius: 12px;
    padding: 13px 14px;
    font-size: 13px;
}

.portal-form-message--error {
    border: 1px solid rgba(180, 35, 24, 0.17);
    color: var(--portal-error);
    background: var(--portal-error-bg);
}

.portal-form {
    margin-top: 28px;
    display: grid;
    gap: 19px;
}

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

.portal-field label {
    color: var(--portal-text);
    font-size: 13px;
    font-weight: 750;
}

.portal-field__heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.portal-field__heading a {
    color: var(--portal-primary);
    font-size: 12px;
    font-weight: 700;
}

.portal-field input {
    width: 100%;
    height: 50px;
    border: 1px solid var(--portal-border-strong);
    border-radius: 12px;
    padding: 0 14px;
    color: var(--portal-text);
    background: var(--portal-white);
    outline: none;
    transition:
        border-color 140ms ease,
        box-shadow 140ms ease;
}

.portal-field input:focus {
    border-color: var(--portal-primary);
    box-shadow:
        0 0 0 4px
        color-mix(
            in srgb,
            var(--portal-primary) 10%,
            transparent
        );
}

.portal-password {
    position: relative;
}

.portal-password input {
    padding-right: 72px;
}

.portal-password__toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    min-width: 54px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    color: var(--portal-muted);
    background: var(--portal-surface-soft);
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
    transform: translateY(-50%);
}

.portal-turnstile {
    display: flex;
    justify-content: center;
}

.portal-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 12px;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 760;
    text-decoration: none;
    cursor: pointer;
}

.portal-button svg {
    width: 19px;
    height: 19px;
}

.portal-button--primary {
    border: 1px solid var(--portal-primary);
    color: var(--portal-white);
    background: var(--portal-primary);
}

.portal-button--primary:hover {
    filter: brightness(0.92);
}

.portal-button--secondary {
    border: 1px solid var(--portal-border-strong);
    color: var(--portal-text);
    background: var(--portal-white);
}

.portal-button--secondary:hover {
    border-color: var(--portal-primary);
    color: var(--portal-primary);
}

.portal-button--full {
    width: 100%;
}

.portal-auth-card__help {
    margin-top: 25px;
    border-top: 1px solid var(--portal-border);
    padding-top: 22px;
}

.portal-auth-card__help strong {
    display: block;
    font-size: 13px;
}

.portal-auth-card__help p {
    margin: 7px 0 0;
    color: var(--portal-muted);
    font-size: 12px;
    line-height: 1.6;
}

.portal-auth-card__help a {
    display: inline-block;
    margin-top: 12px;
    color: var(--portal-primary);
    font-size: 13px;
    font-weight: 750;
}

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

.portal-event-card {
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-large);
    color: var(--portal-text);
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow-small);
    text-decoration: none;
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.portal-event-card:hover {
    border-color: var(--portal-border-strong);
    box-shadow: var(--portal-shadow-medium);
    transform: translateY(-4px);
}

.portal-event-card--selected {
    border-color:
        color-mix(
            in srgb,
            var(--portal-primary) 42%,
            var(--portal-border)
        );
    box-shadow:
        0 0 0 3px
        color-mix(
            in srgb,
            var(--portal-primary) 9%,
            transparent
        );
}

.portal-event-card__visual {
    position: relative;
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 30px;
    background: var(--portal-charcoal);
}

.portal-event-card__gradient {
    position: absolute;
    inset: auto -45px -75px auto;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: var(--portal-gradient);
    opacity: 0.92;
    transform: rotate(-18deg);
}

.portal-event-card__visual::before {
    content: "";
    position: absolute;
    top: -80px;
    left: -90px;
    width: 190px;
    height: 190px;
    border: 28px solid
        color-mix(
            in srgb,
            var(--portal-primary) 80%,
            transparent
        );
    border-radius: 50%;
    opacity: 0.34;
}

.portal-event-card__icon {
    position: relative;
    z-index: 2;
    max-width: 78%;
    max-height: 105px;
    object-fit: contain;
}

.portal-event-card__background {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portal-event-card__visual--image::before {
    display: none;
}

.portal-event-card__visual--image::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.35);
}

.portal-event-card__fallback {
    position: relative;
    z-index: 2;
    width: 88px;
    height: 88px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 24px;
    color: var(--portal-white);
    background: rgba(255, 255, 255, 0.1);
    font-size: 34px;
    font-weight: 800;
}

.portal-event-card__selected {
    position: absolute;
    z-index: 3;
    top: 16px;
    right: 16px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--portal-white);
    background: rgba(0, 0, 0, 0.24);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.portal-event-card__body {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.portal-event-card__body h2 {
    margin: 0;
    font-size: 21px;
    font-weight: 760;
    letter-spacing: -0.02em;
}

.portal-event-card__information {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

.portal-event-detail {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--portal-muted);
    font-size: 14px;
    line-height: 1.45;
}

.portal-event-detail svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    margin-top: 1px;
}

.portal-event-card__action {
    margin-top: auto;
    padding-top: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: var(--portal-primary);
    font-size: 14px;
    font-weight: 750;
}

.portal-event-card__action svg {
    width: 20px;
    height: 20px;
}

.portal-page-footer-action {
    margin-top: 34px;
    display: flex;
    justify-content: center;
    gap: 7px;
    color: var(--portal-muted);
    font-size: 14px;
}

.portal-page-footer-action a {
    color: var(--portal-primary);
    font-weight: 750;
}

.portal-empty {
    max-width: 700px;
    margin: 40px auto;
    padding: 58px 36px;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-large);
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow-small);
    text-align: center;
}

.portal-empty__icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    color: var(--portal-primary);
    background:
        color-mix(
            in srgb,
            var(--portal-primary) 8%,
            white
        );
}

.portal-empty__icon svg {
    width: 29px;
    height: 29px;
}

.portal-empty h2,
.portal-empty h3 {
    margin: 0;
}

.portal-empty p {
    max-width: 470px;
    margin: 12px auto 0;
    color: var(--portal-muted);
    line-height: 1.65;
}

.portal-empty--compact {
    max-width: none;
    margin: 0;
    padding: 42px 28px;
}

.portal-empty--compact .portal-button {
    margin-top: 20px;
}

.portal-dashboard-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 34px;
}

.portal-dashboard-heading h1 {
    font-size: clamp(34px, 5vw, 48px);
}

.portal-event-context {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 17px;
    border: 1px solid
        color-mix(
            in srgb,
            var(--portal-secondary) 18%,
            var(--portal-border)
        );
    border-radius: var(--portal-radius);
    padding: 18px;
    background:
        color-mix(
            in srgb,
            var(--portal-secondary) 5%,
            white
        );
}

.portal-event-context__visual {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 14px;
    color: var(--portal-white);
    background: var(--portal-gradient);
    font-size: 20px;
    font-weight: 800;
}

.portal-event-context__visual img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.portal-event-thumb {
    position: relative;
    overflow: hidden;
}

.portal-event-thumb > img.portal-event-thumb__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    object-fit: cover;
    background: none;
}

.portal-event-thumb > :not(.portal-event-thumb__bg) {
    position: relative;
    z-index: 1;
}

.portal-event-thumb > .portal-event-thumb__bg ~ img {
    background: none;
}

/* Event icon on the brand gradient, as on the dashboard. Each place sets
   the tile's own size; the icon sits inside it at three quarters. */
.portal-event-icon-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    border: 0 !important;
    background: var(--portal-gradient) !important;
}

.portal-event-icon-tile img {
    width: 75% !important;
    height: 75% !important;
    padding: 0 !important;
    object-fit: contain !important;
    background: none !important;
}

.portal-event-context__content {
    min-width: 0;
    flex: 1 1 auto;
}

.portal-meta-label {
    display: block;
    margin-bottom: 5px;
    color: var(--portal-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.portal-event-context__content h2 {
    margin: 0;
    font-size: 18px;
}

.portal-event-context__content p {
    margin: 4px 0 0;
    color: var(--portal-muted);
    font-size: 13px;
}

.portal-event-context__action {
    color: var(--portal-secondary);
    font-size: 13px;
    font-weight: 750;
}

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

.portal-summary-card {
    min-width: 0;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    padding: 24px;
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow-small);
}

.portal-summary-card__icon {
    width: 46px;
    height: 46px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    color: var(--portal-primary);
    background:
        color-mix(
            in srgb,
            var(--portal-primary) 8%,
            white
        );
}

.portal-summary-card__icon svg {
    width: 22px;
    height: 22px;
}

.portal-summary-card h2 {
    overflow: hidden;
    margin: 0;
    font-size: 23px;
    font-weight: 760;
    letter-spacing: -0.025em;
    text-overflow: ellipsis;
}

.portal-summary-card p {
    min-height: 40px;
    margin: 8px 0 0;
    color: var(--portal-muted);
    font-size: 13px;
    line-height: 1.55;
}

.portal-summary-card a {
    display: inline-block;
    margin-top: 20px;
    color: var(--portal-primary);
    font-size: 13px;
    font-weight: 750;
}

.portal-status-panel {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    padding: 22px 24px;
    background: var(--portal-surface);
}

.portal-status-panel h2 {
    margin: 0;
    font-size: 19px;
}

.portal-status-panel p {
    margin: 6px 0 0;
    color: var(--portal-muted);
    font-size: 13px;
}

.portal-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.portal-status--approved,
.portal-status--active {
    color: var(--portal-success);
    background: var(--portal-success-bg);
}

.portal-status--pending,
.portal-status--submitted,
.portal-status--in-review,
.portal-status--in-progress {
    color: var(--portal-warning);
    background: var(--portal-warning-bg);
}

.portal-status--rejected,
.portal-status--revoked,
.portal-status--declined,
.portal-status--suspended {
    color: var(--portal-error);
    background: var(--portal-error-bg);
}

.portal-section {
    margin-top: 42px;
}

.portal-section__heading {
    margin-bottom: 18px;
}

.portal-section__heading h2 {
    margin: 0;
    font-size: 27px;
    font-weight: 780;
    letter-spacing: -0.03em;
}

.portal-application-list {
    overflow: hidden;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    background: var(--portal-surface);
}

.portal-application {
    display: grid;
    grid-template-columns:
        52px
        minmax(0, 1fr)
        auto
        auto;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
}

.portal-application + .portal-application {
    border-top: 1px solid var(--portal-border);
}

.portal-application__visual {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    color: var(--portal-white);
    background: var(--portal-gradient);
    font-weight: 800;
}

.portal-application__visual img {
    width: 39px;
    height: 39px;
    object-fit: contain;
}

.portal-application__content {
    min-width: 0;
}

.portal-application__content h3 {
    overflow: hidden;
    margin: 0;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-application__content p {
    margin: 4px 0 0;
    color: var(--portal-muted);
    font-size: 12px;
}

.portal-application__link {
    color: var(--portal-primary);
    font-size: 13px;
    font-weight: 750;
}

@media (max-width: 980px) {
    .portal-event-grid,
    .portal-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-auth {
        grid-template-columns: 1fr;
        gap: 44px;
    }

    .portal-auth__intro {
        max-width: 740px;
    }

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

    .portal-feature {
        align-items: flex-start;
    }
}

@media (max-width: 700px) {
    .portal-header__inner,
    .portal-main,
    .portal-footer__inner {
        width: min(100% - 28px, 1180px);
    }

    .portal-header__inner {
        min-height: 66px;
        gap: 12px;
    }

    /* The logo gives way to the buttons rather than sitting under them */
    .portal-brand {
        flex: 1 1 auto;
    }

    .portal-brand__logo {
        max-width: min(158px, 100%);
        height: 36px;
    }

    .portal-header__navigation {
        flex: 0 0 auto;
        gap: 6px;
    }

    .portal-nav-button,
    .portal-nav-pill {
        white-space: nowrap;
    }

    .portal-nav-link,
    .portal-nav-pill--events {
        display: none;
    }

    .portal-main {
        padding-top: 40px;
        padding-bottom: 58px;
    }

    .portal-page-heading {
        margin-bottom: 28px;
    }

    .portal-event-grid,
    .portal-summary-grid,
    .portal-feature-list {
        grid-template-columns: 1fr;
    }

    .portal-event-card__visual {
        height: 165px;
    }

    .portal-auth-card {
        padding: 24px;
    }

    .portal-dashboard-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-event-context {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .portal-event-context__content {
        width: calc(100% - 80px);
    }

    .portal-event-context__action {
        width: 100%;
        padding-left: 75px;
    }

    .portal-application {
        grid-template-columns: 48px minmax(0, 1fr) auto;
    }

    .portal-application__visual {
        width: 48px;
        height: 48px;
    }

    .portal-application__status {
        grid-column: 2;
    }

    .portal-application__link {
        grid-column: 3;
        grid-row: 1 / span 2;
    }

    .portal-status-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-footer__inner {
        min-height: 96px;
        align-items: flex-start;
        justify-content: center;
        flex-direction: column;
        padding: 18px 0;
    }
}

@media (max-width: 430px) {
    .portal-nav-button {
        min-height: 38px;
        padding: 0 12px;
        font-size: 12px;
    }

    .portal-nav-pill {
        min-height: 38px;
        padding: 0 10px;
        font-size: 12px;
    }

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

    .portal-nav-pill__short {
        display: inline;
    }

    .portal-page-heading h1,
    .portal-auth__intro h1 {
        font-size: 36px;
    }

    .portal-page-footer-action {
        align-items: center;
        flex-direction: column;
    }

    .portal-selected-event__content {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .portal-selected-event__details {
        width: calc(100% - 58px);
    }

    .portal-selected-event__content > a {
        margin-left: 56px;
    }
}

/* ==================================================
   CLIENT-CONFIGURED PUBLIC PORTAL THEME
================================================== */

.portal-public-body {
    background: var(--portal-mist);
}

.portal-public-body .portal-shell {
    position: relative;
    isolation: isolate;
}

.portal-public-overlay {
    position: absolute;
    inset: 77px 0 78px;
    z-index: -1;
    pointer-events: none;
    background:
        rgba(
            var(--portal-overlay-rgb, 0, 0, 0),
            var(--portal-overlay-opacity, 0.35)
        );
}

.portal-public-body .portal-header,
.portal-public-body .portal-footer {
    position: relative;
    z-index: 3;
}

.portal-public-body .portal-main {
    position: relative;
    z-index: 1;
}

/* Public headings and supporting copy shown over the background */

.portal-public-body .portal-page-heading h1,
.portal-public-body .portal-auth__intro h1 {
    color:
        var(
            --portal-public-text,
            var(--portal-text)
        );
}

.portal-public-body .portal-page-heading > p,
.portal-public-body .portal-auth__intro > p {
    color:
        var(
            --portal-public-muted-text,
            var(--portal-muted)
        );
}

.portal-public-body .portal-auth__intro .portal-eyebrow,
.portal-public-body .portal-page-heading .portal-eyebrow {
    color:
        var(
            --portal-public-text,
            var(--portal-primary)
        );
}

/* Login feature text */

.portal-public-body .portal-feature h2 {
    color:
        var(
            --portal-public-text,
            var(--portal-text)
        );
}

.portal-public-body .portal-feature p {
    color:
        var(
            --portal-public-muted-text,
            var(--portal-muted)
        );
}

/* Buttons using the client primary colour */

.portal-button--primary,
.portal-nav-button {
    color:
        var(
            --portal-primary-text,
            #ffffff
        );
}

/* Links and cards keep normal interface colours */

.portal-auth-card,
.portal-event-card,
.portal-empty,
.portal-alert {
    color: var(--portal-text);
}

/* Event-page footer prompt shown directly over the background */

.portal-public-body .portal-page-footer-action {
    color:
        var(
            --portal-public-muted-text,
            var(--portal-muted)
        );
}

.portal-public-body .portal-page-footer-action a {
    color:
        var(
            --portal-public-text,
            var(--portal-primary)
        );
}

/* Mobile header and footer height adjustment */

@media (max-width: 700px) {
    .portal-public-overlay {
        inset: 69px 0 96px;
    }
}

.portal-auth-card__icon--image {
    overflow: hidden;
    padding: 8px;
    background: #ffffff;
}

.portal-auth-card__icon--image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Four summary cards (profile, applications, organisation, department)
   share one row on wide screens; narrower screens keep the usual grid. */
@media (min-width: 1201px) {
    .portal-summary-grid--4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ==================================================
   PAGINATION
================================================== */

.portal-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.portal-pagination__summary {
    margin: 0;
    color: var(--portal-muted);
    font-size: 13px;
}

.portal-pagination__summary strong {
    color: var(--portal-text);
    font-weight: 600;
}

.portal-pagination__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.portal-pagination__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-small);
    background: var(--portal-surface);
    color: var(--portal-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: border-color 150ms ease, color 150ms ease;
}

a.portal-pagination__link:hover {
    border-color: var(--portal-primary);
    color: var(--portal-primary);
}

.portal-pagination__link.is-active {
    border-color: var(--portal-primary);
    background: var(--portal-primary);
    color: var(--portal-white);
}

.portal-pagination__link.is-disabled,
.portal-pagination__link.is-gap {
    color: var(--portal-grey);
    background: var(--portal-surface-soft);
}

.portal-pagination__link.is-gap {
    border-color: transparent;
    background: transparent;
}
