/* ========== PROFILE MODAL — Exact Auth-Modal D.A. (Neo-Brutalist Deep Space) ========== */

/* ----------------------------------------------------------------
   OVERLAY — Transparent, floats above the page (same as auth-modal)
   ---------------------------------------------------------------- */
.profile-modal-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    padding: 24px;
}

.profile-modal-overlay.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

/* ----------------------------------------------------------------
   MODAL PANEL — Exact same treatment as .auth-modal
   Solid #030712 bg, white 0.08 border, heavy black shadow
   ---------------------------------------------------------------- */
.profile-modal {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    background: rgba(3, 7, 18, 0);
    border: 1px solid rgba(255, 255, 255, 0);
    border-radius: 0;
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    box-shadow: none;
    pointer-events: auto;
    overflow: hidden;

    /* EXIT: bg/border vanish slowly */
    transition:
        background 0.5s ease 0.6s,
        border-color 0.5s ease 0.6s,
        box-shadow 0.5s ease 0.6s;
}

.profile-modal-overlay.active .profile-modal {
    /* EXACT same as auth-modal: solid dark, subtle white border */
    background: #030712;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 1), 0 30px 60px rgba(0, 0, 0, 0.8);

    /* ENTER: wait for brackets 0.6s */
    transition:
        background 0.6s ease 0.6s,
        border-color 0.6s ease 0.6s,
        box-shadow 0.6s ease 0.6s;
}


/* ----------------------------------------------------------------
   LAYOUT ZONES — Sticky header + scrollable body
   ---------------------------------------------------------------- */
.pm-sticky-top {
    flex-shrink: 0;
    padding: 32px 32px 0;
    position: relative;
    z-index: 20;
}

.pm-scroll-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px 32px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}
.pm-scroll-body::-webkit-scrollbar { width: 3px; }
.pm-scroll-body::-webkit-scrollbar-track { background: transparent; }
.pm-scroll-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0;
}
.pm-scroll-body::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }


/* ----------------------------------------------------------------
   CORNER BRACKETS — Identical to auth-modal (cyan, from center)
   ---------------------------------------------------------------- */
.profile-modal::before {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    border-top: 2px solid #06b6d4;
    border-left: 2px solid #06b6d4;
    pointer-events: none;
    top: 50%; left: 50%;
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s;
    z-index: 10;
}
.profile-modal-overlay.active .profile-modal::before {
    top: 0; left: 0; opacity: 1;
    transition: all 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0s;
}

.profile-modal::after {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    border-bottom: 2px solid #06b6d4;
    border-right: 2px solid #06b6d4;
    pointer-events: none;
    bottom: 50%; right: 50%;
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s;
    z-index: 10;
}
.profile-modal-overlay.active .profile-modal::after {
    bottom: 0; right: 0; opacity: 1;
    transition: all 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0s;
}


/* ----------------------------------------------------------------
   CONTENT FADE-IN — Same staggered entrance as auth-modal
   ---------------------------------------------------------------- */
.profile-modal .pm-close,
.profile-modal .pm-sticky-top,
.profile-modal .pm-scroll-body {
    opacity: 0 !important;
    transform: scale(0.95);
    transition: opacity 0.3s ease 0s, transform 0.3s ease 0s;
}
.profile-modal-overlay.active .pm-close,
.profile-modal-overlay.active .pm-sticky-top,
.profile-modal-overlay.active .pm-scroll-body {
    opacity: 1 !important;
    transform: scale(1);
    transition: opacity 0.8s ease 0.6s, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.6s;
}

/* Hard reset utility (matching auth-modal) */
.profile-modal.no-transition,
.profile-modal.no-transition *,
.profile-modal.no-transition::before,
.profile-modal.no-transition::after {
    transition: none !important;
    animation: none !important;
}


/* ----------------------------------------------------------------
   CLOSE BUTTON — Same as auth-modal .modal-close
   ---------------------------------------------------------------- */
.pm-close {
    position: absolute;
    top: 24px; right: 24px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s;
    z-index: 50;
    display: flex;
}
.pm-close:hover { color: #f8fafc; transform: rotate(90deg); }


/* ----------------------------------------------------------------
   HEADER — Avatar + Name + Email (compact, clean)
   ---------------------------------------------------------------- */
.pm-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}
.pm-avatar-container {
    position: relative;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}
.pm-avatar {
    width: 100%;
    height: 100%;
    background: transparent;
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: #06b6d4;
    font-weight: 700;
    font-size: 1.1rem;
    font-family: 'Space Grotesk', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    z-index: 2;
    position: relative;
}
.pm-avatar-glow {
    display: none; /* No glow — matches the clean auth-modal aesthetic */
}
.pm-header-info { min-width: 0; }
.pm-header-info .pm-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pm-header-info .pm-email {
    font-size: 0.72rem;
    color: #94a3b8;
    font-family: 'Space Mono', monospace;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ----------------------------------------------------------------
   TABS — Same treatment as auth-modal .tab-switcher
   Uppercase, spaced, cyan active underline with glow
   ---------------------------------------------------------------- */
.pm-tab-switcher {
    display: flex;
    gap: 0;
    justify-content: center;
    border-bottom: 1px solid rgba(6, 182, 212, 0.15);
    padding-bottom: 14px;
}

.pm-tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.72rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    padding: 0 10px;
    transition: color 0.2s;
    position: relative;
    white-space: nowrap;
    text-decoration: none;
}
.pm-tab-btn:hover { color: #cbd5e1; }
.pm-tab-btn.active {
    color: #06b6d4;
}
.pm-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 1px;
    background: #06b6d4;
    box-shadow: 0 0 10px #06b6d4;
}
.pm-tab-btn-logout {
    color: #ef4444 !important;
    opacity: 0.7;
}
.pm-tab-btn-logout:hover { color: #fca5a5 !important; opacity: 1; }


/* ----------------------------------------------------------------
   TAB VIEWS — Slide-in animation
   ---------------------------------------------------------------- */
.pm-tab { display: none; }
.pm-tab.active {
    display: block;
    animation: pmSlideIn 0.2s ease forwards;
}
@keyframes pmSlideIn {
    0% { opacity: 0; transform: translateX(-10px); }
    100% { opacity: 1; transform: translateX(0); }
}


/* ----------------------------------------------------------------
   PAGE HEADINGS — Clean, minimal (no hiding, proper hierarchy)
   ---------------------------------------------------------------- */
.pm-page-head {
    margin-bottom: 28px;
    padding-top: 4px;
}
.pm-page-head h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 4px;
    color: #f8fafc;
}
.pm-page-head p {
    color: #cbd5e1;
    font-size: 0.8rem;
    margin: 0;
}


/* ----------------------------------------------------------------
   SECTION TITLES — Tiny cyan uppercase labels
   ---------------------------------------------------------------- */
.pm-section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #cbd5e1;
    margin: 28px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(6, 182, 212, 0.2);
}
.pm-section-title .pm-subtitle-inline {
    font-size: 0.68rem;
    color: #94a3b8;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}


/* ----------------------------------------------------------------
   OVERVIEW STATS — Neo-Brutalist Tech Cards (sharp, transparent, cyan-accented)
   ---------------------------------------------------------------- */
.pm-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.pm-stat {
    display: flex;
    flex-direction: column;
    padding: 18px 20px !important;
    background: transparent !important;
    border: 1px solid rgba(6, 182, 212, 0.2) !important;
    border-radius: 0 !important;
    margin-bottom: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    position: relative;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease !important;
}
.pm-stat::before {
    content: '' !important;
    display: block !important;
    position: absolute;
    top: 0; left: 0;
    height: 2px;
    width: 0;
    background: #06b6d4;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.pm-stat::after { display: none !important; }
.pm-stat:hover {
    border-color: rgba(6, 182, 212, 0.5) !important;
    box-shadow: 0 6px 24px rgba(6, 182, 212, 0.15) !important;
}
.pm-stat:hover::before {
    width: 100%;
}

.pm-stat-icon { display: none !important; }

.pm-stat-label {
    order: 1;
    font-size: 0.62rem;
    color: #06b6d4;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    font-weight: 500;
}
.pm-stat-value {
    order: 2;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.2;
}
.pm-stat-sub {
    order: 3;
    font-size: 0.68rem;
    color: #cbd5e1;
    margin-top: 3px;
    font-family: 'Space Mono', monospace;
}


/* ----------------------------------------------------------------
   DETAILS LIST — Key/Value rows (Stripe-style)
   ---------------------------------------------------------------- */
.pm-details-list {
    width: 100%;
}
.pm-rows {
    width: 100%;
    display: flex;
    flex-direction: column;
}
.pm-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(6, 182, 212, 0.15);
}
.pm-row:last-child { border-bottom: none; }
.pm-row .k {
    font-size: 0.75rem;
    color: #cbd5e1;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}
.pm-row .v {
    font-size: 0.8rem;
    color: #f8fafc;
    font-family: 'Space Mono', monospace;
    text-align: right;
    word-break: break-all;
}
.pm-row .v strong { color: #f8fafc; }


/* ----------------------------------------------------------------
   SUBSCRIPTION BANNER (Overview tab)
   ---------------------------------------------------------------- */
.pm-subscription-banner-wrapper {
    background: transparent;
    border: 1px solid rgba(6, 182, 212, 0.2);
    padding: 18px 20px;
    position: relative;
    margin-top: 8px;
}
.pm-subscription-banner-wrapper::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 2px;
    background: #06b6d4;
}


/* ----------------------------------------------------------------
   FORMS — Exact same floating-label inputs as auth-modal
   ---------------------------------------------------------------- */
.pm-form {
    display: flex;
    flex-direction: column;
}
.pm-form-group {
    position: relative;
    padding-bottom: 28px;
    margin-bottom: 0;
}
.pm-form-label {
    position: absolute;
    top: -10px;
    left: 12px;
    background: #030712;
    padding: 0 8px;
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    pointer-events: none;
    transition: all 0.2s;
    z-index: 10;
}
.pm-input {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 0;
    padding: 16px;
    color: #fff;
    font-family: 'Space Mono', monospace;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    line-height: 1.5;
}
.pm-input:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: inset 0 0 20px rgba(6, 182, 212, 0.1);
    background: rgba(6, 182, 212, 0.02);
}

.pm-input::placeholder { color: transparent; }
.pm-input:focus ~ .pm-form-label,
.pm-input:not(:placeholder-shown) ~ .pm-form-label {
    color: #06b6d4;
    top: -10px;
    font-size: 0.68rem;
}

/* Fix Autofill Background (same as auth-modal) */
.pm-input:-webkit-autofill,
.pm-input:-webkit-autofill:hover,
.pm-input:-webkit-autofill:focus,
.pm-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #030712 inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}

.pm-hint { font-size: 0.72rem; color: #94a3b8; margin-top: 6px; font-family: 'Space Mono', monospace; }
.pm-hint.err { color: #ef4444; }


/* ----------------------------------------------------------------
   BUTTONS — Same as auth-modal .btn-submit
   Cyan bg, black text, uppercase, no radius
   ---------------------------------------------------------------- */
.pm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: #06b6d4;
    color: #000;
    border: none;
    border-radius: 0;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: 'Space Grotesk', sans-serif;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.pm-btn:hover:not(:disabled) {
    background: #22d3ee;
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.4);
    transform: translateY(-1px);
}
.pm-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }
.pm-btn svg { width: 14px; height: 14px; }

.pm-btn--outline {
    background: transparent;
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: #fff;
}
.pm-btn--outline:hover:not(:disabled) {
    border-color: #06b6d4;
    background: rgba(6, 182, 212, 0.06);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
}
.pm-btn--ghost {
    background: transparent;
    color: #cbd5e1;
    border: none;
}
.pm-btn--ghost:hover { color: #ffffff; }

.pm-btn--danger {
    background: transparent;
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.pm-btn--danger:hover:not(:disabled) {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}
.pm-btn-row { display: flex; gap: 10px; flex-wrap: wrap; }


/* ----------------------------------------------------------------
   BADGES — Square minimal badges matching login D.A.
   ---------------------------------------------------------------- */
.pm-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
    border-radius: 0;
}
.pm-badge .dot { width: 4px; height: 4px; border-radius: 0; background: currentColor; }
.pm-badge.green { background: rgba(34, 197, 94, 0.08); color: #4ade80; border-color: rgba(34, 197, 94, 0.2); }
.pm-badge.yellow { background: rgba(251, 191, 36, 0.08); color: #fbbf24; border-color: rgba(251, 191, 36, 0.2); }
.pm-badge.red { background: rgba(239, 68, 68, 0.08); color: #f87171; border-color: rgba(239, 68, 68, 0.2); }
.pm-badge.gray { background: rgba(255, 255, 255, 0.04); color: #cbd5e1; border-color: rgba(255, 255, 255, 0.08); }
.pm-badge.accent { background: rgba(6, 182, 212, 0.08); color: #22d3ee; border-color: rgba(6, 182, 212, 0.2); }
.pm-badge.violet { background: rgba(139, 92, 246, 0.08); color: #c4b5fd; border-color: rgba(139, 92, 246, 0.2); }


/* ----------------------------------------------------------------
   SUBSCRIPTION TAB — Details section (Login Brackets D.A.)
   ---------------------------------------------------------------- */
.pm-sub-section {
    background: #030712;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    padding: 24px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.pm-sub-banner {
    padding: 0;
    margin-bottom: 16px;
    background: transparent !important;
    border: none !important;
}
.pm-sub-banner::before, .pm-sub-banner::after { display: none !important; }
.pm-sub-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.pm-sub-head h3 {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.01em;
}
.pm-sub-banner .desc { color: #cbd5e1; font-size: 0.82rem; margin: 0; line-height: 1.5; }

.pm-sub-section .pm-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px 0;
}
.pm-sub-section .pm-row:last-child {
    border-bottom: none;
}
.pm-sub-section .pm-row .k {
    color: #94a3b8;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.pm-sub-section .pm-row .v {
    font-size: 0.78rem;
    color: #f8fafc;
}


/* ----------------------------------------------------------------
   PLANS — Brutalist comparison cards with corner glows
   ---------------------------------------------------------------- */
.pm-plans {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.pm-plan {
    background: #030712;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0;
    padding: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.pm-plan:hover:not(.locked):not(.current) {
    border-color: #06b6d4;
    box-shadow: inset 0 0 20px rgba(6, 182, 212, 0.1);
    background: rgba(6, 182, 212, 0.02);
}
.pm-plan.current {
    border-color: #06b6d4;
    box-shadow: inset 0 0 25px rgba(6, 182, 212, 0.15), 0 0 30px rgba(6, 182, 212, 0.15);
    background: rgba(6, 182, 212, 0.03);
}
.pm-plan.locked { opacity: 0.4; }
.pm-plan-ribbon {
    position: absolute;
    top: 0; right: 0;
    padding: 4px 12px;
    background: #06b6d4;
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.pm-plan h4 {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.01em;
}
.pm-plan-tag {
    font-size: 0.68rem;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Space Mono', monospace;
}
.pm-plan-price {
    font-family: 'Space Mono', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: #06b6d4;
    margin: 6px 0;
}
.pm-plan-price small { font-size: 0.75rem; color: #94a3b8; font-weight: 400; }

.pm-plan-features {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0 0;
    margin: 12px 0 16px;
    list-style: none;
    border-top: 1px solid rgba(6, 182, 212, 0.12);
}
.pm-plan-features li {
    font-size: 0.74rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
}
.pm-plan-features li svg {
    width: 12px;
    height: 12px;
    color: #06b6d4;
    flex-shrink: 0;
}

.pm-stripe-note {
    margin-top: 24px;
    padding: 14px 16px;
    background: rgba(6, 182, 212, 0.01);
    border: 1px dashed rgba(6, 182, 212, 0.25);
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.6;
}


/* ----------------------------------------------------------------
   DANGER ZONE — Red tint, clean
   ---------------------------------------------------------------- */
.pm-danger-box {
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.02);
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.pm-color-danger { color: #fca5a5 !important; }
.pm-danger-info h3 { margin: 0 0 4px; font-size: 0.95rem; color: #f8fafc; }
.pm-danger-info p { margin: 0; font-size: 0.78rem; color: #cbd5e1; line-height: 1.4; }


/* ----------------------------------------------------------------
   SUB-MODALS (Delete Account Dialog) — Same D.A.
   ---------------------------------------------------------------- */
.pm-modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}
.pm-modal-bg.active {
    display: flex;
    animation: pmBgFadeIn 0.2s ease-out;
}
@keyframes pmBgFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.pm-modal-dialog {
    padding: 32px;
    max-width: 400px;
    width: 100%;
    position: relative;
    background: #030712;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 1), 0 20px 60px rgba(0, 0, 0, 0.95);
}
.pm-modal-dialog::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 12px; height: 12px;
    border-top: 2px solid #06b6d4;
    border-left: 2px solid #06b6d4;
    pointer-events: none;
    z-index: 10;
}
.pm-modal-dialog::after {
    content: '';
    position: absolute;
    bottom: 0; right: 0;
    width: 12px; height: 12px;
    border-bottom: 2px solid #06b6d4;
    border-right: 2px solid #06b6d4;
    pointer-events: none;
    z-index: 10;
}
.pm-modal-dialog h3 {
    margin: 0 0 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    color: #f8fafc;
}
.pm-modal-dialog p {
    margin: 0 0 20px;
    color: #cbd5e1;
    font-size: 0.8rem;
    line-height: 1.5;
}


/* ----------------------------------------------------------------
   TOAST NOTIFICATIONS
   ---------------------------------------------------------------- */
.pm-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: #030712;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    color: #fff;
    font-size: 0.82rem;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 11000;
    max-width: 340px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 1), 0 15px 40px rgba(0,0,0,0.6);
    font-family: 'Space Mono', monospace;
}
.pm-toast.show { transform: none; opacity: 1; }
.pm-toast.success { border-color: #22c55e; }
.pm-toast.error { border-color: #ef4444; }
.pm-toast.info { border-color: #06b6d4; }


/* ----------------------------------------------------------------
   ALERT STRIPS
   ---------------------------------------------------------------- */
.pm-alert {
    padding: 12px 16px;
    border-radius: 0;
    border: 1px solid;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.78rem;
    line-height: 1.45;
}
.pm-alert.warn { background: rgba(251, 191, 36, 0.04); border-color: rgba(251, 191, 36, 0.2); color: #fde68a; }
.pm-alert.danger { background: rgba(239, 68, 68, 0.04); border-color: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.pm-alert svg { flex-shrink: 0; width: 16px; height: 16px; margin-top: 1px; }
.pm-alert strong { color: white; }

.pm-pulse { animation: pmPulse 2s ease-in-out infinite; }
@keyframes pmPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Spinner animation for billing portal loading */
@keyframes pmSpin { to { transform: rotate(360deg); } }


/* ----------------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------------- */
@media (max-width: 580px) {
    .profile-modal-overlay { padding: 12px; }
    .pm-sticky-top { padding: 24px 20px 0; }
    .pm-scroll-body { padding: 20px 20px 24px; }
    .pm-tab-btn { font-size: 0.65rem; padding: 0 6px; letter-spacing: 0.06em; }
    .pm-danger-box { flex-direction: column; align-items: flex-start; }
    .pm-danger-box .pm-btn { width: 100%; }
}

@media (max-width: 380px) {
    .pm-sticky-top { padding: 20px 16px 0; }
    .pm-scroll-body { padding: 16px 16px 20px; }
    .pm-tab-btn { font-size: 0.6rem; padding: 0 4px; }
    .pm-plan { padding: 14px 16px; }
}

/* ----------------------------------------------------------------
   DESKTOP TWO-COLUMN SIDEBAR LAYOUT (min-width: 768px)
   ---------------------------------------------------------------- */
@media (min-width: 768px) {
    /* 1. Modal size and direction */
    .profile-modal {
        max-width: 1000px;
        height: 700px;
        max-height: calc(100vh - 40px);
        flex-direction: row;
        align-items: stretch;
    }
    
    /* 2. Left Sidebar (pm-sticky-top) */
    .pm-sticky-top {
        width: 250px;
        height: 100%;
        padding: 40px 24px 32px 32px;
        border-right: 1px solid rgba(6, 182, 212, 0.2);
        display: flex;
        flex-direction: column;
        background: transparent !important;
    }
    
    /* Center the profile header in sidebar */
    .pm-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
        margin-bottom: 32px;
    }
    
    .pm-avatar-container {
        width: 56px;
        height: 56px;
    }
    
    .pm-avatar {
        font-size: 1.4rem;
    }
    
    .pm-header-info {
        text-align: center;
        width: 100%;
    }
    
    .pm-header-info .pm-name {
        font-size: 1.1rem;
    }
    
    /* 3. Vertical Navigation (pm-tab-switcher) */
    .pm-tab-switcher {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        border-bottom: none;
        padding-bottom: 0;
        flex: 1; /* Occupies remaining height to push logout to the bottom */
    }
    
    .pm-tab-btn {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 10px 14px;
        text-align: left;
        justify-content: flex-start;
        border-left: 2px solid transparent;
        transition: all 0.2s ease;
    }
    
    .pm-tab-btn:hover {
        background: rgba(255, 255, 255, 0.02);
        color: #cbd5e1;
    }
    
    .pm-tab-btn.active {
        color: #06b6d4;
        background: rgba(6, 182, 212, 0.06);
        border-left-color: #06b6d4;
    }
    
    /* Hide horizontal line on desktop */
    .pm-tab-btn.active::after {
        display: none !important;
    }
    
    /* Position Logout button at the very bottom */
    .pm-tab-btn-logout {
        margin-top: auto;
        border-left: 2px solid transparent;
    }
    
    .pm-tab-btn-logout:hover {
        background: rgba(239, 68, 68, 0.05);
    }
    
    /* 4. Right Scrollable Panel (pm-scroll-body) */
    .pm-scroll-body {
        padding: 40px 40px 40px 48px;
        height: 100%;
        background: transparent !important;
    }
    
    /* 5. Plans side-by-side inside Billing */
    .pm-plans {
        flex-direction: row;
        gap: 12px;
    }
    
    .pm-plan {
        flex: 1;
        min-width: 0;
        padding: 24px 16px;
    }
}

/* Reusable gradient text for FUDA */
.fuda-gradient-text {
    background: linear-gradient(135deg, #ffffff 30%, #556a8a 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    display: inline-block !important;
}
