.header-auth,
.auth-floating {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-floating {
    position: fixed;
    top: clamp(80px, 8vh, 128px);
    right: 20px;
    z-index: 2000;
}


.auth-trigger {
    font-family: inherit;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease, opacity 0.2s ease;
    color: #f5f7ff;
    background: #2f3d67;
}

.auth-trigger:hover {
    opacity: 0.9;
}

.auth-user {
    position: relative;
    display: flex;
    align-items: center;
    color: #e9ecff;
    font-size: 0.9rem;
}

.auth-user-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(79, 107, 168, 0.4);
    background: rgba(31, 45, 84, 0.8);
    color: inherit;
    cursor: pointer;
    font-weight: 600;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.auth-user-toggle:hover,
.auth-user-toggle[aria-expanded="true"] {
    border-color: rgba(115, 149, 229, 0.8);
    background: rgba(43, 63, 112, 0.95);
}

.auth-user-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-user-country {
    font-size: 0.8rem;
    opacity: 0.75;
}

.auth-user-caret {
    font-size: 0.65rem;
    opacity: 0.6;
}

.auth-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(12, 19, 38, 0.98);
    backdrop-filter: blur(12px);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    display: none;
    flex-direction: column;
    gap: 6px;
    z-index: 2100;
}

.auth-menu:not([hidden]) {
    display: flex;
}

.auth-menu-item {
    width: 100%;
    padding: 9px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #d7defb;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.auth-menu-item:hover {
    background: rgba(66, 97, 178, 0.25);
    color: #ffffff;
}

.auth-menu-item.auth-menu-danger {
    color: #fca5a5;
}

.auth-menu-item.auth-menu-danger:hover {
    background: rgba(190, 49, 49, 0.25);
    color: #fee2e2;
}

body.auth-modal-open {
    overflow: hidden;
}

.auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 12, 24, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    padding: 20px;
}

.auth-modal-content {
    background: #0f1729;
    border-radius: 16px;
    width: 100%;
    max-width: 360px;
    padding: 24px 28px;
    color: #ffffff;
    position: relative;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.auth-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: transparent;
    border: none;
    color: #8da2ff;
    font-size: 1.4rem;
    cursor: pointer;
}

.auth-modal-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.auth-tab {
    flex: 1;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    background: #1e2a44;
    color: #b6c4ff;
    font-weight: 600;
    cursor: pointer;
}

.auth-tab.is-active {
    background: #3c5af0;
    color: #ffffff;
}

.auth-title {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

[data-auth-form] {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

[data-auth-form] label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: #d0d7ff;
}

[data-auth-form] input,
[data-auth-form] select {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #25345f;
    background: #121f38;
    color: #ffffff;
}

.auth-primary {
    margin-top: 8px;
    padding: 12px 14px;
    border-radius: 8px;
    border: none;
    background: #4868ff;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

.auth-primary:hover {
    background: #3c56d8;
}

.auth-link {
    background: none;
    border: none;
    color: #9fb4ff;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.85rem;
    align-self: flex-start;
}

.auth-message {
    margin-top: 12px;
    font-size: 0.85rem;
}

.auth-message[data-type="error"] {
    color: #fca5a5;
}

.auth-message[data-type="success"] {
    color: #6ee7b7;
}

.auth-hint {
    font-size: 0.8rem;
    color: #92a6ff;
}
