/* ════════════════════════════════════════════════════
 * Settings → User section
 * ════════════════════════════════════════════════════
 *
 * Ports the Lani Prime "Profile" design (handoff `lps-profile-*` /
 * `lps-field-group` / `lps-input` tokens) onto Shell skin variables.
 * Class names are scoped to `su-*` so they don't collide with the
 * provider section's `sp-*` rules.
 */

/* Fills the shared .sp-section-wrap column (960px, centred) the page sits in; no column of its own. */
.su-section {
    width: 100%;
}

/* ── Profile header card ──────────────────────────── */

.su-profile-hdr {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    margin-bottom: 28px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.su-avatar-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00B4EA, #7C3AED);
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.su-avatar-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-panel);
    display: block;
}

/* The initial stands in for a photo: the auth session carries no avatar URL. */
.su-avatar-initial {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-panel);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-title-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.su-profile-meta { flex: 1; min-width: 0; }

.su-tier {
    flex: none;
    font-size: var(--fs-ui);
    font-weight: 500;
    color: var(--text-secondary);
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
}
.su-profile-name {
    font-size: var(--fs-body-lg);
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.su-profile-email {
    font-size: var(--fs-body);
    color: var(--text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Form fields ──────────────────────────────────── */

/* The fields span the column, the same width as the header card above them. */
.su-field-group { margin-bottom: 20px; }

.su-label {
    display: block;
    font-size: var(--fs-body);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.su-input {
    width: 100%;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-panel);
    color: var(--text-primary);
    font-size: var(--fs-body-lg);
    font-family: inherit;
    padding: 0 12px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}
.su-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
/* Email (the account's own, never editable here) and Display Name while a save is out. */
.su-input:disabled {
    background: var(--bg-input, var(--bg-panel-2, var(--bg-panel)));
    color: var(--text-secondary);
    opacity: 0.6;
    cursor: not-allowed;
}

.su-hint {
    margin: 6px 0 0;
    font-size: var(--fs-meta);
    color: var(--text-muted);
}

.su-error {
    margin: 0 0 12px;
    font-size: var(--fs-ui);
    color: var(--status-error);
}

.su-input-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.su-input-row .su-input { flex: 1; }

/* ── Buttons ──────────────────────────────────────── */

.su-btn {
    height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    font-family: inherit;
    font-size: var(--fs-body);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease, color 0.15s ease;
    border: 1px solid transparent;
    white-space: nowrap;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.su-btn-primary {
    background: var(--text-primary);
    color: var(--bg-panel);
    padding: 0 18px;
    font-weight: 600;
    border-color: var(--text-primary);
}
.su-btn-primary:hover { opacity: 0.85; }

.su-btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}
.su-btn-ghost:hover {
    background: var(--bg-hover, color-mix(in srgb, var(--text-primary) 6%, transparent));
    color: var(--text-primary);
}

.su-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Action row + saved confirmation ──────────────── */

/* Right-aligned under the fields: Cancel, then Save changes at the far right. */
.su-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

/* Shown where the buttons were, so it sits at the right too. */
.su-saved-flag {
    display: block;
    text-align: right;
    margin-top: 8px;
    font-size: var(--fs-ui);
    color: var(--accent-success, #16a34a);
    font-weight: 500;
}
.su-saved-flag[hidden] { display: none; }
/* Save changes / Cancel appear only while the name differs from the saved one; the
   flex rule above would otherwise outrank the hidden attribute. */
.su-actions[hidden] { display: none; }

/* ── Mobile ───────────────────────────────────────── */

@media (max-width: 720px) {
    .su-input-row { flex-direction: column; }
    .su-input-row .su-btn-ghost { align-self: flex-start; }
}
