:root {
    --blue: #1685f8;
    --blue-dark: #075ebd;
    --navy: #102f59;
    --muted: #617fa6;
    --page: #fbfdff;
    --pale-blue: #eaf5ff;
    --line: #dcecff;
    --danger: #d64545;
    --gradient: linear-gradient(110deg, #178bff, #2780ee);
    --gradient-vertical: linear-gradient(180deg, #2f9bff, #075ebd);
}




.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

:focus-visible {
    outline: 3px solid rgba(22,133,248,.45);
    outline-offset: 2px;
}

/* ---------- Layout ---------- */

.stage {
    position: relative;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    max-width: 900px;
    margin: 0 auto;
    padding: 130px 40px 90px;
}

/* ---------- Sidebar tabs ---------- */

.tabs {
    align-self: start;
    display: flex;
    flex-direction: column;
    margin-top: 10px;
    background: var(--gradient-vertical);
    z-index: 2;
}

.tab {
    display: grid;
    place-items: center;
    width: 72px;
    height: 78px;
    border: 0;
    background: transparent;
    color: rgba(255,255,255,.9);
    transition: background .2s ease, color .2s ease;
}

.tab svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tab:hover { background: rgba(255,255,255,.14); }

.tab.is-active {
    position: relative;
    margin-left: -6px;
    width: 78px;
    background: #fff;
    color: var(--navy);
    box-shadow: 0 6px 20px rgba(16,47,89,.12);
}

/* ---------- Card ---------- */

.profile-card {
    position: relative;
    min-height: 330px;
    padding: 56px 48px 64px;
    background: #fff;
    box-shadow: 0 10px 40px rgba(16,47,89,.07);
}

.profile-card h1 {
    position: absolute;
    top: -52px;
    left: 30px;
    margin: 0;
    font-size: clamp(54px, 9vw, 84px);
    line-height: 1;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--navy);
    pointer-events: none;
}

.panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    column-gap: 40px;
    padding-top: 28px;
}

.panel[hidden] { display: none; }

.panel--single { grid-template-columns: minmax(0, 1fr); }

/* ---------- Fields ---------- */

.fields {
    display: grid;
    gap: 22px;
    max-width: 360px;
}

.field label {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.field input {
    width: 100%;
    padding: 8px 0 9px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    color: var(--navy);
    font: inherit;
    font-size: 14px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.field input::placeholder { color: #a9bdd6; font-size: 12px; }

.field input:focus {
    outline: none;
    border-bottom-color: var(--blue);
    box-shadow: 0 1px 0 var(--blue);
}

.field input[aria-invalid="true"] {
    border-bottom-color: var(--danger);
    box-shadow: 0 1px 0 var(--danger);
}

.error {
    display: block;
    min-height: 0;
    margin-top: 4px;
    color: var(--danger);
    font-size: 11px;
}

/* ---------- Avatar ---------- */

.avatar-block { justify-self: center; text-align: center; }

.avatar {
    position: relative;
    display: grid;
    place-items: center;
    width: 132px;
    height: 132px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    font-size: 44px;
    font-weight: 700;
}

.avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-edit {
    position: absolute;
    right: -2px;
    bottom: 2px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--navy);
    box-shadow: 0 3px 10px rgba(16,47,89,.2);
    transition: transform .2s ease;
}

.avatar-edit:hover { transform: scale(1.08); }

.avatar-edit svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Save button ---------- */

.save {
    position: absolute;
    right: -28px;
    bottom: -28px;
    min-width: 146px;
    padding: 17px 30px;
    border: 0;
    background: var(--gradient);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    box-shadow: 0 10px 24px rgba(22,133,248,.28);
    transition: transform .2s ease, box-shadow .2s ease;
}

.save:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(22,133,248,.34);
}

/* ---------- Switches ---------- */

.switches {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 22px;
}

.switch {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    font-size: 14px;
}

.switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-track {
    position: relative;
    flex: none;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: var(--line);
    transition: background .2s ease;
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(16,47,89,.25);
    transition: transform .2s ease;
}

.switch input:checked + .switch-track { background: var(--blue); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 3px solid rgba(22,133,248,.45); outline-offset: 2px; }

.empty { color: var(--muted); font-size: 14px; line-height: 1.8; max-width: 380px; }

/* ---------- Toast ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 20px);
    padding: 13px 22px;
    border-radius: 999px;
    background: var(--navy);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
    .stage {
        grid-template-columns: 1fr;
        padding: 40px 18px 70px;
    }

    .tabs {
        flex-direction: row;
        margin: 0 0 70px;
    }

    .tab { flex: 1; width: auto; height: 62px; }

    .tab.is-active {
        width: auto;
        margin: -6px 0 0;
    }

    .profile-card { padding: 50px 24px 80px; }

    .profile-card h1 { top: -62px; left: 20px; }

    .panel { grid-template-columns: 1fr; row-gap: 30px; }

    .avatar-block { order: -1; justify-self: start; }

    .save {
        right: 16px;
        bottom: -24px;
        left: 16px;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: .01ms !important;
    }
}

/* ---------- Manage pages (reuse the profile design) ---------- */
.manage-stage { padding-top: 80px; }

.manage-stage .profile-card h1 {
    font-size: clamp(34px, 6vw, 56px);
    top: -44px;
}

a.tab { text-decoration: none; }
a.tab:hover { color: #fff; }
a.tab.is-active:hover { color: var(--navy); }

.field input:disabled { color: var(--muted); }
.field .hint { color: var(--muted); font-size: 12px; }

.manage-text { color: var(--navy); font-size: 14px; line-height: 1.7; max-width: 420px; }

.manage-btn {
    display: inline-block;
    padding: 14px 26px;
    border: 0;
    background: var(--gradient);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(22,133,248,.28);
}
.manage-btn:hover { color: #fff; transform: translateY(-2px); }
.manage-btn--danger {
    background: #fff;
    color: var(--danger);
    border: 1px solid var(--danger);
    box-shadow: none;
}
.manage-btn--danger:hover { background: var(--danger); color: #fff; }

.link-btn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--blue-dark);
    font-size: 12px;
    font-weight: 700;
}