.profile-page {
    max-width: 700px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease both;
}

.profile-page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.profile-page-header h2 {
    font-size: 1.4rem;
}

.profile-page-header .icon {
    font-size: 22px;
}

/* Profile Card */
.profile-card {
    display: none;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* Card Sections */
.profile-section {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-subtle);
}

.profile-section:last-child {
    border-bottom: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    color: var(--text-primary);
}

.section-header h3 .section-icon {
    font-size: 16px;
}

/* Account Details */
.detail-row {
    display: flex;
    align-items: baseline;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    min-width: 110px;
    flex-shrink: 0;
}

.detail-value {
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-value a {
    color: var(--accent-primary-light);
    text-decoration: none;
    transition: var(--transition-fast);
}

.detail-value a:hover {
    color: #fff;
}

/* Edit Mode */
.edit-mode-container {
    display: none;
    margin-top: 16px;
}

.edit-form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.edit-form-row label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    min-width: 80px;
    margin-bottom: 0;
}

.edit-form-row input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.edit-form-row input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.edit-message {
    margin-top: 12px;
    display: none;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
}

/* Usage Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 18px;
    text-align: center;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.stat-value.tier {
    text-transform: capitalize;
    color: var(--color-warning);
    font-family: var(--font-sans);
}

.stat-value.executions { color: var(--color-info); }
.stat-value.analyses { color: var(--accent-primary-light); }

.stat-subtext {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Upgrade Banner */
.upgrade-banner {
    display: none;
    padding: 28px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12) 0%, rgba(167, 139, 250, 0.08) 100%);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--radius-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.upgrade-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #7c3aed, #a78bfa, #7c3aed);
    background-size: 200% 100%;
    animation: gradientShift 3s linear infinite;
}

.upgrade-banner h4 {
    color: #fff;
    margin-bottom: 8px;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.upgrade-banner p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.upgrade-banner .btn {
    padding: 12px 28px;
    font-size: 15px;
}

/* Auth Error */
.auth-error-card {
    display: none;
    background: var(--color-danger-dim);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    color: var(--color-danger);
    font-size: 14px;
    max-width: 500px;
    margin: 60px auto;
}

.auth-error-card .icon {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
}

@media (max-width: 768px) {
    .profile-section { padding: 20px; }
    .edit-form-row { flex-direction: column; align-items: stretch; }
    .edit-form-row label { min-width: auto; margin-bottom: 4px; }
    .stats-grid { grid-template-columns: 1fr; }
    .detail-row { flex-direction: column; gap: 4px; }
}
