/* Регистрация — .auth-modal--reg + префикс .am-* (без конфликтов с глобальными .email / .heading) */
.auth-modal--reg .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    box-sizing: border-box;
}

.auth-modal--reg .hidden {
    display: none;
}

.auth-modal--reg .modal-input {
    background: transparent;
    border: 0;
    outline: none;
    color: #d1d5dc;
    width: 100%;
    min-width: 0;
    font-size: 14px;
    font-family: Arial, sans-serif;
}

.auth-modal--reg .modal-input::placeholder {
    color: #6a7282;
}

.auth-modal--reg .popap-registration {
    position: relative;
    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;
    width: 100%;
    max-width: 820px;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 1px;
    isolation: isolate;
    gap: 10px;
    text-align: left;
    font-size: 12.25px;
    color: #99a1af;
    font-family: Arial, sans-serif;
}

.auth-modal--reg .am-panel--reg {
    width: 100%;
    max-width: 818px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 28px 0;
    box-sizing: border-box;
    gap: 18px;
    z-index: 0;
    max-height: calc(100vh - 34px);
    overflow-y: auto;
}

.auth-modal--reg .am-field-error {
    margin: 0;
    color: #fca5a5;
    font-size: 11.5px;
    line-height: 1.35;
}

.auth-modal--reg .am-reg-header {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    font-size: 26.25px;
}

.auth-modal--reg .prmih-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px;
    flex-shrink: 0;
}

.auth-modal--reg .prmih-glow {
    position: absolute;
    left: 0;
    top: 0;
    width: 70px;
    height: 70px;
    border-radius: 14px;
    background: linear-gradient(180deg, #bf15a0, #5c0087);
    opacity: 0.55;
    filter: blur(24px);
    pointer-events: none;
}

.auth-modal--reg .prmih-icon-box {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(180deg, #bf15a0, #5c0087);
    box-shadow:
        0px 10px 15px 0px rgba(0, 0, 0, 0.1),
        0px 4px 6px 0px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    box-sizing: border-box;
}

.auth-modal--reg .prmih-lightning {
    display: block;
    width: 28px;
    height: 28px;
}

.auth-modal--reg .am-reg-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
}

.auth-modal--reg .am-title-gradient {
    position: relative;
    line-height: 31.5px;
    background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0)), linear-gradient(90deg, #fff, #e9d4ff 50%, #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-modal--reg .auth-modal-reg__subtitle-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.auth-modal--reg .auth-modal-reg__subtitle {
    margin: 0;
    position: relative;
    line-height: 21px;
    color: #99a1af;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    text-align: center;
    max-width: 100%;
}

.auth-modal--reg .am-form {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    color: #d1d5dc;
    width: 100%;
}

.auth-modal--reg .auth-reg-fields-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    width: 100%;
    align-items: start;
}

@media (min-width: 640px) {
    .auth-modal--reg .auth-reg-fields-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 22px 32px;
    }
}

.auth-modal--reg .auth-reg-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.auth-modal--reg .am-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-sizing: border-box;
}

.auth-modal--reg .am-field--pass {
    position: relative;
}

.auth-modal--reg .am-label-row {
    width: 100%;
    max-width: 100%;
    min-height: 17px;
    height: auto;
    display: flex;
    align-items: flex-start;
}

.auth-modal--reg .am-label {
    flex: 1;
    position: relative;
    line-height: 17.5px;
    font-size: 12.25px;
    color: #d1d5dc;
    text-align: left;
}

.auth-modal--reg .am-input-box:not(.site-select-shell) {
    width: 100%;
    max-width: 100%;
    height: 47px;
    border-radius: 12px;
    background-color: rgba(30, 41, 57, 0.5);
    border: 1px solid #364153;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 10px 16px;
    font-size: 14px;
    color: #6a7282;
}

.auth-modal--reg .am-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.auth-modal--reg .field-icon {
    height: 18px;
    width: 18px;
    flex-shrink: 0;
    object-fit: contain;
}

.auth-modal--reg .am-pass-box {
    width: 100%;
    max-width: 100%;
    height: 47px;
    border-radius: 12px;
    background-color: rgba(30, 41, 57, 0.5);
    border: 1px solid #364153;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    gap: 20px;
    font-size: 14px;
    color: #6a7282;
}

.auth-modal--reg .iconeye-btn {
    margin: 0;
    padding: 3px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 8px;
    color: #99a1af;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease;
}

.auth-modal--reg .iconeye-btn:hover {
    color: #e9d4ff;
    background-color: rgba(191, 21, 160, 0.15);
}

.auth-modal--reg .iconeye-btn:active {
    transform: scale(0.95);
}

.auth-modal--reg .iconeye {
    height: 20px;
    width: 20px;
    display: block;
}

.auth-modal--reg .am-politics {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    border-radius: 12.75px;
    background-color: rgba(30, 41, 57, 0.3);
    border: 1px solid rgba(54, 65, 83, 0.5);
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    padding: 10.5px 10.5px 10.5px;
    gap: 10.5px;
    font-size: 14px;
    color: #99a1af;
}

.auth-modal--reg .am-politics-check {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    background: transparent;
    border: none;
}

.auth-modal--reg .am-politics-check input {
    width: 15px;
    height: 15px;
    margin: 0;
    cursor: pointer;
    accent-color: #bf15a0;
    flex-shrink: 0;
    appearance: auto;
    -webkit-appearance: checkbox;
}

.auth-modal--reg .am-politics-text-wrap {
    min-height: 35px;
    flex: 1;
    display: flex;
    align-items: flex-start;
    min-width: 0;
}

.auth-modal--reg .am-politics-text {
    max-width: 100%;
    position: relative;
    line-height: 17.5px;
    display: inline-block;
    flex-shrink: 0;
}

.auth-modal--reg .am-politics-link {
    color: #ff00d0;
    cursor: pointer;
}

.auth-modal--reg .button-and-icon {
    width: 100%;
    max-width: 100%;
    height: 42px;
    box-shadow: 0px 10px 15px -3px rgba(173, 70, 255, 0.5), 0px 4px 6px -4px rgba(173, 70, 255, 0.5);
    border-radius: 12px;
    border: none;
    cursor: pointer;
    background: linear-gradient(180deg, #bf15a0, #a70088 50%, #5c0087);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    box-sizing: border-box;
    font-size: 14px;
    color: #fff;
    transition:
        filter 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;
}

.auth-modal--reg .button-and-icon:hover {
    filter: brightness(1.08);
    box-shadow:
        0px 12px 22px -3px rgba(173, 70, 255, 0.55),
        0px 6px 10px -4px rgba(173, 70, 255, 0.45);
}

.auth-modal--reg .button-and-icon:active {
    transform: translateY(1px);
    filter: brightness(0.96);
}

.auth-modal--reg .button-and-icon .auth-modal-reg__submit-label {
    position: relative;
    line-height: 21px;
    font-weight: 700;
    color: #fff;
}

.auth-modal--reg .am-down-fields {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #fff;
    padding-bottom: 22px;
    width: 100%;
}

.auth-modal--reg .am-down-fields-sep {
    width: 100%;
    max-width: 100%;
    height: 1px;
    position: relative;
    border-top: 1px solid rgba(153, 161, 175, 0.5);
    box-sizing: border-box;
}

.auth-modal--reg .am-down-hint-row--reg {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0px 8px;
}

.auth-modal--reg .am-down-hint-text {
    position: relative;
    line-height: 17.5px;
    font-size: 12.25px;
}

.auth-modal--reg .link-login {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 12.25px;
    line-height: 17.5px;
    color: #99a1af;
    text-decoration: underline;
    text-align: center;
    transition:
        color 0.2s ease,
        text-shadow 0.2s ease,
        transform 0.15s ease;
}

.auth-modal--reg .link-login:hover {
    color: #fff;
    text-shadow: 0 0 14px rgba(191, 21, 160, 0.5);
}

.auth-modal--reg .link-login:active {
    transform: scale(0.98);
}

.auth-modal--reg .button-close {
    height: 35px;
    width: 35px;
    margin: 0 !important;
    position: absolute;
    top: 14px;
    right: 14px;
    left: auto;
    border-radius: 12.75px;
    background-color: rgba(30, 41, 57, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #99a1af;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

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

.auth-modal--reg .button-close:active {
    color: #ef4444;
    background-color: rgba(185, 28, 28, 0.4);
}

.auth-modal--reg .button-close:focus-visible {
    outline: 2px solid #f87171;
    outline-offset: 2px;
}

.auth-modal--reg .iconbase {
    height: 17.5px;
    width: 17.5px;
    position: relative;
    display: block;
    flex-shrink: 0;
}

.auth-modal--reg .auth-reg-pass-rules {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    clear: both;
    position: relative;
    z-index: 1;
}

@media (max-width: 639px) {
    .auth-modal--reg .auth-reg-pass-rules {
        grid-template-columns: 1fr;
    }
}

.auth-modal--reg .auth-reg-pass-rule {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 11.5px;
    line-height: 1.3;
    color: #6a7282;
    transition:
        color 0.2s ease,
        opacity 0.2s ease;
}

.auth-modal--reg .auth-reg-pass-rule.is-met {
    color: #4ade80;
}

.auth-modal--reg .auth-reg-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;
}

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

.auth-modal--reg .auth-reg-pass-rule.is-met .auth-reg-pass-rule-mark::after,
.auth-modal--reg .auth-reg-pass-match.is-met .auth-reg-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);
}

.auth-modal--reg .auth-reg-pass-match {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 4px;
    width: 100%;
    font-size: 11.5px;
    line-height: 1.3;
    color: #6a7282;
    transition: color 0.2s ease;
}

.auth-modal--reg .auth-reg-pass-match.is-met {
    color: #4ade80;
}

.auth-modal--reg .plmh-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
}

.auth-modal--reg .plmh-glow {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: rgba(191, 21, 160, 0.42);
    filter: blur(20px);
}

.auth-modal--reg .plmh-icon-box {
    position: relative;
    display: flex;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(145deg, #bf15a0, #5c0087);
}

.auth-modal--reg .plmh-lightning {
    display: block;
    width: 28px;
    height: 28px;
}

.role-select {
    position: relative;
    width: 100%;
}

.role-select__trigger {
    display: flex;
    width: 100%;
    min-height: 47px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border: 1px solid #364153;
    border-radius: 12px;
    color: #d1d5dc;
    background: rgba(30, 41, 57, 0.72);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.role-select__trigger:hover,
.role-select__trigger:focus-visible {
    border-color: rgba(191, 21, 160, 0.7);
    outline: none;
    box-shadow: 0 0 0 1px rgba(191, 21, 160, 0.3);
}

.role-select__placeholder { color: #6a7282; }
.role-select__chevron { width: 8px; height: 8px; border-right: 2px solid #99a1af; border-bottom: 2px solid #99a1af; transform: rotate(45deg) translateY(-2px); }

.role-select__menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    padding: 6px;
    border: 1px solid rgba(191, 21, 160, 0.45);
    border-radius: 12px;
    background: linear-gradient(145deg, #182342, #0a1024);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.48);
}

.role-select__option {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    color: #d1d5dc;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.role-select__option:hover,
.role-select__option.is-selected { color: #fff; background: rgba(191, 21, 160, 0.22); }

.auth-modal--reg .auth-reg-password-strength {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-top: -4px;
}

.auth-modal--reg .auth-reg-password-strength span { height: 4px; border-radius: 999px; background: #364153; }
.auth-modal--reg .auth-reg-password-strength .is-active { background: #f59e0b; }
.auth-modal--reg .auth-reg-password-strength .is-level-3,
.auth-modal--reg .auth-reg-password-strength .is-level-4 { background: #4ade80; }

.auth-modal--reg .button-and-icon:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    filter: saturate(0.65) brightness(0.88);
    box-shadow: none;
    transform: none;
}

.auth-modal--reg .button-and-icon:disabled:hover,
.auth-modal--reg .button-and-icon:disabled:active {
    filter: saturate(0.65) brightness(0.88);
    box-shadow: none;
    transform: none;
}

.auth-modal--reg .modal-input:focus,
.auth-modal--reg .modal-input:focus-visible {
    outline: none;
    box-shadow: none;
}

.auth-modal--reg .modal-input::selection {
    background: rgba(191, 21, 160, 0.45);
    color: #fff;
}

.auth-modal--reg .am-input-box:not(.site-select-shell):focus-within,
.auth-modal--reg .am-pass-box:focus-within {
    border-color: rgba(191, 21, 160, 0.65);
    box-shadow: 0 0 0 1px rgba(191, 21, 160, 0.4);
}

@media (max-height: 760px) {
    .auth-modal--reg .am-panel--reg {
        gap: 12px;
        padding: 16px 22px 0;
    }

    .auth-modal--reg .am-reg-header {
        gap: 5px;
    }

    .auth-modal--reg .prmih-icon-wrap {
        padding: 4px;
    }

    .auth-modal--reg .prmih-icon-box {
        width: 48px;
        height: 48px;
        padding: 11px;
    }

    .auth-modal--reg .prmih-lightning {
        width: 24px;
        height: 24px;
    }

    .auth-modal--reg .am-title-gradient {
        font-size: 22px;
        line-height: 26px;
    }

    .auth-modal--reg .auth-modal-reg__subtitle {
        font-size: 13px;
        line-height: 18px;
    }

    .auth-modal--reg .am-form {
        gap: 10px;
    }

    .auth-modal--reg .auth-reg-fields-row {
        gap: 10px;
    }

    @media (min-width: 640px) {
        .auth-modal--reg .auth-reg-fields-row {
            gap: 14px 24px;
        }
    }

    .auth-modal--reg .auth-reg-stack {
        gap: 8px;
    }

    .auth-modal--reg .am-input-box:not(.site-select-shell),
    .auth-modal--reg .am-pass-box {
        min-height: 42px;
        height: 42px;
    }

    .auth-modal--reg .am-down-fields {
        gap: 10px;
        padding-bottom: 16px;
    }

    .auth-modal--reg .button-and-icon {
        height: 40px;
    }
}
