.auth-dialog {
    position: fixed;
    inset: 0;
    width: 396px;
    max-width: calc(100% - 32px);
    height: fit-content;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 27px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 3px solid #f5f5f5;
    border-radius: 16px;
    color: #424242;
    background: #ffffff;
    font-family: "Inter", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
}

.auth-dialog:not([open]),
.auth-dialog [hidden] {
    display: none !important;
}

.auth-dialog::backdrop {
    background: rgb(0 0 0 / 50%);
}

.auth-dialog__header {
    margin-bottom: 24px;
    padding-right: 24px;
}

.auth-dialog__header h2 {
    margin: 0;
    color: #000000;
    font-size: 20px;
    font-weight: 700;
    line-height: 32px;
}

.auth-dialog__header h2:focus {
    outline: none;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin: 0;
}

.auth-field {
    min-width: 0;
}

.auth-field > label {
    display: block;
    margin-bottom: 4px;
    color: #424242;
    font-size: 14px;
    line-height: 20px;
}

.auth-control {
    position: relative;
}

.auth-input {
    display: block;
    width: 100%;
    min-width: 0;
    height: 32px;
    margin: 0;
    padding: 5px 12px;
    border: 1px solid #b9b9b9;
    border-radius: 18px;
    color: #424242;
    background: #ffffff;
    font: inherit;
    transition: border-color 180ms ease-out;
}

.auth-input::placeholder {
    color: #777777;
    opacity: 1;
}

.auth-control:has(.auth-password-toggle) .auth-input {
    padding-right: 40px;
}

.auth-input:focus {
    border-color: #0093ee;
    outline: 2px solid rgb(0 147 238 / 25%);
    outline-offset: 2px;
}

.auth-password-toggle {
    position: absolute;
    top: 4px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #777777;
    background: transparent;
    cursor: pointer;
}

.auth-password-toggle > span {
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: url("/images/icons/feather/eye-9a5884cf8c0798694f82f3ef3eee16aa.svg") center / contain no-repeat;
    mask: url("/images/icons/feather/eye-9a5884cf8c0798694f82f3ef3eee16aa.svg") center / contain no-repeat;
}

.auth-password-toggle[aria-pressed="true"] > span {
    -webkit-mask-image: url("/images/icons/feather/eye-off-e07b0adf5e03e5a6e81bf0ad7b12101a.svg");
    mask-image: url("/images/icons/feather/eye-off-e07b0adf5e03e5a6e81bf0ad7b12101a.svg");
}

.auth-field.has-error .auth-input {
    border-color: #ad3038;
    padding-right: 36px;
}

.auth-field.has-error .auth-control::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 12px;
    width: 16px;
    height: 16px;
    background: #ad3038;
    -webkit-mask: url("/images/icons/feather/alert-triangle-681882873faa3bc82e01bc3df993cca7.svg") center / contain no-repeat;
    mask: url("/images/icons/feather/alert-triangle-681882873faa3bc82e01bc3df993cca7.svg") center / contain no-repeat;
    pointer-events: none;
}

.auth-field.has-error .auth-password-toggle {
    right: 32px;
}

.auth-field.has-error .auth-control:has(.auth-password-toggle) .auth-input {
    padding-right: 64px;
}

.auth-field__error {
    margin: 4px 0 0;
    color: #ad3038;
    font-size: 14px;
    line-height: 20px;
}

.auth-hint {
    margin: 6px 0 0;
    color: #666666;
    font-size: 12px;
    line-height: 18px;
}

.auth-note {
    margin: 0;
    font-size: 12px;
    line-height: 20px;
}

.auth-login-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 10px;
    cursor: pointer;
}

.auth-remember input {
    appearance: none;
    display: grid;
    flex: 0 0 20px;
    place-items: center;
    width: 20px;
    height: 20px;
    margin: 0;
    border: 1px solid #b9b9b9;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
}

.auth-remember input:checked {
    border-color: #0093ee;
    background: #0093ee;
}

.auth-remember input:checked::after {
    content: "";
    width: 16px;
    height: 16px;
    background: #ffffff;
    -webkit-mask: url("/images/icons/feather/check-9632771e800391a23c210e6a9291e925.svg") center / contain no-repeat;
    mask: url("/images/icons/feather/check-9632771e800391a23c210e6a9291e925.svg") center / contain no-repeat;
}

.auth-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    gap: 6px;
    min-height: 36px;
    max-width: 100%;
    margin: 0;
    padding: 8px 16px;
    border: 0;
    border-radius: 20px;
    color: #ffffff;
    background: #0093ee;
    font: inherit;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background-color 180ms ease-out, opacity 180ms ease-out;
}

.auth-spinner {
    display: inline-block;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;

}

.auth-link {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    color: #0093ee;
    background: transparent;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.auth-dialog__footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e8f6ff;
    color: #202020;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
}

.auth-form-message {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    color: #ad3038;
    background: #fff4f4;
    overflow-wrap: anywhere;
}

.auth-form-message[data-tone="success"] {
    color: #176575;
    background: #e8f6ff;
}

.auth-resend-block {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e8f6ff;
}

.auth-success-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.auth-dialog :is(button, a, input[type="checkbox"]):focus-visible {
    outline: 2px solid #0093ee;
    outline-offset: 3px;
}

.auth-dialog :is(button, input):disabled {
    cursor: not-allowed;
    opacity: 0.65;

}

.auth-dialog :is(button, input):disabled .auth-spinner {
    background-color: rgb(255 255 255);
}

.auth-page {
    min-height: 220px;
}

.auth-page__title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (hover: hover) {
    .auth-primary:not(:disabled):hover {
        background: var(--sv-interaction-hover, #ee6a00);
    }

    .auth-link:not(:disabled):hover,
    .auth-password-toggle:not(:disabled):hover {
        color: var(--sv-interaction-hover, #ee6a00);
    }

    .auth-link:not(:disabled):hover {
        text-decoration: underline;
        text-underline-offset: 3px;
    }
}

@media (max-width: 767px) {
    .auth-form:is(
        [data-auth-form="login"],
        [data-auth-form="forgot"],
        [data-auth-form="reset"]
    ) > .auth-primary {
        align-self: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-dialog *,
    .auth-dialog *::before,
    .auth-dialog *::after {
        transition: none !important;
    }
}