:root {
    --primary: #ff4b2b;
    --secondary: #ff416c;
    --ink: #171717;
    --muted: #667085;
    --soft: #f8fafc;
    --line: rgba(228, 228, 231, 0.9);
    --surface: rgba(255, 255, 255, 0.92);
    --shadow: 0 22px 60px rgba(15, 23, 42, 0.14);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Montserrat", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(
            circle at 12% 0%,
            rgba(255, 65, 108, 0.16),
            transparent 30rem
        ),
        radial-gradient(
            circle at 88% 4%,
            rgba(255, 75, 43, 0.15),
            transparent 28rem
        ),
        linear-gradient(180deg, #fff7f5 0%, #f6f5f7 45%, #f8fafc 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.7) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.56),
        transparent 66%
    );
}

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

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

.portal-page {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 52px;
}

.hero-section {
    position: relative;
    min-height: 300px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 34px;
    background:
        radial-gradient(
            circle at 12% 22%,
            rgba(255, 255, 255, 0.18),
            transparent 18rem
        ),
        radial-gradient(
            circle at 84% 12%,
            rgba(255, 255, 255, 0.14),
            transparent 20rem
        ),
        linear-gradient(135deg, rgba(24, 24, 27, 0.96), rgba(39, 39, 42, 0.86)),
        linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    box-shadow: var(--shadow);
}

.hero-section::after {
    content: "";
    position: absolute;
    right: -90px;
    bottom: -110px;
    width: 310px;
    height: 310px;
    border: 44px solid rgba(255, 255, 255, 0.07);
    border-radius: 50%;
}

.topbar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    display: inline-flex;
    flex: 0 0 46px;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    overflow: hidden;
    border-radius: 17px;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(255, 65, 108, 0.34);
}

.brand-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.brand-mark {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 17px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    font-weight: 800;
    box-shadow: 0 14px 30px rgba(255, 65, 108, 0.34);
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    line-height: 1.1;
}

.brand small {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.64);
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

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

.text-link,
.primary-link,
.logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 999px;
    padding: 0 17px;
    font-size: 13px;
    font-weight: 800;
    transition:
        transform 0.16s ease,
        background-color 0.16s ease,
        color 0.16s ease;
}

.text-link {
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.78);
    background: rgba(255, 255, 255, 0.06);
}

.primary-link {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

.user-menu {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.user-display-name {
    max-width: 180px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu form {
    margin: 0;
}

.logout-button {
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    padding: 0 15px;
    background: transparent;
    color: #ffffff;
    font-family: inherit;
    cursor: pointer;
}

.text-link:hover,
.primary-link:hover,
.logout-button:hover {
    transform: translateY(-1px);
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 46px 34px 62px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 10px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.8px;
    text-transform: uppercase;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    max-width: 760px;
}

.hero-stats div {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 24px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(14px);
}

.hero-stats div::after {
    content: "";
    position: absolute;
    right: -18px;
    top: -18px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.hero-stats strong,
.hero-stats span {
    display: block;
    position: relative;
    z-index: 1;
}

.hero-stats strong {
    margin-bottom: 7px;
    font-size: clamp(30px, 5vw, 44px);
    line-height: 1;
    letter-spacing: -1px;
}

.hero-stats span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.services-section {
    position: relative;
    z-index: 2;
    margin-top: -34px;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 30px;
    padding: 30px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

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

.section-heading h2 {
    margin-bottom: 0;
    font-size: clamp(28px, 4vw, 42px);
    letter-spacing: -1.2px;
}

.section-heading p {
    max-width: 440px;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

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

.service-card,
.empty-state {
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.service-card {
    display: flex;
    min-height: 314px;
    flex-direction: column;
    padding: 20px;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.service-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 75, 43, 0.34);
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.12);
}

.service-card-header {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 17px;
}

.service-logo {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    overflow: hidden;
    border-radius: 20px;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(
                135deg,
                rgba(255, 75, 43, 0.55),
                rgba(255, 65, 108, 0.45)
            )
            border-box;
    border: 1px solid transparent;
    color: var(--primary);
    font-size: 20px;
    font-weight: 800;
    box-shadow: 0 12px 26px rgba(255, 75, 43, 0.12);
}

.service-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-meta {
    min-width: 0;
}

.service-meta h3 {
    margin-bottom: 5px;
    font-size: 18px;
    line-height: 1.25;
}

.service-meta span {
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.service-description {
    min-height: 50px;
    margin-bottom: 15px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.tag-row span {
    border: 1px solid #eceff3;
    border-radius: 999px;
    padding: 7px 10px;
    background: var(--soft);
    color: #52525b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.redirect-list {
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 12px;
}

.redirect-list summary {
    cursor: pointer;
    font-weight: 800;
}

.redirect-list ul {
    margin: 10px 0 0;
    padding-left: 18px;
}

.redirect-list li {
    overflow-wrap: anywhere;
    line-height: 1.6;
}

.service-actions {
    margin-top: auto;
}

.launch-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(255, 75, 43, 0.22);
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease;
}

.launch-button:hover:not(.is-disabled) {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(255, 75, 43, 0.28);
}

.launch-button.is-disabled {
    background: #e4e4e7;
    color: #71717a;
    box-shadow: none;
    cursor: not-allowed;
}

.empty-state {
    padding: 68px 24px;
    text-align: center;
}

.empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    margin-bottom: 18px;
    border-radius: 24px;
    background: rgba(255, 75, 43, 0.1);
    color: var(--primary);
    font-size: 32px;
    font-weight: 800;
}

.empty-state h3 {
    margin-bottom: 8px;
    font-size: 24px;
}

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

@media (max-width: 1024px) {
    .portal-page {
        width: min(100% - 28px, 1180px);
    }

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

@media (max-width: 760px) {
    body {
        background:
            radial-gradient(
                circle at 18% 0%,
                rgba(255, 65, 108, 0.15),
                transparent 22rem
            ),
            linear-gradient(180deg, #fff7f5 0%, #f8fafc 100%);
    }

    .portal-page {
        width: min(100% - 20px, 1180px);
        padding: 10px 0 30px;
    }

    .hero-section,
    .services-section {
        border-radius: 22px;
    }

    .hero-section {
        min-height: auto;
    }

    .hero-section::after {
        right: -150px;
        bottom: -170px;
    }

    .topbar {
        align-items: stretch;
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    .brand-logo,
    .brand-mark {
        width: 42px;
        height: 42px;
    }

    .brand-logo {
        flex-basis: 42px;
    }

    .topbar-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        gap: 8px;
    }

    .text-link,
    .primary-link,
    .logout-button {
        min-height: 42px;
        padding: 0 12px;
        font-size: 12px;
    }

    .user-menu {
        justify-content: space-between;
    }

    .user-display-name {
        max-width: 45vw;
    }

    .hero-content {
        padding: 22px 16px 54px;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .hero-stats div {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        min-height: 78px;
        border-radius: 18px;
        padding: 16px;
    }

    .hero-stats strong {
        margin-bottom: 0;
        font-size: 34px;
    }

    .hero-stats span {
        text-align: right;
    }

    .services-section {
        margin-top: -24px;
        padding: 18px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 18px;
    }

    .section-heading h2 {
        font-size: 28px;
    }

    .section-heading p {
        font-size: 13px;
    }

    .service-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .service-card {
        min-height: auto;
        border-radius: 21px;
        padding: 16px;
    }

    .service-logo {
        width: 52px;
        height: 52px;
        border-radius: 18px;
    }

    .service-meta h3 {
        font-size: 16px;
    }

    .service-description {
        min-height: auto;
        font-size: 12px;
    }

    .tag-row span {
        padding: 6px 9px;
    }

    .launch-button {
        min-height: 44px;
    }
}

@media (max-width: 420px) {
    .portal-page {
        width: min(100% - 14px, 1180px);
    }

    .brand small {
        font-size: 10px;
        letter-spacing: 1px;
    }

    .topbar-actions {
        grid-template-columns: 1fr;
    }

    .hero-content {
        padding-bottom: 46px;
    }

    .hero-stats div {
        min-height: 72px;
    }

    .hero-stats strong {
        font-size: 30px;
    }

    .services-section {
        padding: 14px;
    }

    .service-card-header {
        align-items: flex-start;
    }
}
