/* ==========================================================================
   Настройки аккаунта (/settings/)
   ========================================================================== */

.st {
    max-width: 1180px;
    padding-top: 32px;
}

.st-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.st-head .section__title {
    margin: 0;
}

.st-head__user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px 6px 6px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, .03);
    color: #fff;
    text-decoration: none;
    transition: background-color .2s ease, transform .2s ease;
}

.st-head__user:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.st-head__user b,
.st-head__user small {
    display: block;
    line-height: 1.25;
}

.st-head__user b {
    font-weight: 700;
}

.st-head__user small {
    font-size: 13px;
    color: var(--text-color-faint);
}

.st-grid {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

/* ---------- Меню разделов ---------- */

.st-nav {
    position: sticky;
    top: calc(var(--header-height) + 16px);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border-radius: var(--radius-lg);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
}

.st-nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    color: var(--text-color-muted);
    font-weight: 600;
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease;
}

.st-nav__item span {
    color: inherit;
    font-weight: inherit;
}

.st-nav__item .ic {
    flex: none;
    width: 20px;
    height: 20px;
}

.st-nav__item:hover {
    color: #fff;
    background: rgba(255, 255, 255, .06);
}

.st-nav__item.is-active {
    color: #fff;
    background: rgba(1, 174, 76, .16);
    box-shadow: inset 3px 0 0 var(--text-color-emphasis);
}

.st-nav__item.is-active .ic {
    color: var(--text-color-emphasis);
}

.st-nav__item_danger {
    margin-top: 6px;
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.st-nav__item_danger:hover {
    color: var(--danger-color);
    background: rgba(255, 77, 94, .08);
}

/* ---------- Панели ---------- */

.st-body {
    min-width: 0;
}

.st-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: st-in .35s ease both;
}

.st-panel + .st-panel {
    animation-delay: .06s;
}

.st-panel .cm-panel__title {
    margin: 0;
}

.st-lead {
    margin: -8px 0 0;
    color: var(--text-color-muted);
    line-height: 1.5;
}

.st-hint {
    margin: -6px 0 0;
}

.st-flash {
    animation: st-in .35s ease both;
}

.st-flash_bad {
    background: rgba(255, 77, 94, .1);
    border-color: rgba(255, 77, 94, .35);
}

.st-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.st-row > label,
.st-choice legend {
    margin: 0;
    color: var(--text-color-muted);
    font-size: 14px;
}

.st-row .errorlist,
.st-panel > .errorlist,
.st-media ~ .errorlist {
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--danger-color);
    font-size: 14px;
}

.st-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

select.field {
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    cursor: pointer;
}

select.field option {
    background: var(--surface-color-raised);
    color: #fff;
}

.st-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* ---------- Аватар и обложка ---------- */

.st-media {
    position: relative;
    padding-bottom: 56px;
}

.st-cover {
    height: 180px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(1, 174, 76, .25), rgba(166, 107, 255, .25)) center / cover no-repeat;
    overflow: hidden;
}

.st-cover__btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(6px);
    cursor: pointer;
}

.st-avatar {
    position: absolute;
    left: 24px;
    bottom: 0;
    width: 120px;
    height: 120px;
}

.st-avatar__img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--surface-color);
    background: var(--surface-color-raised);
    overflow: hidden;
    display: grid;
    place-items: center;
}

.st-avatar__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.st-avatar__img span {
    font-size: 44px;
    font-weight: 700;
    text-transform: uppercase;
}

.st-avatar__btn {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-gradient);
    border: 3px solid var(--surface-color);
    cursor: pointer;
}

.st-avatar__btn .ic {
    width: 18px;
    height: 18px;
}

.is-changed {
    animation: st-pop .45s cubic-bezier(.2, 1.4, .4, 1);
}

.st-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.st-checks:empty {
    display: none;
}

.st-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color-muted);
    font-size: 14px;
    cursor: pointer;
}

.st-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--text-color-emphasis);
}

/* ---------- Приватность ---------- */

.st-choice {
    border: 0;
    padding: 0;
    margin: 0;
}

.st-choice legend {
    margin-bottom: 10px;
}

.st-choice__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.st-choice__item {
    position: relative;
    display: inline-flex;
    cursor: pointer;
}

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

.st-choice__item span {
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, .03);
    color: var(--text-color-muted);
    font-size: 15px;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
}

.st-choice__item:hover span {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.st-choice__item input:checked + span {
    color: #fff;
    border-color: transparent;
    background: var(--accent-gradient);
}

.st-choice__item input:focus-visible + span {
    outline: 2px solid var(--text-color-emphasis);
    outline-offset: 2px;
}

.st-switch {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    color: #fff;
}

.st-switch span:last-child {
    color: inherit;
}

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

.st-switch__track {
    flex: none;
    position: relative;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    transition: background-color .25s ease;
}

.st-switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform .25s cubic-bezier(.3, 1.4, .5, 1);
}

.st-switch input:checked + .st-switch__track {
    background: var(--text-color-emphasis);
}

.st-switch input:checked + .st-switch__track::after {
    transform: translateX(20px);
}

.st-switch input:focus-visible + .st-switch__track {
    outline: 2px solid var(--text-color-emphasis);
    outline-offset: 2px;
}

@keyframes st-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@keyframes st-pop {
    0% { transform: scale(.94); }
    100% { transform: scale(1); }
}

/* ---------- Телефон ---------- */

@media (max-width: 860px) {
    .st {
        padding-top: 16px;
    }

    .st-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .st-nav {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        scrollbar-width: none;
        padding: 6px;
    }

    .st-nav::-webkit-scrollbar {
        display: none;
    }

    .st-nav__item {
        flex: none;
        padding: 10px 14px;
        white-space: nowrap;
    }

    .st-nav__item.is-active {
        box-shadow: inset 0 -3px 0 var(--text-color-emphasis);
    }

    .st-nav__item_danger {
        margin-top: 0;
        border-top: 0;
        border-radius: var(--radius-md);
    }

    .st-cols {
        grid-template-columns: 1fr;
    }

    .st-cover {
        height: 130px;
    }

    .st-avatar {
        left: 16px;
        width: 96px;
        height: 96px;
    }

    .st-cover__btn {
        top: 10px;
        right: 10px;
        min-height: 36px;
        padding: 0 14px;
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .st-panel,
    .st-flash,
    .is-changed {
        animation: none;
    }
}
