:root {
    --vic-navy-950: #03051a;
    --vic-navy-900: #05071f;
    --vic-navy-850: #090c2c;
    --vic-panel: rgba(10, 14, 45, 0.76);
    --vic-panel-strong: rgba(9, 12, 39, 0.93);
    --vic-border: rgba(182, 197, 255, 0.16);
    --vic-border-strong: rgba(182, 197, 255, 0.28);
    --vic-gold: #d8b329;
    --vic-cyan: #45c9db;
    --vic-orange: #f39a18;
    --vic-white: #f7f8ff;
    --vic-muted: #aeb3c6;
    --vic-faint: #7c829a;
    --font-display: "Montserrat", Arial, sans-serif;
    --font-body: "Space Grotesk", Arial, sans-serif;
    --portal-width: 1160px;
    --portal-radius: 18px;
    --portal-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ponytail: dam bao thuoc tinh [hidden] luon thang du class nao khac co khai
   bao display rieng (vd .auth-gate{display:flex}) - CSS tac gia mac dinh
   de bat "[hidden]{display:none}" cua trinh duyet neu co selector display
   khac cung do dac hieu dung sau trong cascade. */
[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    color: var(--vic-white);
    background: var(--vic-navy-900);
    font-family: var(--font-body);
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body::before {
    display: none;
}

a {
    color: inherit;
}

button,
input,
textarea {
    font: inherit;
}

img,
video,
svg {
    display: block;
}

.portal-shell {
    isolation: isolate;
    min-height: 100vh;
}

.portal-container {
    width: min(calc(100% - 48px), var(--portal-width));
    margin-inline: auto;
}

.portal-header {
    position: sticky;
    top: 14px;
    z-index: 50;
    width: min(calc(100% - 32px), var(--portal-width));
    height: 66px;
    margin: 14px auto 0;
    padding: 8px 12px 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border: 1px solid var(--vic-border);
    border-radius: 16px;
    background: rgba(7, 10, 38, 0.84);
    box-shadow: 0 12px 38px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(18px) saturate(135%);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.portal-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--vic-white);
    text-decoration: none;
}

.portal-brand img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex: 0 0 auto;
}

.portal-brand span {
    overflow: hidden;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-nav a {
    min-height: 40px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #d8dbea;
    font-family: var(--font-display);
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
    transition:
        color 240ms ease,
        background-color 240ms ease,
        border-color 240ms ease,
        transform 240ms var(--ease-out);
}

.portal-nav a:hover {
    color: var(--vic-white);
    background: rgba(255, 255, 255, 0.06);
}

.portal-nav .portal-action {
    border: 1px solid rgba(69, 201, 219, 0.42);
    color: var(--vic-cyan);
    background: rgba(69, 201, 219, 0.08);
}

.portal-nav .portal-action:hover {
    color: #071127;
    border-color: transparent;
    background: var(--vic-cyan);
    transform: translateY(-1px);
}

.portal-user-email {
    padding: 0 4px;
    color: #9aa0b8;
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}

.portal-signout {
    min-height: 40px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--vic-border);
    border-radius: 999px;
    background: transparent;
    color: #d8dbea;
    font-family: var(--font-display);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        color 240ms ease,
        background-color 240ms ease,
        border-color 240ms ease;
}

.portal-signout:hover {
    color: var(--vic-white);
    border-color: rgba(216, 179, 41, 0.42);
    background: rgba(216, 179, 41, 0.08);
}

.portal-main {
    position: relative;
}

.portal-eyebrow {
    margin: 0 0 14px;
    color: var(--vic-cyan);
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.portal-title {
    margin: 0;
    color: var(--vic-gold);
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 6.8vw, 5.9rem);
    font-weight: 900;
    line-height: 0.96;
    letter-spacing: -0.055em;
    text-transform: uppercase;
    text-wrap: balance;
}

.portal-title-shine {
    color: transparent;
    background-image: linear-gradient(
        105deg,
        var(--vic-gold) 0%,
        var(--vic-gold) 38%,
        #fff1a6 49%,
        var(--vic-gold) 60%,
        var(--vic-gold) 100%
    );
    background-size: 240% 100%;
    background-position: 100% center;
    background-clip: text;
    -webkit-background-clip: text;
    animation: portal-title-shine 5.5s ease-in-out 1.1s infinite;
}

.portal-lead {
    max-width: 680px;
    margin: 24px 0 0;
    color: #d5d8e4;
    font-size: clamp(1.02rem, 1.8vw, 1.24rem);
    line-height: 1.7;
}

.portal-actions {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.portal-button {
    min-height: 50px;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #071127;
    background: linear-gradient(105deg, var(--vic-cyan), var(--vic-orange));
    box-shadow: 0 12px 28px rgba(69, 201, 219, 0.14);
    font-family: var(--font-display);
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
    transition:
        transform 260ms var(--ease-out),
        box-shadow 260ms ease,
        filter 260ms ease;
}

.portal-button:hover {
    filter: saturate(112%) brightness(1.04);
    box-shadow: 0 16px 38px rgba(69, 201, 219, 0.2);
    transform: translateY(-3px);
}

.portal-button.is-secondary {
    color: var(--vic-white);
    border-color: var(--vic-border-strong);
    background: rgba(255, 255, 255, 0.035);
    box-shadow: none;
}

.portal-button.is-secondary:hover {
    border-color: rgba(69, 201, 219, 0.48);
    background: rgba(69, 201, 219, 0.08);
}

.portal-footer {
    position: relative;
    padding: 28px 0 34px;
    color: var(--vic-faint);
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.portal-footer::before {
    display: block;
    width: min(calc(100% - 48px), var(--portal-width));
    height: 1px;
    margin: 0 auto 28px;
    content: "";
    background: var(--vic-border);
}

.portal-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.portal-footer a {
    color: var(--vic-muted);
    text-decoration: none;
}

.portal-footer a:hover {
    color: var(--vic-cyan);
}

.js [data-reveal] {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
    transition:
        opacity 760ms ease var(--reveal-delay, 0ms),
        transform 860ms var(--ease-out) var(--reveal-delay, 0ms);
}

.js [data-reveal].is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(69, 201, 219, 0.78);
    outline-offset: 4px;
}

@keyframes portal-title-shine {
    0%, 58%, 100% {
        background-position: 100% center;
    }

    76% {
        background-position: -135% center;
    }
}

@media (max-width: 720px) {
    .portal-container {
        width: min(calc(100% - 32px), var(--portal-width));
    }

    .portal-header {
        top: 8px;
        width: calc(100% - 16px);
        height: 58px;
        margin-top: 8px;
        padding: 7px 8px 7px 12px;
        gap: 10px;
        border-radius: 14px;
    }

    .portal-brand {
        gap: 8px;
    }

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

    .portal-brand span {
        display: none;
    }

    .portal-nav a {
        min-height: 38px;
        padding-inline: 13px;
        font-size: 0.7rem;
    }

    /* ponytail: header qua chat de hien them email tren mobile (720px),
       giu dung nut Dang xuat la hanh dong can thiet. */
    .portal-user-email {
        display: none;
    }

    .portal-title {
        font-size: clamp(2.55rem, 14.5vw, 4rem);
        line-height: 0.98;
    }

    .portal-lead {
        margin-top: 20px;
        font-size: 1rem;
    }

    .portal-actions {
        margin-top: 24px;
    }

    .portal-button {
        min-height: 48px;
    }

    .portal-footer-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .js [data-reveal] {
        opacity: 1;
        transform: none;
    }
}
