.auth-area {
    position: fixed;
    z-index: 20;
    top: 1.25rem;
    right: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #e7e8ff;
    font-family: 'Space Grotesk', sans-serif;
}

.auth-status {
    color: #c7cfdf;
    font-size: 0.875rem;
}

.auth-status--error {
    color: #fca5a5;
}

.auth-button,
.auth-avatar,
.profile-menu button,
.auth-switch__button {
    border: 1px solid rgb(216 165 255 / 28%);
    color: #f5f3ff;
    font-family: inherit;
    cursor: pointer;
    transition: filter 180ms ease, transform 180ms ease, background-color 180ms ease;
}

.auth-button {
    min-height: 2.5rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: rgb(16 8 39 / 82%);
    backdrop-filter: blur(16px);
}

.auth-button--primary {
    border-color: rgb(168 85 247 / 70%);
    background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.auth-button:hover,
.auth-avatar:hover,
.profile-menu button:hover,
.auth-switch__button:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
}

.auth-username {
    max-width: 10rem;
    overflow: hidden;
    color: #e7e8ff;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-avatar {
    display: grid;
    width: 2.65rem;
    height: 2.65rem;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    font-size: 1rem;
    font-weight: 700;
}

.profile-menu {
    position: absolute;
    top: calc(100% + 0.65rem);
    right: 0;
    display: grid;
    min-width: 13.5rem;
    gap: 0.35rem;
    padding: 0.85rem;
    border: 1px solid rgb(216 165 255 / 22%);
    border-radius: 1rem;
    background: rgb(16 8 39 / 96%);
    box-shadow: 0 14px 40px rgb(0 0 0 / 35%);
    text-align: left;
    backdrop-filter: blur(18px);
}

.profile-menu[hidden] {
    display: none;
}

.profile-menu__username {
    color: #fff;
}

.profile-menu__created {
    margin-bottom: 0.4rem;
    color: #c7cfdf;
    font-size: 0.8rem;
}

.profile-menu__link,
.profile-menu button {
    padding: 0.55rem 0.65rem;
    border-radius: 0.6rem;
    color: #eee8ff;
    font-size: 0.9rem;
    text-align: left;
    text-decoration: none;
}

.profile-menu__link:hover {
    background: rgb(99 102 241 / 25%);
}

.profile-menu button {
    border-color: transparent;
    background: rgb(99 102 241 / 14%);
}

.profile-menu__error {
    margin: 0.2rem 0 0;
    color: #fca5a5;
    font-size: 0.8rem;
}

.profile-menu__error[hidden] {
    display: none;
}

.auth-dialog {
    width: min(26rem, calc(100% - 2rem));
    padding: 0;
    overflow: visible;
    border: 1px solid rgb(216 165 255 / 28%);
    border-radius: 1.25rem;
    color: #e7e8ff;
    background: transparent;
    box-shadow: 0 24px 80px rgb(0 0 0 / 55%);
    font-family: 'Space Grotesk', sans-serif;
}

.auth-dialog::backdrop {
    background: rgb(4 0 19 / 76%);
    backdrop-filter: blur(8px);
}

.auth-dialog__panel {
    position: relative;
    padding: 2rem;
    border-radius: inherit;
    background:
        radial-gradient(ellipse at 90% 0, rgb(124 58 237 / 24%), transparent 55%),
        #100827;
}

.auth-dialog__panel h2 {
    margin: 0 2rem 0.35rem 0;
    color: #fff;
    font-size: 1.8rem;
}

.auth-dialog__description {
    margin: 0 0 1.5rem;
    color: #c7cfdf;
    font-size: 0.95rem;
}

.auth-dialog__close {
    position: absolute;
    top: 0.85rem;
    right: 0.95rem;
    border: 0;
    color: #c7cfdf;
    background: transparent;
    font-size: 1.7rem;
    cursor: pointer;
}

.auth-form {
    display: grid;
    gap: 1rem;
    text-align: left;
}

.auth-form label {
    display: grid;
    gap: 0.45rem;
    color: #e7e8ff;
    font-size: 0.9rem;
}

.auth-form input {
    width: 100%;
    min-height: 2.9rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid rgb(199 207 223 / 24%);
    border-radius: 0.65rem;
    outline: none;
    color: #fff;
    background: rgb(6 0 29 / 62%);
}

.auth-form input:focus {
    border-color: #b144f0;
    box-shadow: 0 0 0 3px rgb(168 85 247 / 20%);
}

.auth-error {
    margin: -0.2rem 0 0;
    color: #fca5a5;
    font-size: 0.875rem;
}

.auth-error[hidden] {
    display: none;
}

.auth-submit {
    min-height: 2.9rem;
    border: 1px solid rgb(168 85 247 / 70%);
    border-radius: 0.7rem;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: filter 180ms ease;
}

.auth-submit:hover:not(:disabled) {
    filter: brightness(1.15);
}

.auth-submit:disabled,
.auth-switch__button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.auth-switch {
    margin: 1.25rem 0 0;
    color: #c7cfdf;
    font-size: 0.9rem;
}

.auth-switch__button {
    padding: 0.25rem;
    border-color: transparent;
    color: #d8a5ff;
    background: transparent;
    font: inherit;
}

.profile-page {
    width: min(40rem, calc(100% - 2rem));
    min-height: 100vh;
    margin: auto;
    padding: 8rem 0 3rem;
    color: #e7e8ff;
    text-align: left;
}

.profile-card {
    padding: clamp(1.5rem, 5vw, 2.5rem);
    border: 1px solid rgb(216 165 255 / 20%);
    border-radius: 1.25rem;
    background: rgb(16 8 39 / 72%);
    box-shadow: 0 18px 55px rgb(0 0 0 / 22%);
    backdrop-filter: blur(16px);
}

.profile-card h1 {
    margin: 0 0 0.5rem;
    color: #fff;
    font-size: clamp(2rem, 8vw, 3rem);
    text-align: left;
}

.profile-card p {
    color: #c7cfdf;
}

.profile-card__joined {
    font-size: 0.9rem;
}

.profile-card__status {
    min-height: 1.5rem;
    color: #fca5a5 !important;
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .top-nav {
        top: 4rem;
    }

    .auth-area {
        top: 0.75rem;
        right: 0.75rem;
        gap: 0.35rem;
    }

    .auth-button {
        min-height: 2.25rem;
        padding: 0.45rem 0.65rem;
        font-size: 0.8rem;
    }

    .auth-username {
        max-width: 6rem;
        font-size: 0.8rem;
    }

    .auth-avatar {
        width: 2.35rem;
        height: 2.35rem;
    }

    .auth-dialog__panel {
        padding: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-button,
    .auth-avatar,
    .profile-menu button,
    .auth-switch__button {
        transition: none;
    }
}
