:root {
    --primary-color: #f9d71c;
    --dark-bg: #0a0a0b;
    --text-white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-glow: rgba(249, 215, 28, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-white);
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
}

#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at center, #1a1a20 0%, #0a0a0b 100%);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
    position: absolute;
    width: 100%;
    z-index: 10;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.logo span {
    color: var(--primary-color);
}

.phone-btn {
    text-decoration: none;
    color: var(--text-white);
    font-weight: 600;
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.phone-btn:hover {
    background: var(--primary-color);
    color: var(--dark-bg);
    box-shadow: 0 0 20px var(--accent-glow);
}

.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    padding-left: 5%;
    position: relative;
    z-index: 5;
}

.content {
    max-width: 500px;
}

h1 {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    opacity: 0.8;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.input-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 12px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

.cta-button {
    width: 100%;
    padding: 1.2rem;
    border: none;
    border-radius: 12px;
    background: var(--primary-color);
    color: var(--dark-bg);
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-transform: uppercase;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--accent-glow);
}

.decor-text {
    position: absolute;
    bottom: -2rem;
    right: -2rem;
    font-size: 15rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.02);
    pointer-events: none;
    user-select: none;
    z-index: 1;
}


/* Глобальные контейнеры */
.grid-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    padding: 0 15px;
    margin: 0 auto;
}

.content {
    width: 100%;
    max-width: 100%;
}

#map-container {
    width: 100%;
    height: 350px;
    padding: 0.5rem;
    border-radius: 24px;
    order: 2;
    /* Карта под формой на мобильных */
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

#map {
    width: 100%;
    height: 100%;
    border-radius: 20px;
}

.input-with-action {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Компоненты оформления заказа */
.booking-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.route-visual {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    position: relative;
    padding: 0.5rem 0;
}

.route-visual::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 30px;
    bottom: 30px;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color), rgba(255, 255, 255, 0.2));
    z-index: 1;
}

.route-segment {
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
    position: relative;
    z-index: 2;
}

.dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-top: 4px;
    border: 3px solid var(--dark-bg);
}

.dot.start {
    background: var(--primary-color);
    box-shadow: 0 0 15px var(--accent-glow);
}

.dot.end {
    background: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.address-box small {
    display: block;
    font-size: 0.6rem;
    color: var(--primary-color);
    letter-spacing: 1.5px;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
}

.address-text {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-white);
    max-width: 100%;
    word-break: break-word;
}

.stats-row {
    display: flex;
    gap: 0.8rem;
}

.stat-item {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 0.8rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.price-section {
    background: linear-gradient(135deg, rgba(249, 215, 28, 0.15) 0%, rgba(249, 215, 28, 0.05) 100%);
    border: 1px solid var(--primary-color);
    padding: 1.2rem;
    border-radius: 20px;
    text-align: center;
}

.price-label {
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
}

.price-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-white);
}

/* Авторизация */
.auth-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.2rem;
    margin-bottom: 0.5rem;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.auth-tab {
    flex: 1;
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-tab.active {
    background: var(--glass-bg);
    color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.auth-content {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.phone-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 2px solid var(--glass-border) !important;
    border-radius: 12px !important;
    padding: 1rem !important;
    font-size: 1.1rem !important;
    text-align: center;
    color: var(--primary-color) !important;
    font-weight: 800;
    transition: all 0.3s ease;
}

.phone-input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Кнопки действий */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.confirm-btn {
    width: 100%;
    padding: 1.2rem;
    background: var(--primary-color);
    color: var(--dark-bg);
    border: none;
    border-radius: 16px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 10px 25px var(--accent-glow);
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.confirm-btn:hover:not(.disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px var(--accent-glow);
}

.confirm-btn.disabled {
    background: #333;
    color: #666;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.7;
}

.edit-btn {
    width: 100%;
    padding: 0.9rem;
    background: transparent;
    color: var(--text-white);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.edit-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* --- ДЕКСТОПНЫЕ СТИЛИ (ОТ 769px) --- */
@media (min-width: 769px) {
    .grid-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        width: 90%;
        max-width: 1400px;
        align-items: center;
    }

    #map-container {
        height: 600px;
        padding: 1rem;
        order: unset;
        /* Возвращаем стандартный порядок (сбоку) */
    }

    .content {
        max-width: 500px;
    }

    .hero {
        padding-left: 5%;
    }
}

/* --- МОБИЛЬНЫЕ КОРРЕКТИРОВКИ (ДО 768px) --- */
@media (max-width: 768px) {
    header {
        padding: 1rem;
        flex-direction: column;
        gap: 15px;
        background: rgba(10, 10, 11, 0.9);
        backdrop-filter: blur(15px);
        position: relative;
        text-align: center;
    }

    .hero {
        padding: 2rem 0 4rem;
        height: auto;
        display: block;
    }

    h1 {
        font-size: 2rem;
        text-align: center;
        margin: 1.5rem 0;
    }

    p {
        font-size: 1rem;
        text-align: center;
        margin-bottom: 2rem;
        padding: 0 1rem;
    }

    .glass-panel {
        margin: 0 10px;
        padding: 1.5rem;
    }

    .decor-text {
        display: none;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.7rem;
    }

    .stats-row {
        flex-direction: column;
    }

    .stat-item {
        width: 100%;
    }

    .price-value {
        font-size: 1.8rem;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none !important;
}

.suggest-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(20, 20, 22, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    z-index: 1000;
    margin-top: 5px;
    max-height: 250px;
    overflow-y: auto;
}

.suggest-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.suggest-item:hover {
    background: var(--primary-color);
    color: var(--dark-bg);
}

/* --- ВЕЕР ДЕСТОПА (ОТ 900px) --- */
@media (min-width: 900px) {
    .grid-container {
        display: grid;
        grid-template-columns: 1fr 1.2fr;
        grid-template-areas: "form map";
        gap: 3rem;
        width: 90%;
        max-width: 1400px;
        align-items: center;
        padding: 5rem 0;
    }

    .content {
        grid-area: form;
        max-width: 500px;
    }

    #map-container {
        grid-area: map;
        height: 650px;
        order: unset;
        padding: 1rem;
    }

    .hero {
        padding-left: 5%;
    }
}

/* --- МОБИЛЬНЫЕ КОРРЕКТИРОВКИ (ДО 899px) --- */
@media (max-width: 899px) {
    header {
        padding: 1rem;
        flex-direction: column;
        gap: 10px;
        background: rgba(10, 10, 11, 0.95);
        backdrop-filter: blur(20px);
        position: relative;
        text-align: center;
        border-bottom: 1px solid var(--glass-border);
    }

    .header-right {
        flex-direction: column;
        gap: 10px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .hero {
        padding: 2rem 0 4rem;
        height: auto;
        display: block;
    }

    h1 {
        font-size: 2.2rem;
        text-align: center;
        margin: 1.5rem 0;
        padding: 0 1rem;
    }

    p {
        font-size: 1.05rem;
        text-align: center;
        margin-bottom: 2rem;
        padding: 0 1.5rem;
    }

    .glass-panel {
        margin: 0 15px;
        padding: 1.8rem;
    }

    .decor-text {
        display: none;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }

    .stats-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .stat-item {
        width: 100%;
    }
}

/* Модальное окно */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    max-width: 420px;
    width: 90%;
    padding: 3rem 2rem;
    text-align: center;
    border-radius: 32px;
    transform: scale(0.8) translateY(20px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay:not(.hidden) .modal-content {
    transform: scale(1) translateY(0);
}

.success-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    animation: bounceIn 0.8s ease;
}

.modal-content h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.modal-content p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.modal-details {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    color: var(--primary-color);
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Стили профиля в хедере */
.user-badge {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 15px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
}

.logout-link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    transition: color 0.2s;
}

.logout-link:hover {
    color: #ff4757;
}

.auth-confirmed {
    color: #4CAF50;
    font-weight: bold;
    padding: 10px;
    text-align: center;
}

/* Переопределение старых стилей */
.auth-box {
    display: none;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}