/* Попапы настроек профиля — классы profile-pr-* без конфликта со страницей */

.profile-pr-modal .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
    box-sizing: border-box;
}

.profile-pr-modal .hidden {
    display: none;
}

.profile-pr-popap {
    position: relative;
    width: 100%;
    max-width: 571px;
    box-shadow: 0px 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-radius: 21px;
    background: linear-gradient(180deg, #101828, #000);
    border: 1px solid rgba(191, 21, 160, 0.3);
    box-sizing: border-box;
    overflow: hidden;
    padding: 1px;
    isolation: isolate;
    font-family: Arial, sans-serif;
    color: #99a1af;
    animation: profile-pr-pop-in 0.28s ease-out;
}

@keyframes profile-pr-pop-in {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.profile-pr-inner {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    max-height: min(90vh, 900px);
    overflow-y: auto;
    box-sizing: border-box;
}

.profile-pr-head-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.profile-pr-icon-wrap {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.profile-pr-glow {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    filter: blur(24px);
    opacity: 0.55;
    pointer-events: none;
}

.profile-pr-glow--avatar {
    background: linear-gradient(135deg, #f0b100, #ff6900);
    opacity: 0.6;
}

.profile-pr-glow--nick {
    background: linear-gradient(135deg, #ad46ff, #f6339a);
    opacity: 0.51;
}

.profile-pr-glow--pass {
    background: linear-gradient(135deg, #fb2c36, #ff6900);
    opacity: 0.58;
}

.profile-pr-glow--roles {
    background: linear-gradient(135deg, #2b7fff, #bf15a0);
    opacity: 0.55;
}

.profile-pr-icon-box {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 10px 15px rgba(0, 0, 0, 0.1), 0px 4px 6px rgba(0, 0, 0, 0.1);
}

.profile-pr-icon-box--avatar {
    background: linear-gradient(135deg, #f0b100, #ff6900);
}

.profile-pr-icon-box--nick {
    background: linear-gradient(135deg, #ad46ff, #f6339a);
}

.profile-pr-icon-box--pass {
    background: linear-gradient(135deg, #fb2c36, #ff6900);
}

.profile-pr-icon-box--roles {
    background: linear-gradient(135deg, #2b7fff, #bf15a0);
}

.profile-pr-icon-box img {
    filter: brightness(0) invert(1);
}

.profile-pr-title {
    margin: 0;
    font-size: 26.25px;
    font-weight: 700;
    line-height: 31.5px;
    background: linear-gradient(90deg, #fff, #e9d4ff 50%, #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Аватар */
.profile-pr-avatar-block {
    display: flex;
    justify-content: center;
    width: 100%;
}

.profile-pr-avatar-ring {
    position: relative;
    width: 112px;
    height: 112px;
}

.profile-pr-avatar-glow {
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    background: linear-gradient(180deg, #bf15a0, #5c0087);
    opacity: 0.5;
    filter: blur(24px);
    pointer-events: none;
}

.profile-pr-avatar-frame {
    position: relative;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    border: 4px solid #bf15a0;
    overflow: hidden;
    box-sizing: border-box;
    background: #1e2939;
}

.profile-pr-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-pr-avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 31.5px;
    font-weight: 400;
    color: #fff;
    background: linear-gradient(180deg, #bf15a0, #5c0087);
}

.profile-pr-avatar-img:not([hidden]) + .profile-pr-avatar-fallback {
    display: none;
}

.profile-pr-avatar-cam {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 35px;
    height: 35px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
    transition: transform 0.2s ease;
}

.profile-pr-avatar-cam:hover {
    transform: scale(1.06);
}

.profile-pr-avatar-cam-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(180deg, #bf15a0, #5c0087);
    box-shadow: 0 0 12px rgba(191, 21, 160, 0.5);
}

.profile-pr-avatar-cam-inner img {
    filter: brightness(0) invert(1);
}

.profile-pr-field-block {
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 100%;
}

.profile-pr-label {
    font-size: 12.25px;
    color: #d1d5dc;
    line-height: 1.2;
}

.profile-pr-file-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    cursor: pointer;
}

label.profile-pr-file-row {
    margin: 0;
    font-weight: inherit;
}

.profile-pr-btn-file {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 40.5px;
    padding: 0 15px;
    border-radius: 12.75px;
    border: 1px solid #364153;
    background: rgba(30, 41, 57, 0.5);
    color: #d1d5dc;
    font-size: 14px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.15s ease;
}

.profile-pr-btn-file:hover {
    border-color: rgba(191, 21, 160, 0.55);
    background: rgba(30, 41, 57, 0.75);
}

.profile-pr-btn-file:active {
    transform: scale(0.98);
}

.profile-pr-filename {
    font-size: 12.25px;
    color: #05df72;
    word-break: break-all;
    max-width: 100%;
}

.profile-pr-hint {
    margin: 0;
    font-size: 12.25px;
    line-height: 17.5px;
    color: #6a7282;
}

.profile-pr-hint--tight {
    margin-top: 6px;
    margin-bottom: 0;
}

/* Чеклист требований к паролю */
.profile-pr-pass-rules {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 515px;
    align-self: stretch;
}

.profile-pr-pass-rule {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12.25px;
    line-height: 1.35;
    color: #6a7282;
    transition:
        color 0.2s ease,
        opacity 0.2s ease;
}

.profile-pr-pass-rule.is-met {
    color: #4ade80;
}

.profile-pr-pass-rule-mark {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    border-radius: 50%;
    border: 1px solid #364153;
    background: rgba(30, 41, 57, 0.45);
    box-sizing: border-box;
    position: relative;
    overflow: visible;
    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.profile-pr-pass-rule.is-met .profile-pr-pass-rule-mark {
    border-color: rgba(74, 222, 128, 0.65);
    background: rgba(34, 197, 94, 0.18);
}

.profile-pr-pass-rule.is-met .profile-pr-pass-rule-mark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #4ade80;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Подсказки */
.profile-pr-tip {
    position: relative;
    width: 100%;
    border-radius: 12.75px;
}

.profile-pr-tip-blur {
    position: absolute;
    inset: -3.5px;
    border-radius: 12.75px;
    filter: blur(8px);
    z-index: 0;
    pointer-events: none;
}

.profile-pr-tip-blur--blue {
    background: linear-gradient(90deg, rgba(43, 127, 255, 0.2), rgba(0, 184, 219, 0.2));
}

.profile-pr-tip-blur--amber {
    background: linear-gradient(90deg, rgba(240, 177, 0, 0.2), rgba(255, 105, 0, 0.2));
}

.profile-pr-tip-blur--red {
    background: linear-gradient(90deg, rgba(251, 44, 54, 0.2), rgba(246, 51, 154, 0.2));
}

.profile-pr-tip-body {
    position: relative;
    z-index: 1;
    border-radius: 12.75px;
    border: 1px solid #364153;
    padding: 15px 15px 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.profile-pr-tip--blue .profile-pr-tip-body {
    background: linear-gradient(167deg, #101828, #000);
}

.profile-pr-tip--amber .profile-pr-tip-body--amber {
    border-color: rgba(240, 177, 0, 0.3);
    background: linear-gradient(164deg, rgba(115, 62, 10, 0.3), rgba(126, 42, 12, 0.3));
}

.profile-pr-tip--red .profile-pr-tip-body--red {
    border-color: rgba(251, 44, 54, 0.3);
    background: linear-gradient(164deg, rgba(130, 24, 26, 0.3), rgba(134, 16, 67, 0.3));
}

.profile-pr-tip-head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 400;
    color: #fff;
}

.profile-pr-tip-ico {
    width: 28px;
    height: 28px;
    border-radius: 8.75px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-pr-tip-ico--amber {
    background: linear-gradient(135deg, #f0b100, #ff6900);
}

.profile-pr-tip-ico--red {
    background: linear-gradient(135deg, #fb2c36, #f6339a);
}

.profile-pr-tip-ico img {
    filter: brightness(0) invert(1);
}

.profile-pr-tip-title {
    font-weight: 700;
}

.profile-pr-tip-list {
    margin: 0;
    padding: 0 0 0 4px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 3.5px;
}

.profile-pr-tip-list li {
    font-size: 12.25px;
    line-height: 17.5px;
    color: #99a1af;
}

.profile-pr-tip-list--amber li {
    color: #fff085;
}

.profile-pr-tip-list--red li {
    color: #ffc9c9;
}

/* Поля формы */
.profile-pr-form {
    display: flex;
    flex-direction: column;
    gap: 21px;
    width: 100%;
}

/* Разметка как у регистрации — на всю ширину попапа */
.profile-pr-modal .profile-pr-auth-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    align-self: stretch;
}

/* Поля как в auth-modal--reg; без глобальных .email / .password страниц */
.profile-pr-modal .profile-pr-auth-fields.auth-modal--reg .am-field,
.profile-pr-modal .profile-pr-auth-fields .am-field--pass {
    align-items: flex-start;
    align-self: stretch;
    max-width: none;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    gap: 8px;
}

.profile-pr-modal .profile-pr-auth-fields .am-label-row {
    max-width: none;
    width: 100%;
}

.profile-pr-modal .profile-pr-auth-fields .am-input-box,
.profile-pr-modal .profile-pr-auth-fields .am-pass-box {
    max-width: none;
    width: 100%;
}

.profile-pr-modal .profile-pr-auth-fields .am-field .profile-pr-hint,
.profile-pr-modal .profile-pr-auth-fields .am-field--pass .profile-pr-hint {
    align-self: stretch;
    width: 100%;
    text-align: left;
}

.profile-pr-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* Скрытый file input — без [hidden], чтобы label/клик работали стабильно */
.profile-pr-sr-only-file {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.profile-pr-field-block--upload {
    position: relative;
}

.profile-pr-file-row {
    cursor: pointer;
}

.profile-pr-input-shell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 47px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid #364153;
    background: rgba(30, 41, 57, 0.5);
    box-sizing: border-box;
    width: 100%;
    max-width: 515px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.profile-pr-input-shell:focus-within {
    border-color: rgba(191, 21, 160, 0.65);
    box-shadow: 0 0 0 1px rgba(191, 21, 160, 0.35);
}

.profile-pr-input-shell .modal-input[readonly] {
    opacity: 0.85;
    cursor: default;
}

.pr-input-row .profile-pr-input--grow {
    flex: 1;
    min-width: 0;
}

.profile-pr-input {
    flex: 1;
    min-width: 0;
}

.profile-pr-error {
    margin: 0;
    color: #fca5a5;
    font-size: 12px;
    line-height: 1.35;
}

.profile-pr-eye {
    flex-shrink: 0;
    padding: 2px 0;
    border: none;
    background: transparent;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.profile-pr-eye:hover {
    opacity: 1;
}

/* Надежность пароля */
.profile-pr-strength {
    width: 100%;
    max-width: 515px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.profile-pr-strength-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.profile-pr-strength-label {
    font-size: 12.25px;
    color: #99a1af;
}

.profile-pr-strength-value {
    font-size: 12.25px;
    font-weight: 700;
    white-space: nowrap;
}

.profile-pr-strength-value.level-0 {
    color: #99a1af;
}

.profile-pr-strength-value.level-1 {
    color: #f87171;
}

.profile-pr-strength-value.level-2 {
    color: #fdc700;
}

.profile-pr-strength-value.level-3 {
    color: #4ade80;
}

.profile-pr-strength-value.level-4 {
    color: #22c55e;
}

.profile-pr-strength-track {
    height: 7px;
    border-radius: 999px;
    background: #1e2939;
    overflow: hidden;
}

.profile-pr-strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    transition:
        width 0.25s ease,
        background 0.25s ease;
}

.profile-pr-strength-bar.level-0 {
    width: 0%;
    min-width: 0;
    background: transparent;
}

.profile-pr-strength-bar.level-1 {
    width: 25%;
    min-width: 18%;
    background: linear-gradient(90deg, #fb2c36, #f6339a);
}

.profile-pr-strength-bar.level-2 {
    width: 50%;
    background: linear-gradient(90deg, #f0b100, #ff6900);
}

.profile-pr-strength-bar.level-3 {
    width: 75%;
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.profile-pr-strength-bar.level-4 {
    width: 100%;
    background: linear-gradient(90deg, #22c55e, #86efac);
}

/* Кнопки */
.profile-pr-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    max-width: 515px;
    flex-wrap: wrap;
}

.profile-pr-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 45px;
    padding: 10px 16px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(180deg, #bf15a0, #a70088 50%, #5c0087);
    box-shadow: 0px 10px 15px rgba(173, 70, 255, 0.5), 0px 4px 6px rgba(173, 70, 255, 0.5);
    transition:
        transform 0.18s ease,
        filter 0.18s ease,
        box-shadow 0.18s ease;
}

.profile-pr-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0px 12px 22px rgba(173, 70, 255, 0.55), 0px 6px 10px rgba(173, 70, 255, 0.45);
}

.profile-pr-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.profile-pr-btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.3);
}

.profile-pr-btn-primary--lg {
    flex: 1;
    min-width: 200px;
}

.profile-pr-btn-primary .profile-pr-save-icon {
    color: #fff;
    flex-shrink: 0;
}

.profile-pr-btn-primary .profile-pr-key-ico {
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}

.profile-pr-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid #364153;
    background: rgba(30, 41, 57, 0.5);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease;
}

.profile-pr-btn-secondary:hover {
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(220, 38, 38, 0.15);
    color: #fecaca;
}

.profile-pr-btn-secondary:active {
    transform: scale(0.98);
}

/* Закрыть */
.profile-pr-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 35px;
    height: 35px;
    padding: 0;
    border: none;
    border-radius: 12.75px;
    background: rgba(30, 41, 57, 0.8);
    color: #99a1af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.profile-pr-close:hover {
    color: #f87171;
    background: rgba(220, 38, 38, 0.28);
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.45);
}

.profile-pr-close:active {
    color: #ef4444;
    background: rgba(185, 28, 28, 0.4);
}

.profile-pr-close:focus-visible {
    outline: 2px solid #f87171;
    outline-offset: 2px;
}

.profile-pr-close-svg {
    display: block;
    flex-shrink: 0;
}

/* Триггеры на странице профиля */
.prof-sess .pprb-button-main[data-open-modal],
.profile-page-no-enter .pprb-button-main[data-open-modal] {
    cursor: pointer;
    border-radius: 8px;
    outline: none;
    transition:
        transform 0.18s ease,
        filter 0.2s ease;
}

.prof-sess .pprb-button-main[data-open-modal]:hover,
.profile-page-no-enter .pprb-button-main[data-open-modal]:hover {
    filter: brightness(1.06);
}

.prof-sess .pprb-button-main[data-open-modal]:active,
.profile-page-no-enter .pprb-button-main[data-open-modal]:active {
    transform: scale(0.992);
}

.prof-sess .pprb-button-main[data-open-modal]:focus-visible,
.profile-page-no-enter .pprb-button-main[data-open-modal]:focus-visible {
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.55);
}

button.mini-button-square.pp-profile-open-avatar {
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        filter 0.2s ease,
        box-shadow 0.2s ease;
}

button.mini-button-square.pp-profile-open-avatar:hover {
    filter: brightness(1.12);
    box-shadow: 0px 6px 14px -2px rgba(191, 21, 160, 0.45);
}

button.mini-button-square.pp-profile-open-avatar:active {
    transform: scale(0.95);
}

button.mini-button-square.pp-profile-open-avatar:focus-visible {
    outline: 2px solid #f87171;
    outline-offset: 2px;
}
