.agency-password-modal {
    --agency-password-accent: var(--custom-color-background-to, var(--custom-color, #0d9373));
    --agency-password-accent-strong: var(--custom-color-background-from, #0b7d63);
    --agency-password-text: #202534;
    --agency-password-muted: #697189;
    --agency-password-dim: #9ea6bf;
    --agency-password-border: #d9dfeb;
    --agency-password-surface: #f6f8fc;
    --agency-password-surface-strong: #f2f5fa;
    --agency-password-shadow: 0 24px 48px rgba(15, 23, 42, 0.14);
}

.app-modal__dialog.modal-dialog.agency-password-modal {
    width: 100%;
    max-width: min(calc(100vw - 32px), 560px) !important;
}

.app-modal__dialog.modal-dialog.agency-password-modal--reset {
    max-width: min(calc(100vw - 32px), 520px) !important;
}

.agency-password-modal .app-modal__content.modal-content {
    border: 0;
    border-radius: 1.5rem;
    box-shadow: var(--agency-password-shadow);
    overflow: hidden;
}

.agency-password-modal .app-modal__body.modal-body {
    overflow-x: hidden;
    padding: 1.25rem 1.5rem 1.5rem;
}

.agency-password {
    box-sizing: border-box;
    color: var(--agency-password-text);
    display: flex;
    flex-direction: column;
    font-family: inherit;
    font-size: 0.8125rem;
    gap: 1.25rem;
    text-align: left;
}

.agency-password *,
.agency-password *::before,
.agency-password *::after {
    box-sizing: inherit;
}

#content .agency-password label,
#content .agency-password button,
.agency-password label,
.agency-password button {
    float: none;
    margin-right: 0;
    margin-top: 0;
    max-width: 100%;
    width: auto;
}

#content .agency-password input,
.agency-password input {
    float: none;
    margin-right: 0;
    margin-top: 0;
    max-width: 100%;
}

.agency-password__user-card {
    align-items: center;
    background: var(--agency-password-surface);
    border: 1px solid var(--agency-password-border);
    border-radius: 1rem;
    display: flex;
    gap: 0.875rem;
    min-width: 0;
    padding: 0.85rem 0.90rem;
}

.agency-password__user-icon {
    align-items: center;
    color: var(--agency-password-dim);
    display: inline-flex;
    flex: 0 0 1rem;
    font-size: 0.95rem;
    justify-content: center;
}

.agency-password__user-copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    text-align: left;
}

.agency-password__user-label {
    color: var(--agency-password-dim);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.agency-password__user-value {
    color: var(--agency-password-text);
    font-size: inherit;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
}

.agency-password__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
}

.agency-password__field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.agency-password__label {
    color: var(--agency-password-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.2;
    margin: 0;
    padding-top: 0;
    text-transform: uppercase;
    width: auto;
}

.agency-password__input-wrap {
    position: relative;
}

.agency-password__input-icon {
    align-items: center;
    color: var(--agency-password-dim);
    display: inline-flex;
    font-size: 0.95rem;
    height: 100%;
    justify-content: center;
    left: 1rem;
    pointer-events: none;
    position: absolute;
    top: 0;
    transition: color 0.2s ease;
}

.agency-password__input {
    appearance: none;
    background: var(--agency-password-surface);
    border: 1px solid var(--agency-password-border);
    border-radius: 1rem;
    color: var(--agency-password-text);
    font-size: inherit;
    line-height: 1.25rem;
    min-height: 2.75rem;
    outline: none;
    padding: 0.75rem 3rem 0.75rem 2.85rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    width: 100%;
}

#content .agency-password .agency-password__input,
.agency-password .agency-password__input {
    display: block;
    padding: 0.75rem 3rem 0.75rem 2.85rem;
    width: 100%;
}

.agency-password__input::placeholder {
    color: var(--agency-password-dim);
    opacity: 1;
}

.agency-password__input:focus {
    background: #fff;
    border-color: var(--agency-password-accent);
    box-shadow: 0 0 0 3px rgba(13, 147, 115, 0.1);
}

.agency-password__input-wrap:focus-within .agency-password__input-icon {
    color: var(--agency-password-accent);
}

.agency-password__toggle.display_pass {
    align-items: center;
    color: var(--agency-password-dim);
    cursor: pointer;
    display: inline-flex;
    font-size: 1rem;
    height: 100%;
    justify-content: center;
    margin: 0;
    position: absolute;
    right: 0.95rem;
    top: 0;
    transform: none;
    transition: color 0.2s ease;
    width: 1.25rem;
    z-index: 1;
}

.agency-password__toggle.display_pass:hover {
    color: var(--agency-password-muted);
}

.agency-password__criteria {
    background: var(--agency-password-surface);
    border: 1px solid var(--agency-password-border);
    border-radius: 1rem;
    padding: 1rem 1rem 0.95rem;
}

.agency-password__criteria-title {
    color: var(--agency-password-dim);
    font-size: 0.813rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 0.875rem;
}

.agency-password__criteria-list {
    color: var(--agency-password-dim);
    display: grid;
    gap: 0.55rem;
    grid-template-columns: minmax(0, 1fr);
    list-style: none;
    margin: 0;
    padding: 0;
}

.agency-password__criteria-list li {
    align-items: flex-start;
    display: flex;
    font-size: inherit;
    line-height: 1.35;
    min-width: 0;
    position: relative;
    text-align: justify;
    width: 100%;
}

.agency-password__criteria-list li::before {
    align-items: center;
    background: #fff;
    border: 1.5px solid #b3bdd1;
    border-radius: 50%;
    content: "";
    display: inline-flex;
    flex: 0 0 1.05rem;
    height: 1.05rem;
    justify-content: center;
    margin-right: 0.55rem;
    margin-top: 0.08rem;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    width: 1.05rem;
}

.agency-password__criteria-list li.has-visual-rule {
    transition: color 0.2s ease;
}

.agency-password__criteria-list li.has-visual-rule.is-met {
    color: #111827;
}

.agency-password__criteria-list li.has-visual-rule.is-met::before {
    background: var(--agency-password-accent);
    border-color: var(--agency-password-accent);
}

.agency-password__actions {
    display: flex;
    gap: 0.875rem;
    justify-content: flex-end;
    padding-top: 0.25rem;
}

.agency-password__button {
    align-items: center;
    border-radius: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    font-size: inherit;
    font-weight: 700;
    justify-content: center;
    min-height: 2.875rem;
    min-width: 7.4rem;
    padding: 0.75rem 1.35rem;
    text-transform: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.agency-password__button--primary {
    background: linear-gradient(var(--app-basic-modal-button-start, var(--agency-password-accent)), var(--app-basic-modal-button-end, var(--agency-password-accent)));
    border: 1px solid var(--app-basic-modal-button-end, var(--agency-password-accent));
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
    color: var(--app-basic-modal-button-color, #fff);
}

.agency-password__button--primary:hover,
.agency-password__button--primary:focus-visible {
    background: linear-gradient(var(--app-basic-modal-button-hover-start, var(--agency-password-accent-strong)), var(--app-basic-modal-button-hover-end, var(--agency-password-accent-strong)));
    border-color: var(--app-basic-modal-button-hover-end, var(--agency-password-accent-strong));
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    color: var(--app-basic-modal-button-color, #fff);
    outline: none;
}

.agency-password__button--secondary {
    background: #fff;
    border: 1px solid var(--agency-password-border);
    color: #616983;
}

.agency-password__button--secondary:hover,
.agency-password__button--secondary:focus-visible {
    background: var(--agency-password-surface-strong);
    border-color: #cbd4e1;
    color: var(--agency-password-text);
    outline: none;
}

@media (max-width: 767px) {
    .agency-password-modal .app-modal__body.modal-body {
        padding: 1rem 1rem 1.15rem;
    }

    .agency-password__actions {
        flex-direction: column-reverse;
    }

    .agency-password__button {
        width: 100%;
    }
}
