body {
    background:
        radial-gradient(circle at 12% 10%, rgba(220, 38, 38, 0.12), transparent 30%),
        radial-gradient(circle at 88% 80%, rgba(15, 23, 42, 0.10), transparent 32%),
        var(--bg);
}

.profile-page {
    width: 100%;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(360px, 620px) 300px;
    justify-content: center;
    align-items: start;
    gap: 24px;
    padding: 24px;
}

.profile-device {
    width: 100%;
    min-height: calc(100dvh - 48px);
    background: var(--bg);
    border-radius: 36px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.92);
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
    padding: 18px;
}

.profile-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.profile-icon-btn,
.profile-edit-mini {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.profile-topbar h1 {
    margin: 0;
    color: var(--text);
    font-size: 25px;
    font-weight: 950;
    letter-spacing: -0.5px;
}

.profile-topbar p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 750;
}

.profile-state,
.profile-login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.06);
}

.profile-login-box ion-icon {
    font-size: 42px;
    color: var(--primary);
}

.profile-login-box h2 {
    margin: 10px 0 6px;
    color: var(--text);
    font-size: 22px;
    font-weight: 950;
}

.profile-login-box p,
.profile-state p {
    color: var(--muted);
    font-weight: 750;
}

.profile-login-box a {
    display: inline-flex;
    margin-top: 14px;
    background: var(--primary);
    color: #fff;
    min-height: 44px;
    align-items: center;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 950;
}

.profile-hero-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
    margin-bottom: 16px;
}

.profile-cover {
    height: 118px;
    background: linear-gradient(135deg, #111827, var(--primary));
}

.profile-main-row {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    padding: 0 18px;
    margin-top: -107px;
}

.profile-avatar-wrap {
    width: 96px;
    height: 96px;
    border-radius: 32px;
    background: #fff;
    padding: 4px;
    position: relative;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
    flex: 0 0 auto;
}

.profile-avatar-wrap img {
    width: 100%;
    height: 100%;
    border-radius: 28px;
    object-fit: cover;
}

.verified-dot {
    position: absolute;
    right: -4px;
    bottom: 6px;
    background: #fff;
    border-radius: 999px;
    color: #2563eb;
    font-size: 26px;
}

.profile-user-info {
    flex: 1;
    min-width: 0;
    padding-bottom: 7px;
}

.profile-user-info h2 {
    margin: 0;
    color: white;
    font-size: 24px;
    font-weight: 950;
}

.profile-user-info p {
    margin: 3px 0 0;
    color: white;
    font-size: 13px;
    font-weight: 800;
}

.profile-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.profile-status-row span {
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 950;
}

#profileMemberBadge.paid {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #ea580c;
}

.profile-bio {
    padding: 14px 18px 0;
    color: var(--muted);
    line-height: 1.55;
    font-size: 14px;
    font-weight: 750;
}

.profile-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 18px;
}

.profile-primary-btn,
.profile-secondary-btn {
    min-height: 48px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 950;
}

.profile-primary-btn {
    background: var(--primary);
    color: #fff;
}

.profile-secondary-btn {
    background: #f8fafc;
    color: var(--text);
    border: 1px solid var(--border);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.profile-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.05);
}

.profile-stat-card strong {
    display: block;
    color: var(--text);
    font-size: 22px;
    font-weight: 950;
}

.profile-stat-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.profile-card,
.profile-edit-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 18px;
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.06);
    margin-bottom: 16px;
}

.profile-card-head h3 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 950;
}

.profile-card-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 750;
}

.profile-info-list {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.profile-info-list div {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 12px;
}

.profile-info-list span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.profile-info-list strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    margin-top: 3px;
    word-break: break-word;
}

.membership-mini-box {
    margin-top: 14px;
    background: linear-gradient(135deg, #111827, var(--primary));
    border-radius: 24px;
    padding: 16px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.membership-mini-box span {
    font-size: 16px;
    font-weight: 950;
}

.membership-mini-box p {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    font-weight: 750;
}

.membership-mini-box a {
    background: #fff;
    color: var(--primary);
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 950;
    white-space: nowrap;
}

.profile-link-list {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.profile-link-list a {
    min-height: 52px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 18px;
    color: var(--text);
    display: grid;
    grid-template-columns: 24px 1fr 20px;
    align-items: center;
    gap: 10px;
    padding: 0 13px;
    font-weight: 900;
}

.profile-link-list ion-icon {
    font-size: 20px;
    color: var(--primary);
}

.profile-side-panel {
    position: sticky;
    top: 24px;
}

.profile-side-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 20px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.10);
}

.profile-side-card img {
    width: 86px;
    height: 86px;
    border-radius: 24px;
    object-fit: cover;
}

.profile-side-card h2 {
    margin: 16px 0 8px;
    color: var(--text);
    font-size: 22px;
}

.profile-side-card p {
    margin: 0 0 16px;
    color: var(--muted);
    line-height: 1.55;
    font-weight: 700;
}

.profile-side-card a {
    width: 100%;
    min-height: 46px;
    border-radius: 16px;
    background: #f8fafc;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 13px;
    margin-top: 9px;
    font-weight: 900;
}

.edit-photo-box {
    display: grid;
    justify-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.edit-photo-box img {
    width: 118px;
    height: 118px;
    border-radius: 36px;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
}

.edit-photo-box label {
    background: var(--primary);
    color: #fff;
    min-height: 42px;
    border-radius: 999px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 950;
    cursor: pointer;
}

.form-label {
    display: block;
    margin: 14px 0 8px;
    color: var(--text);
    font-weight: 950;
    font-size: 13.5px;
}

.form-control {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #f8fafc;
    color: var(--text);
    padding: 12px 14px;
    outline: none;
    font-weight: 750;
}

.form-control:focus {
    background: #fff;
    border-color: rgba(220, 38, 38, 0.55);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.bio-control {
    min-height: 130px;
    resize: vertical;
}

.form-note {
    color: var(--primary);
    display: block;
    margin-top: 7px;
    font-weight: 800;
    font-size: 12px;
}

.profile-save-btn {
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    margin-top: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 950;
    box-shadow: 0 16px 34px rgba(220, 38, 38, 0.28);
}

.profile-save-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

[hidden] {
    display: none !important;
}

@media (max-width: 920px) {
    body {
        background: var(--bg);
    }

    .profile-page {
        display: block;
        padding: 0;
    }

    .profile-device {
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px 34px;
    }

    .profile-side-panel {
        display: none;
    }
}

@media (max-width: 520px) {
    .profile-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 9px;
    }

    .profile-stat-card {
        padding: 13px 8px;
        border-radius: 20px;
    }

    .profile-action-row {
        grid-template-columns: 1fr;
    }

    /* Profile Logout Button */
    .profile-logout-card {
        width: 100%;
        margin: 16px 0 24px;
        background: #ffffff;
        border: 1px solid rgba(226, 232, 240, 0.95);
        border-radius: 24px;
        padding: 14px;
        box-shadow: 0 14px 38px rgba(15, 23, 42, 0.06);
    }

    .profile-logout-btn {
        width: 100%;
        min-height: 52px;
        border: 0;
        border-radius: 999px;
        background: #fee2e2;
        color: #b91c1c;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 9px;
        font-size: 15px;
        font-weight: 950;
        cursor: pointer;
    }

    .profile-logout-btn ion-icon {
        font-size: 22px;
    }

    .profile-logout-btn:active {
        transform: scale(0.98);
    }
}
.profile-avatar-edit-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #ffffff;
    color: var(--primary);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
    z-index: 8;
}

.profile-avatar-edit-btn ion-icon {
    font-size: 17px;
}

.profile-avatar-edit-btn:hover {
    background: var(--primary);
    color: #ffffff;
}

#profileMemberBadge.paid {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #15803d;
}
/* ===== GLOBAL FONT FAMILY ===== */

html,
body,
button,
input,
textarea,
select,
a,
p,
span,
strong,
small,
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
/* ===== PROFILE PAGE FINAL FONT + BALANCE POLISH ===== */

.profile-page,
.profile-page * {
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

/* Page shell */
.profile-device {
    background:
        radial-gradient(circle at 14% 5%, rgba(220, 38, 38, 0.08), transparent 30%),
        #f4f6fb;
}

/* Topbar */
.profile-topbar {
    gap: 12px;
    margin-bottom: 16px;
}

.profile-icon-btn,
.profile-edit-mini {
    width: 44px;
    height: 44px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.profile-icon-btn ion-icon,
.profile-edit-mini ion-icon {
    font-size: 21px;
}

.profile-topbar h1 {
    font-size: 23px !important;
    line-height: 1.15;
    font-weight: 600 !important;
    letter-spacing: -0.45px;
}

.profile-topbar p {
    font-size: 12px !important;
    line-height: 1.35;
    font-weight: 400 !important;
    color: #64748b;
}

/* Loading / Login */
.profile-login-box h2 {
    font-size: 20px !important;
    font-weight: 600 !important;
}

.profile-login-box p,
.profile-state p {
    font-size: 13px !important;
    font-weight: 400 !important;
}

.profile-login-box a {
    font-size: 13px !important;
    font-weight: 600 !important;
}

/* Hero card */
.profile-hero-card {
    border-radius: 28px;
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.07);
}

.profile-cover {
    height: 112px;
    background:
        radial-gradient(circle at 18% 15%, rgba(255, 255, 255, 0.20), transparent 28%),
        linear-gradient(135deg, #111827, #dc2626);
}

.profile-main-row {
    gap: 13px;
    padding: 0 16px;
    margin-top: -101px;
}

.profile-avatar-wrap {
    width: 92px;
    height: 92px;
    border-radius: 30px;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.16);
}

.profile-avatar-wrap img {
    border-radius: 26px;
}

.profile-avatar-edit-btn {
    width: 30px;
    height: 30px;
    top: -4px;
    right: -4px;
}

.profile-avatar-edit-btn ion-icon {
    font-size: 16px;
}

.profile-user-info h2 {
    font-size: 21px !important;
    line-height: 1.15;
    font-weight: 600 !important;
    letter-spacing: -0.35px;
}

.profile-user-info p {
    font-size: 12.5px !important;
    line-height: 1.25;
    font-weight: 400 !important;
    opacity: 0.92;
}

.profile-status-row {
    gap: 7px;
    margin-top: 8px;
}

.profile-status-row span {
    padding: 6px 10px;
    font-size: 11.5px !important;
    line-height: 1;
    font-weight: 500 !important;
}

/* Bio */
.profile-bio {
    padding: 14px 16px 0;
    color: #64748b;
    line-height: 1.6;
    font-size: 13.5px !important;
    font-weight: 400 !important;
}

/* Buttons */
.profile-action-row {
    gap: 10px;
    padding: 16px;
}

.profile-primary-btn,
.profile-secondary-btn {
    min-height: 46px;
    font-size: 13.5px !important;
    font-weight: 600 !important;
}

.profile-primary-btn {
    box-shadow: 0 12px 26px rgba(220, 38, 38, 0.22);
}

.profile-secondary-btn {
    color: #334155;
}

/* Stats */
.profile-grid {
    gap: 10px;
    margin-bottom: 14px;
}

.profile-stat-card {
    border-radius: 22px;
    padding: 14px 10px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.045);
}

.profile-stat-card strong {
    font-size: 20px !important;
    line-height: 1.15;
    font-weight: 600 !important;
}

.profile-stat-card span {
    margin-top: 4px;
    display: block;
    font-size: 11.5px !important;
    line-height: 1.25;
    font-weight: 400 !important;
}

/* Cards */
.profile-card,
.profile-edit-card {
    border-radius: 26px;
    padding: 16px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.055);
}

.profile-card-head h3 {
    font-size: 17px !important;
    line-height: 1.25;
    font-weight: 600 !important;
    letter-spacing: -0.25px;
}

.profile-card-head p {
    font-size: 12px !important;
    line-height: 1.35;
    font-weight: 400 !important;
}

/* Account details */
.profile-info-list {
    margin-top: 13px;
    gap: 9px;
}

.profile-info-list div {
    border-radius: 16px;
    padding: 11px 12px;
}

.profile-info-list span {
    font-size: 11.5px !important;
    line-height: 1.25;
    font-weight: 400 !important;
}

.profile-info-list strong {
    font-size: 13.5px !important;
    line-height: 1.38;
    font-weight: 500 !important;
}

/* Membership box */
.membership-mini-box {
    border-radius: 22px;
    padding: 15px;
    background:
        radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.20), transparent 28%),
        linear-gradient(135deg, #111827, #dc2626);
}

.membership-mini-box span {
    font-size: 15px !important;
    line-height: 1.25;
    font-weight: 600 !important;
}

.membership-mini-box p {
    font-size: 11.5px !important;
    line-height: 1.35;
    font-weight: 400 !important;
}

.membership-mini-box a {
    padding: 9px 13px;
    font-size: 12.5px !important;
    font-weight: 600 !important;
}

/* Quick actions */
.profile-link-list {
    margin-top: 13px;
    gap: 9px;
}

.profile-link-list a {
    min-height: 50px;
    border-radius: 16px;
    font-size: 13.5px !important;
    font-weight: 500 !important;
}

.profile-link-list ion-icon {
    font-size: 19px;
}

/* Logout */
.profile-logout-card {
    margin: 14px 0 18px !important;
    padding: 12px !important;
    border-radius: 22px !important;
}

.profile-logout-btn {
    min-height: 50px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

/* Side panel */
.profile-side-card h2 {
    font-size: 20px !important;
    line-height: 1.25;
    font-weight: 600 !important;
}

.profile-side-card p {
    font-size: 13.5px !important;
    line-height: 1.55;
    font-weight: 400 !important;
}

.profile-side-card a {
    min-height: 44px;
    font-size: 13.5px !important;
    font-weight: 500 !important;
}

/* Edit form page also balanced */
.form-label {
    font-size: 13px !important;
    font-weight: 500 !important;
}

.form-control {
    font-size: 14px !important;
    font-weight: 400 !important;
}

.form-note {
    font-size: 11.5px !important;
    font-weight: 500 !important;
}

.edit-photo-box label,
.profile-save-btn {
    font-size: 14px !important;
    font-weight: 600 !important;
}

.profile-save-btn {
    min-height: 52px;
}

/* Paid badge */
#profileMemberBadge.paid {
    font-weight: 500 !important;
}

/* Mobile polish */
@media (max-width: 920px) {
    .profile-device {
        padding: calc(env(safe-area-inset-top, 0px) + 14px) 14px 34px !important;
    }

    .profile-topbar h1 {
        font-size: 22px !important;
    }

    .profile-topbar p {
        font-size: 11.8px !important;
    }
}

@media (max-width: 520px) {
    .profile-grid {
        gap: 8px;
    }

    .profile-stat-card {
        padding: 12px 7px;
        border-radius: 18px;
    }

    .profile-stat-card strong {
        font-size: 18px !important;
    }

    .profile-stat-card span {
        font-size: 10.8px !important;
    }

    .profile-action-row {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .profile-card,
    .profile-edit-card {
        padding: 15px;
        border-radius: 24px;
    }

    .profile-user-info h2 {
        font-size: 15px !important;
    }

    .profile-status-row span {
        font-size: 11px !important;
    }
}
.verified-dot {
    position: absolute;
    right: -4px;
    bottom: 6px;
    background: #fff;
    border-radius: 999px;
    color: #2563eb;
    font-size: 26px;
}
/* ===== FINAL PROFILE VERIFIED BADGE CIRCLE FIX ===== */

.profile-avatar-wrap {
    overflow: visible !important;
}

#profileVerifiedBadge.verified-dot {
    position: absolute !important;
    right: -4px !important;
    bottom: 2px !important;

    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;

    padding: 0 !important;
    margin: 0 !important;

    border-radius: 50% !important;
    background: #ffffff !important;
    border: 3px solid #ffffff !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    color: #2563eb !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.20) !important;
    z-index: 20 !important;
    overflow: hidden !important;
    line-height: 1 !important;
}

#profileVerifiedBadge.verified-dot ion-icon {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;

    display: block !important;
    color: #2563eb !important;
    font-size: 28px !important;
    line-height: 1 !important;

    margin: 0 !important;
    padding: 0 !important;
}

/* Ionicon internal svg sizing */
#profileVerifiedBadge.verified-dot ion-icon svg {
    width: 28px !important;
    height: 28px !important;
    display: block !important;
}

/*
|--------------------------------------------------------------------------
| Referral Earnings profile action
|--------------------------------------------------------------------------
*/
.profile-earnings-action {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 0;
    border-radius: 14px;
    color: #ffffff !important;
    background: #0f172a;
    font-family:
        "Poppins",
        system-ui,
        sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.profile-earnings-action ion-icon {
    color: #ffffff !important;
    font-size: 20px;
}

@media (max-width: 640px) {
    .profile-earnings-action {
        flex: 1 1 100%;
        width: 100%;
    }
}

