:root {
    --nav-h: 76px;
    --divider: #e5e7eb;
    --nav-link: #222;
    --nav-link-active: #e63946;
    --brand: #e63946;
}

.top-nav .nav-header {
    min-height: var(--nav-h);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    max-width: min(1680px, calc(100% - 48px));
}

.top-nav .nav-left {
    display: flex;
    align-items: center;
    gap: .5rem;
    justify-content: flex-end;
    min-width: 0;
}

.top-nav .nav-center {
    position: static;
    left: auto;
    transform: none;
    display: flex;
    justify-content: center;
    min-width: 88px;
}

.top-nav .nav-right {
    display: flex;
    align-items: center;
    gap: .75rem;
    justify-content: flex-start;
    min-width: 0;
}

.top-nav .menu.desktop-only {
    display: flex;
    gap: .2rem;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    min-width: 0;
}

.top-nav .menu.desktop-only .nav-link {
    display: block;
    padding: .5rem .58rem;
    text-decoration: none;
    color: var(--nav-link);
    border-radius: .5rem;
    white-space: nowrap;
}

.top-nav .menu.desktop-only .nav-link:hover,
.top-nav .menu.desktop-only .nav-link.active {
    color: var(--nav-link-active)
}

.rm-public-language-switcher {
    flex: 0 0 auto;
    margin-left: .35rem;
}

.rm-public-nav .login-toggle,
.rm-public-nav > .nav-header > .nav-right > .login-btn {
    flex: 0 0 auto;
}

@media (min-width: 992px) and (max-width: 1350px) {
    .top-nav .nav-header {
        gap: .4rem;
        max-width: calc(100% - 24px);
    }

    .top-nav .menu.desktop-only {
        gap: 0;
    }

    .top-nav .menu.desktop-only .nav-link {
        font-size: 11px;
        letter-spacing: 1px;
        padding: .48rem .38rem;
    }

    .top-nav .nav-right {
        gap: .35rem;
    }

    .rm-public-language-switcher {
        margin-left: .15rem;
    }

    .rm-public-nav .login-toggle {
        margin-left: .35rem;
    }
}

@media (max-width: 991.98px) {
    .top-nav .nav-header {
        gap: .5rem;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        max-width: calc(100% - 28px);
    }

    .top-nav .nav-left {
        justify-content: flex-start;
    }

    .top-nav .nav-right {
        justify-content: flex-end;
    }

    .top-nav .nav-center {
        min-width: 76px;
    }
}

#menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .25);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s ease, visibility .25s ease;
    z-index: 1
}

#menu-backdrop.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto
}

#mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: .5rem 0;
    list-style: none;
    background: #fff;
    border-top: 1px solid var(--divider);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .25s ease, opacity .25s ease, visibility .25s ease;
    z-index: 2;
    max-height: calc(100dvh - var(--nav-h) - 24px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch
}

#mobile-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto
}

#mobile-menu li {
    list-style: none
}

#mobile-menu a.nav-link {
    display: block;
    padding: .65rem 1.8rem;
    text-decoration: none;
    color: var(--nav-link)
}

#mobile-menu a.nav-link:hover,
#mobile-menu a.nav-link.active {
    color: var(--nav-link-active)
}

#mobile-menu .section-sep {
    margin: .25rem 0;
    border-top: 1px solid var(--divider)
}

#mobile-menu .section-title {
    padding: .5rem 1rem;
    font-size: .9rem;
    opacity: .7
}

.login-popover {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: min(320px, 86vw);
    background: #fff;
    border: 1px solid var(--divider);
    padding: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 1200;
}

.login-popover.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.login-popover .form-control {
    width: 100%;
    margin-bottom: .5rem;
}

.login-popover .btn {
    width: 100%;
}

.login-toggle {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.login-btn--nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.65rem 1rem;
    border: 1px solid #222;
    background: #fff;
    color: var(--idc-primary);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1;
    transition: all 0.2s ease;
}

.login-btn--nav:hover {
    background: #fff5f6;
    border-color: var(--idc-primary);
    color: var(--idc-primary-700);
}

.login-popover::before {
    content: "";
    position: absolute;
    top: -7px;
    right: 30px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    border-left: 1px solid #e5e7eb;
    transform: rotate(45deg);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
}

.login-form__input {
    display: block;
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid #d7dde5;
    background: #f8fafc;
    color: #1f2937;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 44px;
    outline: none;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.login-form__input::placeholder {
    color: #94a3b8;
}

.login-form__input:focus {
    border-color: rgba(230, 57, 70, 0.45);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.08);
}

.login-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    margin: 2px 0 0;
    padding: 0 1rem;
    border: none;
    background: var(--idc-primary);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1;
    box-sizing: border-box;
    transition: background-color 0.2s ease, transform 0.15s ease;
    cursor: pointer;
}

.login-form__submit:hover {
    background: var(--idc-primary-700);
    border: none;
    color: #fff;
}

.login-form__submit:active {
    transform: translateY(1px);
}

.login-form__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

@media (max-width: 991.98px) {
    .login-popover {
        width: min(320px, calc(100vw - 24px));
        right: 0;
    }
}
