:root {
    --portal-bg: #f5f7fb;
    --portal-panel: rgba(255, 255, 255, 0.92);
    --portal-panel-solid: #ffffff;
    --portal-border: rgba(20, 35, 58, 0.1);
    --portal-text: #132033;
    --portal-muted: #66758a;
    --portal-accent: #1463ff;
    --portal-accent-2: #16a67a;
    --portal-shadow: 0 22px 55px rgba(20, 35, 58, 0.12);
    --portal-radius: 22px;
}

[data-bs-theme="dark"] {
    --portal-bg: #0b1018;
    --portal-panel: rgba(21, 28, 41, 0.92);
    --portal-panel-solid: #151c29;
    --portal-border: rgba(177, 200, 230, 0.14);
    --portal-text: #eef4ff;
    --portal-muted: #94a3b8;
    --portal-shadow: 0 22px 55px rgba(0, 0, 0, 0.32);
}

* {
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

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

.user-portal-body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(20, 99, 255, .12), transparent 34rem),
        radial-gradient(circle at 85% 12%, rgba(22, 166, 122, .12), transparent 28rem),
        var(--portal-bg);
    color: var(--portal-text);
}

.user-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: color-mix(in srgb, var(--portal-panel-solid) 88%, transparent);
    border-bottom: 1px solid var(--portal-border);
    backdrop-filter: blur(14px);
}

.user-navbar-inner {
    min-height: 72px;
    gap: 16px;
}

.user-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--portal-text);
    font-weight: 850;
    letter-spacing: 0;
}

.user-brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.user-brand span {
    font-size: 1.2rem;
}

.portal-logo-lockup {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.portal-logo-lockup img {
    width: clamp(220px, 28vw, 390px);
    height: auto;
    max-height: 300px;
    object-fit: contain;
    filter: drop-shadow(0 18px 30px rgba(20, 99, 255, .16));
}

.user-nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}

.user-page {
    padding: 28px 0 56px;
}

.user-footer {
    padding: 20px 0 28px;
    color: var(--portal-muted);
    font-size: .78rem;
}

.user-footer-inner {
    display: grid;
    grid-template-columns: minmax(190px, .35fr) minmax(0, 1fr);
    gap: 12px 22px;
    border-top: 1px solid var(--portal-border);
    padding-top: 16px;
    line-height: 1.55;
}

.user-flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.portal-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
    gap: 22px;
    align-items: stretch;
}

.portal-card,
.auth-card {
    background: var(--portal-panel);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
}

.portal-card {
    padding: clamp(22px, 4vw, 42px);
}

.portal-kicker {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(22, 166, 122, .1);
    color: var(--portal-accent-2);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.portal-title {
    margin: 18px 0 12px;
    font-size: clamp(2rem, 5vw, 4.4rem);
    line-height: .98;
    font-weight: 900;
    letter-spacing: 0;
}

.portal-lead {
    max-width: 680px;
    color: var(--portal-muted);
    font-size: clamp(1rem, 2vw, 1.18rem);
    line-height: 1.65;
}

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

.portal-service-grid {
    display: grid;
    gap: 14px;
}

.portal-step-hint {
    margin-bottom: 16px;
    padding: 16px 18px;
    border: 1px solid rgba(22, 166, 122, .22);
    border-radius: 16px;
    background: rgba(22, 166, 122, .08);
    color: color-mix(in srgb, var(--portal-accent-2) 72%, var(--portal-text));
    font-size: 1.05rem;
    font-weight: 850;
    line-height: 1.45;
}

.portal-service-card {
    display: grid;
    gap: 7px;
    padding: 18px;
    border: 1px solid var(--portal-border);
    border-radius: 18px;
    background: color-mix(in srgb, var(--portal-panel-solid) 82%, transparent);
    text-decoration: none;
    color: var(--portal-text);
}

.portal-service-card:hover {
    border-color: rgba(20, 99, 255, .35);
    transform: translateY(-1px);
}

.portal-service-card strong {
    font-size: 1.05rem;
}

.portal-service-card span {
    color: var(--portal-muted);
    line-height: 1.45;
}

.portal-note {
    margin-top: 22px;
    padding: 16px;
    border: 1px solid rgba(22, 166, 122, .18);
    border-radius: 16px;
    color: var(--portal-muted);
    background: rgba(22, 166, 122, .07);
}

.auth-shell {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 156px);
}

.auth-card {
    width: min(100%, 500px);
    padding: clamp(22px, 4vw, 36px);
}

.auth-card-wide {
    width: min(100%, 720px);
}

.auth-header {
    margin-bottom: 22px;
}

.auth-header h1 {
    margin: 0 0 8px;
    font-size: clamp(1.75rem, 4vw, 2.55rem);
    font-weight: 900;
    letter-spacing: 0;
}

.auth-header p {
    margin: 0;
    color: var(--portal-muted);
    line-height: 1.55;
}

.auth-card .form-label {
    color: var(--portal-muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.auth-card .form-control {
    min-height: 48px;
    border-radius: 14px;
}

.auth-card .btn {
    border-radius: 14px;
}

.qr-box {
    display: inline-block;
    padding: 16px;
    border: 1px solid var(--portal-border);
    border-radius: 20px;
    background: #fff;
}

.secret-copy {
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    padding: 13px;
    background: color-mix(in srgb, var(--portal-panel-solid) 86%, transparent);
    cursor: pointer;
    word-break: break-all;
    font-weight: 850;
}

.profile-shell .profile-card {
    border: 1px solid var(--portal-border) !important;
    border-radius: 20px !important;
    box-shadow: var(--portal-shadow) !important;
}

.profile-shell .profile-avatar {
    background: linear-gradient(135deg, var(--portal-accent), var(--portal-accent-2)) !important;
}

.profile-ticket-chat,
.profile-ticket-item,
.profile-meta-card {
    border-color: var(--portal-border) !important;
}

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

    .user-navbar-inner {
        align-items: flex-start;
    }
}

@media (max-width: 575.98px) {
    .user-page {
        padding-top: 14px;
        padding-bottom: 132px;
    }

    .user-navbar {
        position: static;
    }

    .user-navbar-inner {
        min-height: 64px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .user-brand img {
        width: 42px;
        height: 42px;
    }

    .user-brand span {
        font-size: 1.05rem;
    }

    .portal-logo-lockup img {
        width: min(74vw, 270px);
        max-height: 220px;
    }

    .user-nav-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        justify-content: stretch;
        gap: 10px;
    }

    .user-nav-actions .btn,
    .user-nav-actions form {
        width: 100%;
    }

    .user-nav-actions form .btn {
        width: 100%;
    }

    .portal-card,
    .auth-card {
        border-radius: 18px;
        padding: 18px;
    }

    .portal-hero {
        gap: 14px;
    }

    .portal-title {
        font-size: clamp(2.05rem, 12vw, 3.25rem);
        line-height: 1.02;
    }

    .portal-lead {
        font-size: 1rem;
        line-height: 1.55;
    }

    .portal-service-card {
        padding: 16px;
        border-radius: 16px;
    }

    .portal-actions .btn {
        width: 100%;
    }

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