/* ===========================
   RESET & BASE
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: Arial, sans-serif;
    color: #090909;
    background: #4B96FF;
    -webkit-font-smoothing: antialiased;
}

body {
    overflow-x: hidden;
    background: #090909;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

img {
    display: block;
    max-width: 100%;
}

/* ===========================
   STICKY FOOTER (не для главной)
   =========================== */
body.page-login,
body.page-register,
body.page-dashboard,
body.page-upload,
body.page-mapkeeper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.page-login > .page-content,
body.page-register > .page-content,
body.page-dashboard > .page-content,
body.page-upload > .page-content,
body.page-mapkeeper > .page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

body.page-login .auth-page,
body.page-register .auth-page {
    flex: 1;
}

body.page-dashboard .gallery {
    flex: 1;
}

/* ===========================
   NAVBAR-BG — z-index: 50
   =========================== */
.navbar-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: #4B96FF;
    z-index: 50;
}

.page-index .navbar-bg {
    display: none;
}

/* ===========================
   НАВБАР — z-index: 2000
   =========================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 60px;
    background: transparent;
    pointer-events: none;
}

.navbar > * {
    pointer-events: auto;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: -40px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

.navbar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 4px;
}

.navbar-logo-link {
    display: block;
}

.navbar-logo-img {
    height: 56px;
    width: auto;
    opacity: 0;
    transform: translateY(-100%);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    pointer-events: none;
}

.page-admin .navbar-logo-img,
.page-register .navbar-logo-img,
.page-login .navbar-logo-img,
.page-dashboard .navbar-logo-img,
.page-scene .navbar-logo-img,
.page-upload .navbar-logo-img,
.page-map .navbar-logo-img,
.page-mapkeeper .navbar-logo-img,
.page-privacy .navbar-logo-img,
.page-terms .navbar-logo-img {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.page-map .navbar-center {
    position: absolute;
    left: 60px;
    transform: none;
    margin-bottom: 4px;
}

.page-map .navbar-logo-img {
    filter: brightness(0) saturate(100%) invert(50%) sepia(98%) saturate(2400%) hue-rotate(196deg) brightness(105%) contrast(100%);
}

.page-map .navbar-bg{
    display: none;
}

.page-map .nav-pill{
    background: #4B96FF;
    border-color: #4B96FF;
    color: #F5F5F5;
}

.page-map .nav-pill:hover {
    background: transparent;
    color: #4B96FF;
    border-color: #4B96FF;
}

.page-map .nav-btn-icon{
    filter: brightness(0) saturate(100%) invert(50%) sepia(98%) saturate(2400%) hue-rotate(196deg) brightness(105%) contrast(100%);
}

.page-map .navbar-left { display: none; }
/* ===========================
   ПК / МОБИЛКА ПЕРЕКЛЮЧЕНИЕ
   =========================== */
.navbar-right-desktop {
    display: flex;
    gap: 15px;
}

.navbar-right-mobile {
    display: none;
}

/* ===========================
   NAV PILL — КНОПКИ В НАВБАРЕ
   =========================== */
.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn-icon {
    width: 30px;
    height: 30px;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 17px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    line-height: 1;
    background: #F5F5F5;
    color: #090909;
    border: 2px solid transparent;
    outline: none;
    transition: all 0.2s;
}

.nav-pill:hover {
    background: transparent;
    color: #F5F5F5;
    border-color: #F5F5F5;
}

.nav-btn.active .nav-pill {
    background: transparent;
    color: #F5F5F5;
    border-color: #F5F5F5;
}

/* ===========================
   ГАМБУРГЕР
   =========================== */
.navbar-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
}

.hamburger-icon {
    width: 21px;
    height: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-icon span {
    display: block;
    width: 21px;
    height: 2px;
    background: #090909;
    border-radius: 1px;
    transition: background 0.3s;
}

.close-icon {
    width: 16px;
    height: 16px;
    position: relative;
}

.close-icon span {
    display: block;
    width: 22.6px;
    height: 2px;
    background: #090909;
    border-radius: 1px;
    position: absolute;
    top: 50%;
    left: 50%;
}

.close-icon span:first-child {
    transform: translate(-50%, -50%) rotate(45deg);
}

.close-icon span:last-child {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* ===========================
   BLUR LAYER — z-index: 500
   =========================== */
.blur-layer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-out;
}

.blur-layer.active {
    opacity: 1;
    pointer-events: auto;
}

/* ===========================
   МОБИЛЬНОЕ МЕНЮ — z-index: 1800
   =========================== */
.mobile-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1800;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    background: transparent;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.mobile-menu.active {
    pointer-events: none;
    opacity: 1;
}

.mobile-menu-buttons {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 18px;
}

.mobile-menu-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.mobile-menu .menu-btn,
.mobile-menu .menu-footer-link {
    transform: translateX(100vw);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: auto;
}

.mobile-menu.active .menu-btn:nth-child(1) { transform: translateX(0); transition-delay: 0.05s; }
.mobile-menu.active .menu-btn:nth-child(2) { transform: translateX(0); transition-delay: 0.1s; }
.mobile-menu.active .menu-btn:nth-child(3) { transform: translateX(0); transition-delay: 0.15s; }
.mobile-menu.active .menu-btn:nth-child(4) { transform: translateX(0); transition-delay: 0.2s; }
.mobile-menu.active .menu-btn:nth-child(5) { transform: translateX(0); transition-delay: 0.25s; }

.mobile-menu.active .menu-footer-link:nth-child(1) { transform: translateX(0); transition-delay: 0.25s; }
.mobile-menu.active .menu-footer-link:nth-child(2) { transform: translateX(0); transition-delay: 0.3s; }
.mobile-menu.active .menu-footer-link:nth-child(3) { transform: translateX(0); transition-delay: 0.35s; }

/* ===========================
   PILL-КНОПКИ (общие)
   =========================== */
.menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 17px;
    border-radius: 9999px;
    border: 2px solid #090909;
    background: transparent;
    color: #090909;
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    line-height: 1;
}

.menu-btn-icon {
    width: 35px;
    height: 35px;
}

.pill-white { background: #F5F5F5; border-color: #F5F5F5; color: #090909; }
.pill-outline-white { background: transparent; border-color: #F5F5F5; color: #F5F5F5; }
.pill-blue { background: #4B96FF; border-color: #4B96FF; color: #F5F5F5; }
.pill-outline-blue { background: transparent; border-color: #4B96FF; color: #4B96FF; }

.menu-footer-link {
    font-size: 12px;
    font-weight: bold;
    color: #090909;
}

/* ===========================
   КАРТОЧКА СЦЕНЫ
   =========================== */
.scene-card {
    width: 300px;
    display: block;
    transition: opacity 0.2s;
}

.scene-card:hover { opacity: 0.85; }

.scene-card-thumb {
    width: 300px;
    height: 300px;
    overflow: hidden;
    background: #ddd;
}

.scene-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scene-card-info { padding-top: 12px; }

.scene-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #090909;
    margin-bottom: 4px;
}

.scene-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.scene-card-author { font-size: 12px; color: #4B96FF; }

.scene-card-views {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #090909;
    opacity: 0.6;
}

/* ===========================
   ФУТЕР ПК
   =========================== */
.footer-desktop {
    height: 180px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: #090909;
    padding: 0 60px 92px;
    flex-shrink: 0;
}

.footer-left {
    margin-top: 27px;
    display: flex;
    flex-direction: column;
}

.footer-logo {
    width: 312px;
    height: auto;
    margin-bottom: 8px;
    filter: brightness(0) saturate(100%) invert(50%) sepia(98%) saturate(2400%) hue-rotate(196deg) brightness(105%) contrast(100%);
}

.footer-copy { font-size: 12px; color: #F5F5F5; }

.footer-right {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.footer-contact {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.footer-link {
    font-size: 12px;
    color: #F5F5F5;
    opacity: 0.6;
}

.footer-link:hover { opacity: 1; }

.footer-powered {
    font-size: 10px;
    color: #4B96FF;
    margin-top: 8px;
}

.footer-mobile { display: none; }

/* ===========================
   AUTH PAGE (регистрация / вход)
   =========================== */
.auth-page {
    background: #F5F5F5;
    padding: 130px 60px 60px;
    display: flex;
    justify-content: center;
}

.page-login .auth-container {
    max-width: 480px;
}

.auth-container {
    width: 100%;
    max-width: 900px;
}

.auth-title {
    font-size: 40px;
    font-weight: 700;
    color: #090909;
    margin-bottom: 40px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-columns {
    display: flex;
    gap: 30px;
}

.form-columns .form-column:nth-child(1){
    margin-bottom: 20px;
}

.form-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 14px;
    color: #4B96FF;
    margin-bottom: 8px;
    font-weight: 400;
}

.form-input {
    height: 48px;
    padding: 0;
    border: none;
    border-bottom: 2px solid #D9D9D9;
    border-radius: 0;
    font-size: 16px;
    font-family: Arial, sans-serif;
    color: #090909;
    background: transparent;
    outline: none;
    transition: border-color 0.2s;
}

.form-input::placeholder { color: #BBBBBB; }
.form-input:focus { border-bottom-color: #4B96FF; }

.form-hint {
    font-size: 12px;
    min-height: 15px;
    margin-top: 4px;
    color: transparent;
}

.form-hint.error { color: #FF4B4B; }


/* ===========================
   РАДИО — ТИП АККАУНТА
   =========================== */
.form-roles {
    display: flex;
    gap: 40px;
    margin: 30px 0 30px;
}

.role-option {
    flex: 1;
    cursor: pointer;
}

.role-option input[type="radio"] { display: none; }

.role-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.role-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.role-radio {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    border: 2px solid #090909;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.role-option input[type="radio"]:checked ~ .role-card .role-radio {
    border-color: #090909;
}

.role-option input[type="radio"]:checked ~ .role-card .role-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #090909;
}

.role-card.disabled .role-radio { border-color: #ccc; }
.role-card.disabled .role-name { color: #ccc; }
.role-card.disabled .role-desc { color: #ccc; }

.role-name { font-size: 18px; font-weight: 700; color: #090909; }

.role-desc {
    font-size: 13px;
    color: #090909;
    opacity: 0.7;
    line-height: 1.5;
}

.form-error {
    background: #FF4B4B;
    color: #F5F5F5;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 16px;
}

.form-submit-btn {
    padding: 0 25px;
    height: 52px;
    margin: 50px auto 0;
    border-radius: 9999px;
    background: #4B96FF;
    color: #F5F5F5;
    font-size: 18px;
    font-weight: 700;
    font-family: Arial, sans-serif;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.form-submit-btn:hover { background: #3A7FE0; }

.form-submit-btn:disabled {
    background: #D2D2D2;
    color: #909090;
    cursor: not-allowed;
}

.form-agree {
    text-align: center;
    font-size: 12px;
    color: #090909;
    opacity: 0.5;
    margin-top: 16px;
    line-height: 1.6;
}

.form-agree-link {
    color: #4B96FF;
    opacity: 1;
}

/* ===========================
   АДАПТИВ — МОБИЛКА
   =========================== */
@media (max-width: 768px) {

    .navbar {
        height: 60px;
        padding: 0 20px;
    }

    .navbar-bg { height: 60px; }
    .navbar-left { display: none; }

    .navbar-center {
        position: static;
        transform: none;
        left: 60px;
        margin-right: auto;
    }

    .page-map .navbar-center {
        position: absolute;
        left: 20px;
        transform: none;
        margin-bottom: 4px;
    }
    
    .navbar-logo-img {
        height: auto;
        width: 265px;
    }

    .navbar-right-desktop { display: none; }
    .navbar-right-mobile { display: flex; margin-right: 3px; }

    .page-index .hamburger-icon span { background: #090909; }
    .page-index .close-icon span { background: #090909; }

    .mobile-menu .menu-btn-pill {
        height: 35px;
        background: #F5F5F5;
        border: 0px solid #F5F5F5;
        color: #090909;
    }

    .mobile-menu .menu-btn-icon { width: 35px; height: 35px; }
    .mobile-menu .menu-footer-link { color: #090909; }

    .page-admin .mobile-menu .menu-btn-icon,
    .page-register .mobile-menu .menu-btn-icon,
    .page-login .mobile-menu .menu-btn-icon,
    .page-dashboard .mobile-menu .menu-btn-icon,
    .page-scene .mobile-menu .menu-btn-icon,
    .page-upload .mobile-menu .menu-btn-icon,
    .page-map .mobile-menu .menu-btn-icon,
    .page-mapkeeper .mobile-menu .menu-btn-icon {
        filter: brightness(0) saturate(100%) invert(50%) sepia(98%) saturate(2400%) hue-rotate(196deg) brightness(105%) contrast(100%);
    }

    .page-admin .mobile-menu .menu-btn-pill,
    .page-register .mobile-menu .menu-btn-pill,
    .page-login .mobile-menu .menu-btn-pill,
    .page-scene .mobile-menu .menu-btn-pill,
    .page-map .mobile-menu .menu-btn-pill,
    .page-mapkeeper .mobile-menu .menu-btn-pill,
    .page-dashboard .mobile-menu .menu-btn-pill,
    .page-upload .mobile-menu .menu-btn-pill {
        background: #4B96FF;
        border-color: #4B96FF;
        color: #F5F5F5;
    }

    .page-register .mobile-menu .menu-footer-link,
    .page-login .mobile-menu .menu-footer-link,
    .page-scene .mobile-menu .menu-footer-link,
    .page-map .mobile-menu .menu-footer-link,
    .page-mapkeeper .mobile-menu .menu-footer-link,
    .page-dashboard .mobile-menu .menu-footer-link,
    .page-upload .mobile-menu .menu-footer-link {
        color: #090909;
    }

    .page-register .mobile-menu .mobile-menu-footer .menu-btn-pill,
    .page-login .mobile-menu .mobile-menu-footer .menu-btn-pill,
    .page-scene .mobile-menu .mobile-menu-footer .menu-btn-pill,
    .page-map .mobile-menu .mobile-menu-footer .menu-btn-pill,
    .page-mapkeeper .mobile-menu .mobile-menu-footer .menu-btn-pill,
    .page-dashboard .mobile-menu .mobile-menu-footer .menu-btn-pill,
    .page-upload .mobile-menu .mobile-menu-footer .menu-btn-pill {
        background: #4B96FF;
        border-color: #4B96FF;
        color: #F5F5F5;
    }

    .scene-card { width: calc(50% - 8px); }

    .scene-card-thumb {
        width: 100%;
        height: 0;
        padding-bottom: 100%;
        position: relative;
    }

    .scene-card-thumb img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    .footer-desktop { display: none; }

    .footer-mobile {
        display: flex;
        height: 75px;
        background: #090909;
        padding: 0 20px;
        gap: 32px;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
    }

    .footer-mobile-bottom:last-child {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-copy-mobile { font-size: 12px; color: #F5F5F5; margin-bottom: 5px; }
    .footer-powered-mobile { font-size: 10px; color: #4B96FF; }

    .auth-page {
        padding: 80px 20px 40px;
    }

    .auth-title { font-size: 24px; margin-bottom: 24px; }

    .form-columns {
        flex-direction: column;
        gap: 20px;
    }

    .form-columns .form-column:nth-child(1){
        margin-bottom: 0px;
    }

    .form-input { height: 44px; font-size: 15px; }

    .form-roles {
        flex-direction: column;
        gap: 24px;
    }

    .role-name { font-size: 16px; }
    .role-desc { font-size: 12px; }

    .form-submit-btn {
        height: 48px;
        font-size: 16px;
    }

    .form-agree { font-size: 11px; }
}
