:root {
    --bb-blue-950: #031a3d;
    --bb-blue-900: #052b60;
    --bb-blue-800: #073f83;
    --bb-blue-700: #0b63b6;
    --bb-blue-500: #15a8e6;
    --bb-red: #d71920;
    --bb-gold: #d8a91f;
    --bb-gold-light: #ffe58d;
    --bb-ink: #102941;
    --bb-muted: #688197;
    --bb-border: #dce7f1;
    --bb-soft: #f4f8fc;
    --bb-white: #ffffff;
}

* { box-sizing: border-box; }

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

.premium-body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--bb-ink);
    background: #edf4fb;
}

.premium-body a { transition: .22s ease; }

.premium-auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 14% 18%, rgba(21,168,230,.18), transparent 34%),
        radial-gradient(circle at 85% 10%, rgba(215,25,32,.11), transparent 28%),
        linear-gradient(135deg, #eef6fd 0%, #f9fbfd 48%, #e7f0f8 100%);
}

.premium-auth-shell {
    min-height: 100vh;
    padding: 34px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.premium-auth-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(8px);
    pointer-events: none;
    opacity: .7;
}

.premium-auth-orb-one {
    width: 330px;
    height: 330px;
    left: -130px;
    top: 12%;
    background: radial-gradient(circle, rgba(17,118,201,.2), rgba(17,118,201,0));
}

.premium-auth-orb-two {
    width: 380px;
    height: 380px;
    right: -160px;
    bottom: 4%;
    background: radial-gradient(circle, rgba(216,169,31,.18), rgba(216,169,31,0));
}

.premium-auth-card {
    width: min(1180px, 100%);
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(300px, 38%) 1fr;
    background: rgba(255,255,255,.95);
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 28px;
    box-shadow: 0 28px 80px rgba(19,55,89,.18);
    overflow: hidden;
    backdrop-filter: blur(18px);
}

.premium-brand-panel {
    position: relative;
    overflow: hidden;
    padding: 54px 42px;
    background:
        linear-gradient(145deg, rgba(2,38,88,.98), rgba(7,92,157,.96)),
        #073b78;
    color: #fff;
}

.premium-brand-panel::before,
.premium-brand-panel::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.14);
}

.premium-brand-panel::before {
    width: 420px;
    height: 420px;
    left: -210px;
    bottom: -170px;
}

.premium-brand-panel::after {
    width: 260px;
    height: 260px;
    right: -140px;
    top: -80px;
}

.premium-brand-link { display: inline-block; position: relative; z-index: 2; }

.premium-logo {
    width: min(275px, 100%);
    height: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.premium-eyebrow {
    display: inline-block;
    margin-top: 32px;
    color: var(--bb-gold-light);
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
    font-size: 12px;
}

.premium-brand-panel h1 {
    margin: 11px 0 13px;
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.04;
    letter-spacing: -.03em;
}

.premium-brand-panel p {
    margin: 0;
    max-width: 440px;
    color: rgba(255,255,255,.84);
    line-height: 1.75;
    font-size: 16px;
}

.premium-trust-row {
    margin-top: 34px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 13px;
    color: rgba(255,255,255,.9);
}

.premium-trust-row i { width: 22px; color: var(--bb-gold-light); }

.premium-form-panel { padding: 28px 34px 24px; min-width: 0; }

.premium-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 6px;
    background: #eef4f9;
    border-radius: 16px;
    margin-bottom: 24px;
}

.premium-tabs .nav-item { margin: 0; }
.premium-tabs .nav-link {
    border: 0;
    border-radius: 12px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 14px;
    color: #49657d;
    font-size: 14px;
    font-weight: 800;
}

.premium-tabs .nav-link.active {
    background: #fff;
    color: var(--bb-blue-800);
    box-shadow: 0 6px 18px rgba(33,74,111,.11);
}

.premium-tab-content { min-height: 520px; }

.premium-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--bb-border);
}

.premium-section-title > span {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--bb-blue-800), var(--bb-blue-500));
    color: #fff;
    font-weight: 900;
    font-size: 12px;
    box-shadow: 0 7px 17px rgba(11,99,182,.2);
}

.premium-section-title strong { display: block; color: var(--bb-blue-950); font-size: 15px; }
.premium-section-title small { color: var(--bb-muted); font-size: 12px; }

.premium-form-panel label { color: #29475f; font-size: 13px; font-weight: 800; }
.premium-form-panel label b { color: var(--bb-red); }

.premium-form-panel .form-control {
    height: 46px;
    border: 1px solid #cad9e6;
    border-radius: 11px;
    color: #17324d;
    background: #fff;
    box-shadow: none;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.premium-form-panel textarea.form-control { height: auto; min-height: 90px; }
.premium-form-panel .form-control:focus {
    border-color: #5aa8df;
    box-shadow: 0 0 0 3px rgba(48,145,214,.12);
}

.premium-file-box {
    position: relative;
    height: 48px;
    border: 1px dashed #9db8ce;
    border-radius: 11px;
    background: #f7fbff;
    overflow: hidden;
}

.premium-file-box input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.premium-file-box span {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 9px;
    font-size: 13px;
    color: #45657d;
    font-weight: 700;
}

.premium-file-box i { color: var(--bb-blue-700); }

.premium-consent-box {
    background: #f7fafc;
    border: 1px solid #dce8f1;
    border-radius: 13px;
    padding: 14px 14px 14px 42px;
}

.premium-consent-box .custom-control-label { font-weight: 600; line-height: 1.55; color: #536b7f; }

.premium-primary-btn {
    border: 0;
    color: #fff !important;
    font-weight: 900;
    letter-spacing: .01em;
    border-radius: 12px;
    min-height: 48px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--bb-blue-800), var(--bb-blue-500));
    box-shadow: 0 11px 22px rgba(11,99,182,.24);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.premium-primary-btn:hover,
.premium-primary-btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(11,99,182,.3);
    filter: saturate(1.08);
}

.premium-primary-btn:disabled { opacity: .7; transform: none; }

.premium-otp-panel,
.premium-forgot-panel {
    border: 1px solid #dce8f2;
    border-radius: 18px;
    padding: 26px;
    background: linear-gradient(180deg, #fbfdff, #f5f9fd);
}

.premium-otp-panel { text-align: center; margin-top: 12px; }
.premium-otp-icon,
.premium-login-icon {
    width: 66px;
    height: 66px;
    margin: 0 auto 14px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    font-size: 26px;
    color: #fff;
    background: linear-gradient(135deg, var(--bb-blue-800), var(--bb-blue-500));
    box-shadow: 0 12px 28px rgba(11,99,182,.23);
}

.premium-otp-panel h3,
.premium-login-heading h2 { color: var(--bb-blue-950); font-weight: 900; margin-bottom: 8px; }
.premium-otp-panel p,
.premium-login-heading p,
.premium-forgot-panel p { color: var(--bb-muted); line-height: 1.6; }

.premium-otp-input {
    text-align: center;
    letter-spacing: .5em;
    font-size: 24px;
    font-weight: 900;
    color: var(--bb-blue-800) !important;
}

.premium-login-heading { text-align: center; padding: 22px 0 16px; }
.premium-login-icon { background: linear-gradient(145deg, #b9860a, #f7d769); color: #4c3200; }
.premium-forgot-link { font-weight: 800; }
.premium-forgot-panel { margin-top: 18px; }
.premium-forgot-panel h4 { color: var(--bb-blue-900); font-weight: 900; }
.premium-form-footer { margin-top: 22px; text-align: center; }
.premium-form-footer a { color: #69839a; text-decoration: none; font-weight: 700; font-size: 13px; }
.premium-form-footer a:hover { color: var(--bb-blue-700); }

.premium-server-alert,
#premiumSignupAlert .alert,
#premiumLoginAlert .alert,
#premiumForgotAlert .alert {
    border: 0;
    border-radius: 12px;
    font-size: 13px;
}

/* Thank-you */
.premium-thankyou-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% 0%, rgba(32,152,219,.24), transparent 38%),
        linear-gradient(145deg, #041f48 0%, #07598e 58%, #072e68 100%);
}

.premium-thankyou-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.premium-thankyou-card {
    width: min(700px, 100%);
    padding: 40px;
    border-radius: 26px;
    background: rgba(255,255,255,.97);
    box-shadow: 0 30px 80px rgba(0,0,0,.28);
    text-align: center;
    border: 1px solid rgba(255,255,255,.65);
}

.premium-thankyou-logo {
    width: min(245px, 75%);
    height: auto;
    margin-bottom: 22px;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}
.premium-success-ring {
    width: 82px;
    height: 82px;
    margin: 0 auto 8px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 32px;
    background: linear-gradient(145deg, #1ea66a, #58cc90);
    box-shadow: 0 12px 30px rgba(22,147,89,.25);
}

.premium-thankyou-card .premium-eyebrow { color: var(--bb-red); margin-top: 16px; }
.premium-thankyou-card h1 { font-weight: 900; color: var(--bb-blue-900); margin: 10px 0 16px; }
.premium-thankyou-card p { color: #5d7489; line-height: 1.75; }
.premium-thankyou-lead { font-size: 17px; color: #334f67 !important; }

.premium-redirect-box {
    margin: 25px 0;
    display: grid;
    place-items: center;
    gap: 6px;
    padding: 18px;
    border-radius: 16px;
    background: #f2f7fc;
    border: 1px solid #dbe8f3;
    color: #49657d;
}

.premium-redirect-spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid #d1e0ec;
    border-top-color: var(--bb-blue-700);
    animation: premiumSpin .8s linear infinite;
}

@keyframes premiumSpin { to { transform: rotate(360deg); } }

/* Portal */
.premium-portal-page {
    margin: 0;
    overflow-x: hidden;
    background: #020e2a;
}

.premium-portal-stage {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(ellipse at 50% 88%, rgba(18,85,165,.48), transparent 42%),
        radial-gradient(ellipse at 50% 25%, rgba(34,99,188,.3), transparent 40%),
        linear-gradient(180deg, #010821 0%, #031e52 52%, #072e68 100%);
}

#premiumStarCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.premium-nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(42px);
    opacity: .24;
    pointer-events: none;
    z-index: 1;
}
.premium-nebula-a { width: 520px; height: 520px; left: -190px; top: 18%; background: #0f78db; }
.premium-nebula-b { width: 440px; height: 440px; right: -170px; bottom: 6%; background: #6e2ec9; }

.premium-portal-header {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 18px;
    padding: 16px clamp(18px, 4vw, 48px);
    background: linear-gradient(180deg, rgba(1,8,33,.84), rgba(1,8,33,.22));
    border-bottom: 1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(12px);
}

.premium-portal-logo {
    width: 180px;
    max-width: 42vw;
    height: auto;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}
.premium-portal-member-meta { text-align: right; line-height: 1.25; }
.premium-portal-member-meta span { display: block; font-weight: 800; }
.premium-portal-member-meta small { color: rgba(255,255,255,.62); }
.premium-portal-logout {
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.08);
    color: #fff;
    padding: 9px 13px;
    border-radius: 10px;
    font-weight: 700;
}
.premium-portal-logout:hover { background: rgba(255,255,255,.16); }

.premium-door-zone {
    position: relative;
    z-index: 3;
    min-height: calc(100vh - 90px);
    padding: 30px 16px 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.premium-door-intro {
    text-align: center;
    max-width: 820px;
    margin-bottom: 20px;
}
.premium-door-intro .premium-eyebrow { margin-top: 0; color: #ffe88d; }
.premium-door-intro h1 {
    margin: 8px 0 7px;
    font-size: clamp(32px, 4vw, 54px);
    line-height: 1.05;
    font-weight: 900;
    text-shadow: 0 4px 26px rgba(0,0,0,.35);
}
.premium-door-intro p {
    margin: 0;
    color: rgba(255,255,255,.7);
    font-size: 15px;
}

/*
 * The attached golden-door photograph is the door surface itself.
 * The scene is deliberately larger than v1 and retains GPU-backed 3D opening.
 */
.premium-door-scene {
    width: min(680px, 95vw);
    aspect-ratio: 585 / 777;
    position: relative;
    perspective: 2100px;
    transform-style: preserve-3d;
    margin-top: 8px;
    isolation: isolate;
}

.premium-door-aura {
    position: absolute;
    inset: 5% -15% -6%;
    border-radius: 44%;
    background:
        radial-gradient(ellipse, rgba(255,218,95,.38) 0%, rgba(54,151,255,.19) 34%, rgba(0,0,0,0) 72%);
    filter: blur(30px);
    animation: premiumAura 3.8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes premiumAura {
    50% { transform: scale(1.06); opacity: .82; }
}

.premium-door-frame {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
}

/* No rectangular frame around the cut-out door. */
.premium-door-frame::after {
    display: none;
}

.premium-door-interior {
    position: absolute;
    z-index: 1;
    inset: 0;
    overflow: hidden;
    /* Match the transparent door silhouette so no rectangular panel is visible. */
    border-radius: 50% 50% 1.5% 1.5% / 36.5% 36.5% 1.5% 1.5%;
    background:
        radial-gradient(circle at 50% 38%, rgba(255,255,255,.99), rgba(255,231,145,.96) 18%, rgba(237,177,37,.72) 42%, rgba(28,65,128,.5) 72%, #06122d 100%);
    box-shadow: inset 0 0 52px rgba(5,15,43,.5);
}

.premium-interior-light {
    position: absolute;
    inset: -20%;
    background:
        conic-gradient(from 0deg, transparent, rgba(255,255,255,.62), transparent 28%, rgba(255,229,132,.43), transparent 58%, rgba(255,255,255,.5), transparent);
    animation: premiumInteriorSpin 14s linear infinite;
    filter: blur(8px);
}
@keyframes premiumInteriorSpin { to { transform: rotate(360deg); } }

.premium-interior-message {
    position: absolute;
    inset: 0;
    padding: 18%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #14264c;
    text-shadow: 0 1px 0 rgba(255,255,255,.55);
    opacity: .15;
    transform: scale(.9);
    transition: opacity .8s ease .42s, transform .8s ease .42s;
}
.premium-interior-message i { font-size: 48px; color: #8d5c06; margin-bottom: 15px; }
.premium-interior-message span { font-size: 11px; font-weight: 900; letter-spacing: .16em; }
.premium-interior-message strong { margin-top: 8px; font-size: clamp(18px, 4vw, 29px); line-height: 1.1; }
.premium-interior-message small { margin-top: 12px; line-height: 1.5; }

.premium-golden-door {
    position: absolute;
    z-index: 5;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    margin: 0;
    overflow: visible;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    transform-origin: left center;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform, filter;
    filter:
        drop-shadow(0 30px 28px rgba(0,0,0,.48))
        drop-shadow(0 0 24px rgba(239,188,42,.24));
    transition:
        transform 1.8s cubic-bezier(.18,.74,.12,1),
        filter .6s ease;
}

.premium-golden-door:focus-visible {
    outline: 3px solid #ffe27b;
    outline-offset: 7px;
}

.premium-golden-door-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    filter: saturate(1.09) contrast(1.035) brightness(1.015);
}

.premium-door-scene.is-open .premium-golden-door {
    transform: rotateY(-108deg) translateZ(2px);
    filter:
        brightness(.92)
        drop-shadow(56px 18px 34px rgba(0,0,0,.52))
        drop-shadow(0 0 18px rgba(255,213,89,.14));
}

.premium-door-scene.is-open .premium-interior-message {
    opacity: 1;
    transform: scale(1);
}

/* Pointer/touch hint: only the hand icon appears after user movement/touch. */
.premium-knock-hint {
    position: absolute;
    z-index: 12;
    left: 50.5%;
    top: 62.5%;
    transform: translate(-50%, -50%) scale(.72);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .28s cubic-bezier(.2,.8,.2,1);
    filter:
        drop-shadow(0 4px 3px rgba(0,0,0,.65))
        drop-shadow(0 0 12px rgba(255,219,95,.55));
}

.premium-door-scene.show-hint .premium-knock-hint {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.premium-door-scene.is-open .premium-knock-hint { opacity: 0 !important; }

.premium-hint-finger {
    display: block;
    font-size: clamp(50px, 6.5vw, 72px);
    line-height: 1;
    color: #fff4c3;
    transform-origin: 50% 88%;
    animation: premiumKnockFinger .92s ease-in-out infinite;
}

@keyframes premiumKnockFinger {
    0%, 100% { transform: translate3d(13px, 1px, 0) rotate(-15deg) scale(1); }
    45% { transform: translate3d(-9px, -1px, 0) rotate(-24deg) scale(.97); }
    58% { transform: translate3d(1px, 0, 0) rotate(-18deg) scale(1); }
}

.premium-knock-ripple {
    position: absolute;
    z-index: 10;
    left: 50.5%;
    top: 62.5%;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 2px solid rgba(255,240,160,.94);
    opacity: 0;
    pointer-events: none;
}
.premium-door-scene.knocking .premium-knock-ripple { animation: premiumRipple .7s ease-out; }
.premium-door-scene.knocking .premium-knock-ripple-two { animation-delay: .13s; }
@keyframes premiumRipple {
    0% { opacity: .95; transform: translate(-50%,-50%) scale(.4); }
    100% { opacity: 0; transform: translate(-50%,-50%) scale(5.4); }
}

/* Keep dynamic status accessible without adding another visible portal icon/text element. */
.premium-door-status {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 900px) {
    .premium-auth-card { grid-template-columns: 1fr; max-width: 760px; }
    .premium-brand-panel { padding: 32px 28px; }
    .premium-brand-panel h1 { font-size: 34px; }
    .premium-trust-row { flex-direction: row; flex-wrap: wrap; }
    .premium-form-panel { padding: 24px; }
}

@media (max-width: 575.98px) {
    .premium-auth-shell { padding: 12px; align-items: flex-start; }
    .premium-auth-card { border-radius: 20px; }
    .premium-brand-panel { padding: 24px 20px; }
    .premium-brand-panel p { font-size: 14px; }
    .premium-logo { width: 210px; }
    .premium-form-panel { padding: 18px 14px 20px; }
    .premium-tabs { grid-template-columns: 1fr; }
    .premium-tabs .nav-link { min-height: 46px; }
    .premium-section-title { margin-top: 20px; }
    .premium-thankyou-card { padding: 28px 20px; }

    .premium-portal-header {
        grid-template-columns: 1fr auto;
        padding: 12px 14px;
    }
    .premium-portal-member-meta { display: none; }
    .premium-portal-logo { width: 145px; }
    .premium-portal-logout { font-size: 0; padding: 9px 11px; }
    .premium-portal-logout i { font-size: 15px; }
    .premium-door-zone { padding-top: 20px; justify-content: flex-start; }
    .premium-door-intro { margin-top: 8px; margin-bottom: 12px; }
    .premium-door-intro h1 { font-size: 30px; }
    .premium-door-scene { width: min(500px, 96vw); }
}

@media (prefers-reduced-motion: reduce) {
    .premium-body *,
    .premium-body *::before,
    .premium-body *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
    .premium-golden-door { transition-duration: .5s; }
}
