/*
 * Giao diện modal đăng ký và đăng nhập glassmorphism.
 */
body.auth-modal-open {
    overflow: hidden;
}

.auth-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-left: auto;
}

.auth-nav__button {
    border: 1px solid #e8663d;
    border-radius: 4px;
    padding: 0.55rem 0.85rem;
    color: #ffffff;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
}

.auth-nav__button:hover,
.auth-nav__button:focus-visible {
    background: rgba(232, 102, 61, 0.28);
}

.auth-nav__button--register {
    border-color: #22c55e;
    background: #22c55e;
}

.auth-nav__button--register:hover,
.auth-nav__button--register:focus-visible {
    background: #16a34a;
}

.auth-nav--logged-in {
    position: relative;
    align-items: center;
}

.auth-nav__greeting {
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
}

.auth-nav__profile {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border: 1px solid #e8663d;
    border-radius: 50%;
    color: #ffffff;
    background: #16213e;
    cursor: pointer;
}

.auth-nav__icon {
    color: #ff9a78;
    font-size: 1.1rem;
}

.auth-user-menu {
    position: absolute;
    z-index: 10;
    top: calc(100% + 0.6rem);
    right: 0;
    display: grid;
    min-width: 150px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    padding: 0.4rem;
    background: #16213e;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.auth-user-menu[hidden] {
    display: none;
}

.auth-user-menu a {
    padding: 0.6rem 0.75rem;
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
}

.auth-user-menu a:hover,
.auth-user-menu a:focus-visible {
    border-radius: 4px;
    background: rgba(232, 102, 61, 0.25);
}

.auth-modal[aria-hidden="true"] {
    display: none;
}

.auth-modal {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 27, 52, 0.82);
}

.auth-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 470px);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    padding: 2rem;
    color: #ffffff;
    background: rgba(16, 27, 52, 0.96);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

@supports (backdrop-filter: blur(12px)) {
    .auth-modal__dialog {
        background: rgba(22, 33, 62, 0.78);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
    }
}

.auth-modal__close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    border: 0;
    color: #ffffff;
    background: transparent;
    cursor: pointer;
    font-size: 1.8rem;
    line-height: 1;
}

.auth-modal__eyebrow {
    margin: 0 0 0.5rem;
    color: #ff9a78;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.auth-modal__header h2 {
    margin: 0;
    font-size: 1.75rem;
}

.auth-modal__message {
    min-height: 1.5em;
    margin: 0.75rem 0 0;
    color: #ffb199;
    font-size: 0.9rem;
}

.auth-field {
    margin: 0 0 1rem;
}

.auth-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.auth-field input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.75rem;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    font: inherit;
}

.auth-field input:focus {
    border-color: #2dd4bf;
    outline: 2px solid rgba(45, 212, 191, 0.25);
}

.auth-field__error {
    display: block;
    min-height: 1.25em;
    margin-top: 0.25rem;
    color: #ffb199;
    font-size: 0.8rem;
}

.auth-form__submit {
    width: 100%;
    cursor: pointer;
}

.auth-form__submit[aria-busy="true"] {
    opacity: 0.65;
    cursor: wait;
}

.auth-form__switch {
    margin: 1.25rem 0 0;
    color: #c8d1e2;
    text-align: center;
    font-size: 0.9rem;
}

.auth-form__switch button {
    border: 0;
    padding: 0;
    color: #ff9a78;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
    .auth-modal__dialog {
        transition: none;
    }
}

@media (max-width: 800px) {
    .auth-nav {
        margin-left: 0;
    }
}
