/* Serva — Profile full-page redesign */

.profile-page-wrap {
    min-height: 100vh;
}

.profile-shell {
    max-width: none;
    margin: 0;
    padding: 0;
}

.profile-topbar {
    margin-bottom: 1rem;
}

.profile-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary, #9fb2cc);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s ease;
}
.profile-back-link:hover { color: #79e7ff; }

/* ===== Hero ===== */
.profile-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: clamp(1.6rem, 4vw, 2.4rem) 1rem 1.6rem;
    margin-bottom: 1.2rem;
    border-radius: 26px;
    border: 1px solid rgba(0, 224, 255, 0.22);
    background:
        radial-gradient(circle at 28% -10%, rgba(0, 224, 255, 0.25), transparent 55%),
        radial-gradient(circle at 82% 10%, rgba(124, 92, 255, 0.22), transparent 55%),
        linear-gradient(160deg, rgba(10, 20, 46, 0.96), rgba(6, 10, 24, 0.96));
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.4);
}

.profile-hero .account-avatar-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    z-index: 1;
}

.profile-hero .account-avatar-xl {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 2.6rem;
    font-weight: 900;
    color: #021018;
    background: linear-gradient(145deg, #8af0ff, #3f9bff);
    box-shadow: 0 0 0 5px rgba(0, 224, 255, 0.16), 0 12px 34px rgba(0, 180, 255, 0.45);
}

.profile-hero h1 {
    color: #fff;
    font-size: clamp(1.4rem, 4vw, 1.9rem);
    font-weight: 900;
    margin: 0.4rem 0 0;
    z-index: 1;
}

.profile-hero-email {
    color: #9fb2cc;
    margin: 0;
    z-index: 1;
    direction: ltr;
}

/* ===== Stats ===== */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.7rem;
    margin-bottom: 1.2rem;
}

.profile-stats .account-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 1.1rem 0.6rem;
    border-radius: 18px;
    border: 1px solid rgba(0, 224, 255, 0.14);
    background: radial-gradient(circle at top, rgba(0, 224, 255, 0.09), transparent 65%), rgba(6, 12, 28, 0.7);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.profile-stats .account-stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 224, 255, 0.42);
    box-shadow: 0 12px 28px rgba(0, 180, 255, 0.18);
}
.account-stat-icon { font-size: 1.4rem; color: #79e7ff; }
.profile-stats .account-stat-value { font-size: 1.5rem; font-weight: 900; color: #fff; }
.profile-stats .account-stat-label { font-size: 0.78rem; font-weight: 700; color: #9fb2cc; }

/* ===== Cards grid ===== */
.profile-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    align-items: start;
}

.profile-card {
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: linear-gradient(150deg, rgba(10, 18, 40, 0.85), rgba(5, 9, 22, 0.85));
    padding: 1.2rem;
}
.profile-card.hidden { display: none; }

.profile-card .account-panel-title { color: #fff; font-weight: 800; margin: 0; }
.profile-card-balance #profileBalanceAmount {
    font-size: 1.9rem;
    font-weight: 900;
    color: #7ee7ff;
    text-shadow: 0 0 20px rgba(0, 224, 255, 0.4);
}
.profile-card .account-readonly-note { color: #9fb2cc; }

/* Rank card */
.account-rank-row { display: flex; align-items: center; gap: 0.85rem; margin: 0.4rem 0 0.6rem; }
.account-rank-badge { width: 60px; height: 60px; object-fit: contain; filter: drop-shadow(0 4px 14px rgba(0, 224, 255, 0.45)); }
.account-rank-info strong { display: block; color: #fff; font-size: 1.2rem; font-weight: 800; }
.account-rank-info span { color: #79e7ff; font-weight: 700; }

/* Inline grid (referral link + copy) */
.profile-card .account-inline-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.profile-card .form-input {
    width: 100%;
    background: rgba(2, 8, 20, 0.65);
    border: 1px solid rgba(0, 224, 255, 0.22);
    border-radius: 12px;
    color: #cfe8ff;
    padding: 0.7rem 0.9rem;
    font-weight: 600;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.profile-card .form-input:focus {
    outline: none;
    border-color: rgba(0, 224, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(0, 224, 255, 0.16);
}
.profile-card .account-inline-grid .btn-secondary,
.profile-card .account-inline-grid .btn-primary {
    border-radius: 12px;
    white-space: nowrap;
    font-weight: 700;
}
.profile-card #profileCopyRefLink {
    background: linear-gradient(145deg, #79e7ff, #4aa8ff);
    color: #021018;
    border: none;
    box-shadow: 0 6px 16px rgba(0, 180, 255, 0.3);
}
.profile-card #profileReferralLink {
    direction: ltr;
    text-align: left;
    font-size: 0.82rem;
}

@media (max-width: 640px) {
    .profile-cards { grid-template-columns: 1fr; }
}
@media (min-width: 720px) {
    .profile-stats { grid-template-columns: repeat(4, 1fr); }
}

/* Harmonize the auto-generated meta row (currency/level/role/country) with the new theme */
.profile-glow .account-meta-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.7rem;
    margin-bottom: 1.2rem;
}
.profile-glow .account-meta-card {
    border-radius: 18px;
    border: 1px solid rgba(0, 224, 255, 0.16);
    background: radial-gradient(circle at top, rgba(0, 224, 255, 0.08), transparent 65%), rgba(6, 12, 28, 0.72);
    padding: 1rem 1.1rem;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.profile-glow .account-meta-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 224, 255, 0.4);
    box-shadow: 0 10px 26px rgba(0, 180, 255, 0.16);
}
.profile-glow .account-meta-card-level {
    border-color: rgba(255, 196, 0, 0.3);
    background: radial-gradient(circle at top, rgba(255, 196, 0, 0.12), transparent 65%), rgba(6, 12, 28, 0.72);
}
.profile-glow .account-meta-icon { color: #79e7ff; }
.profile-glow .account-meta-card-level .account-meta-icon { color: #ffd66b; }
.profile-glow .account-meta-label { color: #9fb2cc; }
.profile-glow .account-meta-value { color: #fff; }
.profile-glow .account-inline-progress-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}
.profile-glow .account-inline-progress-fill {
    background: linear-gradient(90deg, #ffd66b, #ffb43d);
}
