.auth-page {
    --background-deep: #050c18;
    --accent: #6fb4ff;
    --accent-bright: #8fc6ff;
    --text-muted: #8397b2;
    --text-dim: #5f7591;
}

html:has(.auth-page) {
    background: #050c18;
}

.auth-page {
    background:
        linear-gradient(180deg, rgba(4, 10, 22, 0.35) 0%, rgba(4, 10, 22, 0.55) 55%, rgba(3, 8, 18, 0.85) 100%),
        radial-gradient(ellipse at 50% 50%, rgba(5, 14, 32, 0.55) 0%, transparent 65%),
        url("/assets/images/background.png") center / cover no-repeat fixed,
        #050c18;
}

.auth-page::before {
    display: none;
}

.auth-card,
.auth-card[data-state="success"] {
    width: min(100%, 27rem);
    padding: 0;
    border: 1px solid #1c2c44;
    border-top: 3px solid #6fb4ff;
    border-radius: 0.75rem;
    background: #0a1424;
    box-shadow: 0 1.5rem 3.5rem rgba(0, 0, 0, 0.45);
}

.auth-card[data-state="success"] {
    width: min(100%, 30rem);
}

.auth-card::before,
.auth-card::after {
    display: none;
}

.auth-card__body {
    padding: 2rem 2.25rem 2.25rem;
}

.auth-card__logo {
    display: block;
    width: min(100%, 13rem);
    height: auto;
    margin: 0 auto 1.25rem;
    aspect-ratio: 4 / 1;
    object-fit: cover;
}

.auth-card .registration-card__heading {
    margin-bottom: 1.75rem;
    text-align: center;
}

.auth-card .registration-card__heading h1 {
    color: #f1f5fb;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.auth-card .registration-card__heading p {
    margin: 0.45rem 0 0;
    color: #8397b2;
    font-size: 0.74rem;
    white-space: normal;
}

.auth-card .registration-form {
    gap: 1.15rem;
}

.auth-card .form-field label {
    color: #7f95b3;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-card .form-field__hint {
    color: #5f7591;
}

.auth-card .form-control {
    min-height: 3rem;
    border: 0;
    border-bottom: 2px solid #22375a;
    border-radius: 0.4rem 0.4rem 0 0;
    background: #0e1b30;
}

.auth-card .form-control:focus-within {
    border-bottom-color: #6fb4ff;
    background: #11213a;
    box-shadow: none;
    transform: none;
}

.auth-card .form-field[data-invalid="true"] .form-control {
    border-bottom-color: #ff9292;
}

.auth-card .form-control > svg,
.auth-card .password-visibility svg {
    stroke: #5f7591;
}

.auth-card .form-control:focus-within > svg {
    stroke: #6fb4ff;
}

.auth-card .form-control input::placeholder {
    color: #4a5f7b;
}

.auth-card .form-control input:autofill,
.auth-card .form-control input:-webkit-autofill,
.auth-card .form-control input:-webkit-autofill:hover,
.auth-card .form-control input:-webkit-autofill:focus,
.auth-card .form-control input:-webkit-autofill:active {
    box-shadow: 0 0 0 1000px #0e1b30 inset;
}

.auth-card .form-control:focus-within input:autofill,
.auth-card .form-control:focus-within input:-webkit-autofill {
    box-shadow: 0 0 0 1000px #11213a inset;
}

.auth-card .registration-button,
.auth-card .registration-success__action {
    min-height: 3rem;
    justify-content: center;
    gap: 0.55rem;
    border: 0;
    border-radius: 0.4rem;
    background: #6fb4ff;
    box-shadow: none;
    color: #06101f;
    font-size: 0.78rem;
}

.auth-card .registration-button {
    margin-top: 0.5rem;
}

.auth-card .registration-button:hover,
.auth-card .registration-button:focus-visible,
.auth-card .registration-success__action:hover,
.auth-card .registration-success__action:focus-visible {
    background: #8fc6ff;
    box-shadow: none;
    filter: none;
    transform: none;
}

.auth-card .registration-form__notice {
    border-color: #1f3150;
    border-radius: 0.4rem;
    background: #0d1a2e;
    color: #8fc6ff;
}

.auth-card .registration-form__notice[data-state="error"] {
    border-color: rgba(255, 146, 146, 0.32);
    background: rgba(190, 71, 82, 0.13);
    color: #ffc0c0;
}

.auth-card .registration-success__icon {
    width: 4rem;
    height: 4rem;
    margin-bottom: 1.1rem;
    border-color: #22375a;
    background: #0e1b30;
    color: #6fb4ff;
}

.auth-card .registration-success__icon svg {
    width: 2.2rem;
}

.auth-card .registration-success__icon circle {
    fill: #0e1b30;
}

.auth-card .registration-success__eyebrow {
    color: #6fb4ff;
    letter-spacing: 0.1em;
}

.auth-card .registration-success h2,
.auth-card .password-reset-invalid h1 {
    color: #f1f5fb;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.auth-card .registration-success__lead,
.auth-card .password-reset-invalid p {
    color: #8397b2;
    font-size: 0.74rem;
}

.auth-card .registration-success__email {
    color: #dce6f3;
}

.auth-card .registration-success__steps {
    border-color: #1a2940;
    border-radius: 0.4rem;
    background: #07101d;
}

.auth-card .registration-success__steps > div + div {
    border-top-color: #1a2940;
}

.auth-card .registration-success__steps span {
    border: 1px solid #22375a;
    border-radius: 0.3rem;
    color: #6fb4ff;
}

.auth-card .registration-success__steps p {
    color: #8397b2;
}

.auth-card .registration-success__steps strong {
    color: #dce6f3;
}

.auth-card .registration-success__tip {
    color: #6c82a0;
}

.auth-card .registration-success__tip svg {
    stroke: #5f7591;
}

.auth-card .password-reset-invalid__icon {
    width: 4rem;
    height: 4rem;
    margin-bottom: 1.1rem;
    background: rgba(190, 71, 82, 0.1);
}

.auth-card .password-reset-invalid__icon svg {
    width: 2.2rem;
}

.auth-card .password-reset-invalid > span {
    letter-spacing: 0.1em;
}

.auth-card .password-reset-invalid__secondary {
    color: #6fb4ff;
}

.auth-card .password-reset-invalid__secondary:hover,
.auth-card .password-reset-invalid__secondary:focus-visible {
    color: #a9d3ff;
}

.auth-card .legal-notice {
    margin-top: 1.5rem;
    padding: 0;
    border-top: 0;
    color: #6c82a0;
    font-size: 0.68rem;
}

.auth-card .legal-notice a,
.auth-card .legal-notice button {
    color: #6fb4ff;
}

.auth-card__footer {
    padding: 1.1rem 2.25rem;
    border-top: 1px solid #1a2940;
    border-radius: 0 0 0.75rem 0.75rem;
    background: #07101d;
    color: #7f95b3;
    font-size: 0.74rem;
    text-align: center;
}

.auth-card[data-state="success"] .auth-card__footer {
    display: none;
}

.auth-card__footer a {
    margin-left: 0.25rem;
    color: #6fb4ff;
    font-weight: 600;
    text-decoration: none;
}

.auth-card__footer a:hover,
.auth-card__footer a:focus-visible {
    outline: 0;
    color: #a9d3ff;
    text-decoration: underline;
    text-underline-offset: 0.2rem;
}

.auth-page .legal-modal__backdrop {
    background: rgba(3, 8, 18, 0.84);
}

.auth-page .legal-modal__dialog {
    border: 1px solid #1c2c44;
    border-top: 3px solid #6fb4ff;
    border-radius: 0.75rem;
    background: #0a1424;
}

.auth-page .legal-modal__header {
    border-bottom-color: #1a2940;
    background: #07101d;
}

.auth-page .legal-modal__header h2 {
    color: #f1f5fb;
    font-weight: 600;
}

.auth-page .legal-modal__close {
    border-color: #1f3150;
    border-radius: 0.4rem;
    background: transparent;
    color: #8397b2;
}

.auth-page .legal-modal__close:hover,
.auth-page .legal-modal__close:focus-visible {
    border-color: #6fb4ff;
    color: #f1f5fb;
}

.auth-page .legal-modal__content {
    color: #8397b2;
    scrollbar-color: #22375a transparent;
}

.auth-page .legal-modal__content h3 {
    color: #dce6f3;
}

.auth-page .legal-modal__example-warning {
    border-color: #1f3150;
    border-radius: 0.4rem;
    background: #0d1a2e;
    color: #8fc6ff;
}

.auth-page .legal-modal__footer {
    border-top-color: #1a2940;
    background: #07101d;
}

.auth-page .legal-modal__footer button {
    border: 0;
    border-radius: 0.4rem;
    background: #6fb4ff;
    color: #06101f;
}

.auth-page .legal-modal__footer button:hover,
.auth-page .legal-modal__footer button:focus-visible {
    background: #8fc6ff;
}

.auth-stack {
    position: relative;
    width: min(100%, 27rem);
}

.auth-stack:has(.auth-card[data-state="success"]) {
    width: min(100%, 30rem);
}

.auth-stack > .auth-card {
    width: 100%;
}

.auth-toast {
    display: flex;
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.75rem);
    left: 0;
    z-index: 200;
    padding: 0.85rem 0.85rem 0.85rem 1rem;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid #1f3150;
    border-left: 3px solid #6fb4ff;
    border-radius: 0.6rem;
    background: #0a1424;
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.5);
    color: #dce6f3;
    font-family: var(--font);
    opacity: 0;
    transform: translateY(0.5rem);
    visibility: hidden;
    transition:
        opacity 200ms ease,
        transform 200ms ease,
        visibility 200ms ease;
}

.auth-toast[data-floating="true"] {
    position: fixed;
    top: calc(0.75rem + env(safe-area-inset-top, 0px));
    right: 1rem;
    bottom: auto;
    left: 1rem;
    max-width: 27rem;
    margin: 0 auto;
    transform: translateY(-0.5rem);
}

.auth-toast[data-visible="true"] {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.auth-toast[data-state="error"] {
    border-left-color: #ff8a8a;
}

.auth-toast[data-state="success"] {
    border-left-color: #5fd4a8;
}

.auth-toast__icon {
    display: grid;
    width: 1.35rem;
    height: 1.35rem;
    flex: 0 0 auto;
    place-items: center;
}

.auth-toast__icon > * {
    display: none;
}

.auth-toast__icon svg {
    width: 1.3rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.auth-toast[data-state="loading"] .auth-toast__spinner,
.auth-toast[data-state="error"] .auth-toast__icon-error,
.auth-toast[data-state="success"] .auth-toast__icon-success {
    display: block;
}

.auth-toast[data-state="error"] .auth-toast__icon {
    color: #ff8a8a;
}

.auth-toast[data-state="success"] .auth-toast__icon {
    color: #5fd4a8;
}

.auth-toast__spinner {
    width: 1.05rem;
    height: 1.05rem;
    border: 2px solid #22375a;
    border-top-color: #6fb4ff;
    border-radius: 50%;
    animation: auth-toast-spin 700ms linear infinite;
}

.auth-toast__message {
    flex: 1;
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.45;
}

.auth-toast__close {
    display: grid;
    width: 1.7rem;
    height: 1.7rem;
    padding: 0;
    flex: 0 0 auto;
    place-items: center;
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
    color: #5f7591;
    cursor: pointer;
}

.auth-toast__close:hover,
.auth-toast__close:focus-visible {
    outline: 0;
    background: #0e1b30;
    color: #dce6f3;
}

.auth-toast[data-state="loading"] .auth-toast__close {
    display: none;
}

.auth-toast__close svg {
    width: 0.9rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
}

@keyframes auth-toast-spin {
    to {
        transform: rotate(1turn);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-toast {
        transition:
            opacity 200ms ease,
            visibility 200ms ease;
    }
}

@media (max-width: 768px) {
    .auth-page {
        background-attachment: scroll;
    }
}

@media (max-width: 600px) {
    .auth-card,
    .auth-card[data-state="success"] {
        padding: 0;
    }

    .auth-card__body {
        padding: 1.75rem 1.25rem;
    }

    .auth-card__footer {
        padding-right: 1.25rem;
        padding-left: 1.25rem;
    }
}
