.azlms-password-field__control {
    position: relative;
}

.azlms-password-field__input {
    padding-right: 2.5rem !important;
}

.azlms-password-field__toggle {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
}

.azlms-password-field__toggle:hover {
    color: #374151;
}

.azlms-password-field__toggle svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.azlms-password-field__toggle .hidden {
    display: none !important;
}

.azlms-password-field__toggle:focus-visible {
    outline: 2px solid var(--brand-primary, #4f46e5);
    outline-offset: 2px;
    border-radius: 4px;
}

.azlms-oauth__btn:disabled {
    pointer-events: none;
}

.azlms-captcha {
    min-height: 78px;
}

[data-azlms-field-error]:not(.hidden) + input,
input:invalid[data-azlms-touched] {
    border-color: #dc2626;
}

.azlms-auth-embed__notice {
    margin: 0 0 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #f9fafb;
    color: #374151;
    font-size: 0.875rem;
    line-height: 1.5;
}

.azlms-auth-embed.azlms-login-form {
    max-width: 28rem;
}

.azlms-auth-embed.azlms-register-form {
    max-width: 52rem;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.azlms-auth-form-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.azlms-auth-form-header__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    color: #111827;
}

.azlms-auth-form-header__intro {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #6b7280;
}

.azlms-auth-alert {
    margin-bottom: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.azlms-auth-alert--info {
    border: 1px solid #e0e7ff;
    background: #eef2ff;
    color: #312e81;
}

.azlms-auth-alert--error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.azlms-auth-alert--success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.azlms-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.azlms-auth-form__section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.azlms-auth-form__section-title {
    margin: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
}

.azlms-auth-field,
.azlms-password-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
}

.azlms-auth-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    color: #374151;
}

.azlms-auth-required {
    color: #dc2626;
}

.azlms-auth-input,
.azlms-auth-textarea,
.azlms-password-field__input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #111827;
    background: #ffffff;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.azlms-auth-textarea {
    min-height: 5.5rem;
    resize: vertical;
}

.azlms-auth-input:focus,
.azlms-auth-textarea:focus,
.azlms-password-field__input:focus {
    outline: none;
    border-color: var(--brand-primary, #4f46e5);
    box-shadow: 0 0 0 3px rgb(79 70 229 / 0.15);
}

.azlms-auth-hint {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #6b7280;
}

.azlms-auth-field-error {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #dc2626;
}

.azlms-auth-field-error.hidden {
    display: none !important;
}

.azlms-auth-role-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.azlms-auth-role-options__item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
}

.azlms-auth-form__actions {
    margin-top: 0.25rem;
}

.azlms-auth-form-footer {
    margin: 0;
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #6b7280;
}

.azlms-auth-link {
    color: var(--brand-primary, #4f46e5);
    text-decoration: none;
}

.azlms-auth-link:hover {
    text-decoration: underline;
}

.azlms-auth-submit,
.azlms-auth-embed [data-azlms-submit] {
    display: block;
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    cursor: pointer;
    background-color: var(--brand-button-bg, var(--brand-primary, #4f46e5)) !important;
    color: var(--brand-button-text, #ffffff) !important;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.azlms-auth-submit:hover,
.azlms-auth-embed [data-azlms-submit]:hover {
    opacity: 0.92;
}

.azlms-auth-submit:focus-visible,
.azlms-auth-embed [data-azlms-submit]:focus-visible {
    outline: 2px solid var(--brand-primary, #4f46e5);
    outline-offset: 2px;
}

.azlms-auth-submit:disabled,
.azlms-auth-embed [data-azlms-submit]:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.azlms-auth-name-row,
form[data-azlms-auth-form="register"] .azlms-auth-name-row,
.azlms-auth-embed .azlms-auth-name-row {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 1rem;
    width: 100%;
}

.azlms-auth-name-row > [data-azlms-field-wrap],
.azlms-auth-name-row > .azlms-auth-field,
form[data-azlms-auth-form="register"] .azlms-auth-name-row > [data-azlms-field-wrap],
form[data-azlms-auth-form="register"] .azlms-auth-name-row > .azlms-auth-field {
    min-width: 0;
}

@media (max-width: 640px) {
    .azlms-auth-name-row,
    form[data-azlms-auth-form="register"] .azlms-auth-name-row,
    .azlms-auth-embed .azlms-auth-name-row {
        grid-template-columns: 1fr !important;
    }
}

.azlms-auth-two-col-row,
form[data-azlms-auth-form="register"] .azlms-auth-two-col-row,
.azlms-auth-embed .azlms-auth-two-col-row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1rem;
    width: 100%;
}

.azlms-auth-two-col-row > [data-azlms-field-wrap],
.azlms-auth-two-col-row > .azlms-auth-field,
.azlms-auth-two-col-row > .azlms-password-field,
form[data-azlms-auth-form="register"] .azlms-auth-two-col-row > [data-azlms-field-wrap],
form[data-azlms-auth-form="register"] .azlms-auth-two-col-row > .azlms-auth-field,
form[data-azlms-auth-form="register"] .azlms-auth-two-col-row > .azlms-password-field {
    min-width: 0;
}

form[data-azlms-auth-form="register"] #address {
    min-height: 6.5rem;
}

@media (max-width: 640px) {
    .azlms-auth-two-col-row,
    form[data-azlms-auth-form="register"] .azlms-auth-two-col-row,
    .azlms-auth-embed .azlms-auth-two-col-row {
        grid-template-columns: 1fr !important;
    }
}
