.password-field {
    position: relative;
    width: 100%;
}

.password-field__input-wrap {
    position: relative;
}

.password-field__input {
    width: 100%;
    padding-inline-end: 2.75rem !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme6-auth-field .password-field__input.theme6-auth-input,
.theme6-auth-field .password-field__input.input {
    padding-inline-end: 2.75rem;
}

/* Strength border colors */
.password-field--weak .password-field__input {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 1px rgba(220, 53, 69, 0.15);
}

.password-field--medium .password-field__input {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.15);
}

.password-field--strong .password-field__input {
    border-color: #198754 !important;
    box-shadow: 0 0 0 1px rgba(25, 135, 84, 0.15);
}

/* Keep same font as the form when password is visible */
.password-field__input--visible {
    font-family: inherit;
    letter-spacing: normal;
}

.password-field__toggle {
    position: absolute;
    inset-inline-end: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--tg-theme-primary, #2a8489);
    cursor: pointer;
    opacity: 0.85;
}

.password-field__toggle:hover {
    opacity: 1;
}

/* Strength meter — 3 segments only (no pseudo-elements) */
.password-field__strength {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.5rem;
    min-height: 1rem;
}

.password-field__strength-bar {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0.35rem;
    height: 6px;
    min-width: 0;
}

.password-field__strength-segment {
    flex: 1 1 0;
    min-width: 0;
    height: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: #e9ecef;
    transition: background-color 0.2s ease;
}

.password-field--weak .password-field__strength-segment:nth-child(1) {
    background: #dc3545;
}

.password-field--medium .password-field__strength-segment:nth-child(1),
.password-field--medium .password-field__strength-segment:nth-child(2) {
    background: #0d6efd;
}

.password-field--strong .password-field__strength-segment {
    background: #198754;
}

.password-field__strength-text {
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    min-width: 4.5rem;
    text-align: end;
    align-self: center;
}

.password-field__strength-text--weak {
    color: #dc3545;
}

.password-field__strength-text--medium {
    color: #0d6efd;
}

.password-field__strength-text--strong {
    color: #198754;
}

.password-field__strength-text--none {
    color: #6c757d;
}

/* Validation panel */
.password-field__validation-panel {
    margin-top: 0.65rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.4rem;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.password-field--weak .password-field__validation-panel {
    border-color: rgba(220, 53, 69, 0.45);
    background: rgba(220, 53, 69, 0.04);
}

.password-field--medium .password-field__validation-panel {
    border-color: rgba(13, 110, 253, 0.45);
    background: rgba(13, 110, 253, 0.04);
}

.password-field--strong .password-field__validation-panel {
    border-color: rgba(25, 135, 84, 0.45);
    background: rgba(25, 135, 84, 0.04);
}

.password-field__validation-title {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    color: #495057;
}

.password-field__requirements {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.8125rem;
    line-height: 1.55;
}

.password-field__requirements li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 1.35rem;
    color: #6c757d;
}

.password-field__requirements li.is-met {
    color: #198754;
    font-weight: 500;
}

.password-field__requirements li.is-unmet {
    color: #dc3545;
}

.password-field__req-icon {
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
}

.password-field__req-icon::before {
    content: '○';
}

.password-field__requirements li.is-met .password-field__req-icon::before {
    content: '✓';
    color: #198754;
}

.password-field__requirements li.is-unmet .password-field__req-icon::before {
    content: '✗';
    color: #dc3545;
}

.password-field__preview {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.1rem;
    margin-top: 0.5rem;
    padding: 0.45rem 0.55rem;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.5;
    letter-spacing: normal;
    background: #fff;
    border-radius: 0.3rem;
    border: 1px dashed rgba(108, 117, 125, 0.35);
}

.password-field__preview-char {
    display: inline-block;
    line-height: 1.2;
    vertical-align: baseline;
}

.password-field__preview-char--o {
    color: #0d6efd;
    font-weight: 600;
}

.password-field__preview-char--O {
    color: #198754;
    font-weight: 700;
}

.password-field__preview-char--0 {
    color: #dc3545;
    font-weight: 700;
}

.password-field__hint {
    margin: 0.45rem 0 0;
    font-size: 0.72rem;
    color: #6c757d;
    line-height: 1.4;
}

/* Admin login shell */
.admin-login-page .password-field__input-wrap.form-group__input {
    position: relative;
}

.admin-login-page .password-field__toggle {
    inset-inline-end: 1rem;
}

.admin-login-page .crancy-wc__form-input.password-field__input {
    padding-inline-end: 2.75rem;
}
