.stage-password-layout > [class*="col-"] {
    flex: 0 0 auto;
    width: min(100%, 420px);
}

#auth-screen > .row > [class*="col-"] {
    flex: 0 0 auto;
    width: min(100%, 420px);
}

#auth-screen .card-body {
    min-height: 340px;
}

.stage-password-label {
    display: block;
    margin-bottom: 6px;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
}

.stage-password-field {
    position: relative;
}

.stage-password-field .form-control {
    min-height: 44px;
    padding-right: 44px;
}

.stage-password-field .form-control.is-valid,
.stage-password-field .form-control.is-invalid {
    padding-right: 44px !important;
    background-image: none !important;
}

.stage-password-field.has-cyrillic .form-control {
    padding-right: 194px !important;
    border-color: #dc3545;
}

.stage-password-field.has-cyrillic .form-control:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.18);
}

.stage-keyboard-warning {
    position: absolute;
    top: 50%;
    right: 43px;
    display: none;
    color: #dc3545;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    pointer-events: none;
    transform: translateY(-50%);
}

.stage-password-field.has-cyrillic .stage-keyboard-warning {
    display: block;
}

.stage-password-eye {
    position: absolute;
    top: 50%;
    right: 7px;
    width: 32px;
    height: 32px;
    padding: 6px;
    border: 0;
    background: transparent;
    color: #7b8493;
    transform: translateY(-50%);
}

.stage-password-eye:hover,
.stage-password-eye:focus-visible {
    color: #245fd6;
}

.stage-password-eye:focus-visible {
    outline: 2px solid rgba(36, 95, 214, 0.28);
    outline-offset: 1px;
}

.stage-password-eye svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stage-password-layout {
    position: relative;
}

.stage-password-card-column {
    flex: 0 0 auto;
    width: min(100%, 420px);
}

.stage-password-help {
    position: absolute;
    top: 62px;
    left: calc(50% + 218px);
    z-index: 2;
    width: 260px;
    padding: 16px;
    border: 1px solid #dfe3e9;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(35, 44, 60, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-6px);
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.stage-password-help.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.stage-password-help-title {
    margin-bottom: 12px;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
}

.stage-password-rules {
    display: flex;
    flex-direction: column;
    gap: 9px;
    color: #7b8493;
    font-size: 12px;
    line-height: 1.3;
    text-align: left;
}

.stage-password-rules > div {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    min-width: 0;
}

.stage-password-rules span {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    border: 1px solid #c9ced7;
    border-radius: 50%;
    color: transparent;
    font-size: 11px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.stage-password-rules .is-valid {
    color: #198754;
}

.stage-password-rules .is-valid span {
    border-color: #198754;
    background: #198754;
    color: #fff;
}

#stage-change-password-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

@media (max-width: 959px) {
    .stage-password-help {
        position: static;
        width: min(100%, 420px);
        max-height: 0;
        margin: 0 auto;
        padding-top: 0;
        padding-bottom: 0;
        overflow: hidden;
        transform: translateY(-6px);
        box-shadow: none;
    }

    .stage-password-help.is-visible {
        max-height: 280px;
        margin-top: 12px;
        padding-top: 16px;
        padding-bottom: 16px;
        transform: translateY(0);
    }
}
