/* ---------------------------------------------------------- *
 * Nav dropdowns (login / profile)
 * ---------------------------------------------------------- */

.nav-account-wrap {
    position: relative;
}

.nav-account-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--color-hairline-strong);
    color: var(--color-ink);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.nav-account-button:hover,
.nav-account-button.nav-dropdown-open {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.nav-account-button svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.nav-account-chevron {
    font-size: 10px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.nav-account-button.nav-dropdown-open .nav-account-chevron {
    transform: rotate(180deg);
}

.nav-account-button-authed {
    padding-left: 6px;
}

.nav-account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    overflow: hidden;
    flex-shrink: 0;
}

.nav-account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nav-account-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 280px;
    background: var(--color-surface-card);
    border: 1px solid var(--color-hairline-strong);
    border-top: 2px solid var(--color-primary);
    z-index: 50;
    animation: nav-dropdown-in 0.15s ease-out;
}

.nav-dropdown-login {
    width: 320px;
}

.nav-dropdown-profile {
    width: 240px;
}

@keyframes nav-dropdown-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nav-dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: transparent;
}

.nav-dropdown-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--color-hairline);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-dropdown-kicker {
    color: var(--color-primary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.nav-dropdown-name {
    color: var(--color-ink);
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-dropdown-title {
    color: var(--color-ink);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.nav-dropdown-error {
    margin: 14px 20px 0;
    padding: 10px 12px;
    background: var(--color-canvas-soft);
    border-left: 3px solid var(--color-semantic-error, #cf2d56);
    color: var(--color-semantic-error, #cf2d56);
    font-size: 12px;
    line-height: 1.5;
}

.nav-login-form {
    padding: 16px 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.nav-login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-login-label {
    color: var(--color-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.nav-login-input {
    padding: 10px 12px;
    background: var(--color-canvas-soft);
    border: 1px solid var(--color-hairline-strong);
    color: var(--color-ink);
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-login-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(245, 78, 0, 0.12);
}

.nav-login-submit {
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    width: 100%;
    margin-top: 4px;
}

.nav-dropdown-divider {
    height: 1px;
    background: var(--color-hairline);
    margin: 0;
}

.nav-dropdown-footer {
    padding: 14px 20px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--color-muted);
    font-size: 12px;
}

.nav-dropdown-link {
    color: var(--color-primary);
    font-weight: 600;
    border-bottom: 1px solid var(--color-primary);
    padding-bottom: 1px;
    transition: opacity 0.2s ease;
}

.nav-dropdown-link:hover {
    opacity: 0.75;
}

.nav-dropdown-form {
    margin: 0;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    width: 100%;
    background: transparent;
    border: 0;
    color: var(--color-body);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-dropdown-item span:first-child {
    color: var(--color-primary);
    font-size: 14px;
    line-height: 1;
    width: 16px;
    display: inline-flex;
    justify-content: center;
}

.nav-dropdown-item:hover {
    background: var(--color-canvas-soft);
    color: var(--color-ink);
}

.nav-dropdown-item-danger:hover {
    color: var(--color-semantic-error, #cf2d56);
}

.nav-dropdown-item-danger:hover span:first-child {
    color: var(--color-semantic-error, #cf2d56);
}

@media (max-width: 767.98px) {
    .nav-account-wrap {
        position: static;
    }

    .nav-dropdown {
        position: relative;
        top: auto;
        right: auto;
        left: auto;
        width: 100%;
        margin-top: 8px;
    }

    .nav-dropdown-login,
    .nav-dropdown-profile {
        width: 100%;
    }

    .nav-account-name {
        max-width: none;
        flex: 1 1 auto;
        text-align: left;
    }

    .nav-dropdown-backdrop {
        display: none;
    }
}

@media (max-width: 640px) {
    .nav-dropdown {
        min-width: 0;
    }

    .nav-account-name {
        max-width: 100px;
    }
}


