/* ========== Глобальные стили и сброс ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Цветовая палитра */
    --bg-page: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --error-color: #ef4444;
    --success-color: #16a34a;
    --link-color: #2563eb;
    --input-focus: #2563eb;
    --checkbox-bg: #ffffff;
    --checkbox-checked: #2563eb;
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    
    /* Тени */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 6px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);
    --shadow-xl: 0 24px 60px rgba(15, 23, 42, 0.16);
    
    /* Радиусы */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    /* Переходы */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
    min-height: 100vh;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-main {
    flex: 1;
    padding: 32px 16px 40px;
}

.layout {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 40px;
    align-items: flex-start;
}

.content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(229, 231, 235, 0.8);
}

/* ========== Типографика ========== */
.title {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.25;

/* ========== Telegram-предупреждение ========== */
.telegram-warning {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: #f9fafb;
    border-radius: var(--radius-md);
    border: 1px dashed #d1d5db;
    padding: 10px 12px;
    display: none;
}

.telegram-warning.telegram-warning--visible {
    display: block;
}
    margin-bottom: 12px;
    color: var(--text-primary);
}

.lead-text {
    font-size: 0.98rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ========== Форма ========== */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.required {
    color: var(--error-color);
    font-weight: 600;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--checkbox-bg);
    color: var(--text-primary);
    transition: all var(--transition-smooth);
    outline: none;
}

.form-input:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input.error {
    border-color: var(--error-color);
}

.form-input.error:focus {
    box-shadow: 0 0 0 4px rgba(245, 101, 101, 0.1);
}

/* ========== Чекбоксы ========== */
.checkboxes-group {
    margin-bottom: 30px;
}

.checkbox-wrapper {
    margin-bottom: 16px;
    position: relative;
}

.checkbox-wrapper:last-of-type {
    margin-bottom: 0;
}

.checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-wrapper label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-left: 0;
    gap: 12px;
}

.checkbox-custom {
    position: relative;
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--checkbox-bg);
    transition: all var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.checkbox-custom::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform var(--transition-smooth);
}

.checkbox-wrapper input[type="checkbox"]:checked + label .checkbox-custom {
    background: var(--checkbox-checked);
    border-color: var(--checkbox-checked);
}

.checkbox-wrapper input[type="checkbox"]:checked + label .checkbox-custom::after {
    transform: rotate(45deg) scale(1);
}

.checkbox-wrapper input[type="checkbox"]:focus + label .checkbox-custom {
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.checkbox-text {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.inline-link {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-fast);
}

.inline-link:hover {
    border-bottom-color: var(--link-color);
}

/* ========== Сообщения об ошибках ========== */
.error-message {
    margin-top: 8px;
    font-size: 0.875rem;
    color: var(--error-color);
    display: none;
    animation: slideDown 0.3s ease;
}

.error-message.show {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== Кнопка отправки ========== */
.submit-btn {
    width: 100%;
    padding: 16px 32px;
    font-size: 1.05rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 40%, #15803d 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, #16a34a 0%, #15803d 45%, #166534 100%);
}

.submit-btn:not(:disabled):active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
}

.submit-btn.loading {
    pointer-events: none;
}

.btn-text {
    transition: opacity var(--transition-fast);
}

.btn-loader {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    opacity: 0;
    animation: spin 0.8s linear infinite;
}

.submit-btn.loading .btn-loader {
    opacity: 1;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== Общие сообщения формы ========== */
.form-message {
    margin-top: 20px;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    text-align: center;
    white-space: pre-line;
    display: none;
    animation: slideDown 0.3s ease;
}

.form-message.show {
    display: block;
}

.form-message.error {
    background: rgba(245, 101, 101, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(245, 101, 101, 0.3);
}

.form-message.success {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(72, 187, 120, 0.3);
}

/* ========== Блок бронирования ========== */
.booking {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.booking-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    padding: 8px 0;
    background: transparent;
    border: none;
    box-shadow: none;
    transition: opacity var(--transition-smooth);
}

.booking-card--disabled {
    opacity: 0.5;
}

.booking-card--active {
    opacity: 1;
}

.booking-info {
    flex: 1;
    min-width: 0;
}

.booking-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.booking-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.booking-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.booking-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border: none;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 40%, #15803d 100%);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background var(--transition-smooth), opacity var(--transition-fast);
}

.booking-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
}

.booking-card--active .booking-btn:not(:disabled):hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 45%, #166534 100%);
}

.booking-btn-icon {
    width: 14px;
    height: 14px;
    position: relative;
}

.booking-btn-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    border-style: solid;
    border-width: 5px 0 5px 8px;
    border-color: transparent transparent transparent #eff6ff;
}

.booking-btn-text {
    white-space: nowrap;
}

.booking-btn--secondary {
    background: #111827;
}

.booking-card--active .booking-btn--secondary:not(:disabled):hover {
    background: #020617;
}

.booking-divider {
    width: 100%;
    height: 1px;
    background-color: #e5e7eb;
}

/* ========== Подвал карточки ========== */
/* ========== Галерея ========== */
.gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.location-label {
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding-left: 0;
    margin-left: 0;
    text-align: center;
}

.location-subtitle {
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    text-align: center;
    text-transform: uppercase;
    margin-top: -14px;
}

.location-subtitle .apt-name,
.location-subtitle .apt-name--gold {
    font-weight: inherit;
    letter-spacing: inherit;

    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;

    color: inherit;
    -webkit-text-stroke: 0;
    text-shadow: none;
}

.apt-name {
    font-weight: 600;
    letter-spacing: 0.04em;
}

.apt-name--gold {
    background: linear-gradient(
        135deg,
        #fff2b0 0%,
        #facc15 25%,
        #d97706 55%,
        #92400e 75%,
        #78350f 100%
    );

    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;

    -webkit-text-stroke: 0.6px #92400e;
    text-shadow:
        0 1px 2px rgba(120, 53, 15, 0.5),
        0 0 8px rgba(250, 204, 21, 0.55);
}


.gallery-main {
    background: #f9fafb;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: var(--shadow-md);
    padding: 12px;
}

.gallery-main-media {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: #000;
    /* Фиксированная высота для фото и видео: 4:3 через padding-hack */
    padding-top: 75%;
}

.gallery-main-image,
.gallery-main-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 16px;
}

.gallery-main-video {
    background: #000;
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.gallery-thumbs::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbs::-webkit-scrollbar-track {
    background: transparent;
}

.gallery-thumbs::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.6);
    border-radius: 999px;
}

.gallery-thumb {
    border: none;
    padding: 0;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    min-width: 80px;
    max-width: 120px;
    flex: 0 0 auto;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.gallery-thumb img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    display: block;
}

.gallery-thumb-video {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 70px;
    background: #020617;
    color: #e5e7eb;
}

.gallery-thumb-video-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-thumb-video-icon::before {
    content: '';
    border-style: solid;
    border-width: 6px 0 6px 10px;
    border-color: transparent transparent transparent #e5e7eb;
    margin-left: 2px;
}

.gallery-thumb-video-label {
    font-size: 0.75rem;
}

.gallery-thumb:is(:hover, :focus-visible) {
    border-color: rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.gallery-thumb.is-active {
    border-color: var(--link-color);
}

.gallery-thumb[data-type="video"]::after {
    content: '';
    position: absolute;
    right: 12px;
    bottom: 12px;
    border-style: solid;
    border-width: 7px 0 7px 11px;
    border-color: transparent transparent transparent #f9fafb;
    filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.6));
}

/* ========== Футер ========== */
.site-footer {
    background: #111827;
    padding: 20px 16px;
    color: #9ca3af;
}

.site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 40px;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.88rem;
}

.footer-left {
    flex: 0 1 60%;
    min-width: 0;
}

.footer-text {
    margin-bottom: 4px;
}

.footer-text--muted {
    color: #6b7280;
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.footer-link {
    color: #e5e7eb;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.footer-link--icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-link-icon {
    width: 16px;
    height: 16px;
    display: block;
    filter: invert(1) brightness(1.8);
}

.footer-link:hover {
    color: #ffffff;
    border-bottom-color: rgba(243, 244, 246, 0.6);
}

.footer-right-top {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    justify-content: flex-end;
}

.footer-right-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    justify-content: flex-end;
    font-size: 0.8rem;
}

@media (min-width: 769px) {
    /* Вертикальная подгонка строки с ИП под блок документов */
    .footer-left {
        margin-top: 30px;
    }

    /* Десктоп: сдвигаем первую строку документов (2 первых пункта) немного вправо */
    .footer-right-bottom > a.footer-link:nth-of-type(1),
    .footer-right-bottom > a.footer-link:nth-of-type(2) {
        position: relative;
        left: 10px;
    }
}

.footer-right-bottom .footer-link {
    color: #9ca3af;
}

.footer-right-bottom .footer-link:hover {
    color: #f9fafb;
}

.footer-separator {
    color: #4b5563;
}

/* ========== Cookie-баннер ========== */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 16px;
    display: none;
    justify-content: center;
    z-index: 50;
    pointer-events: none;
}

.cookie-banner-inner {
    max-width: 960px;
    width: calc(100% - 32px);
    background: #ffffff;
    border-radius: 999px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(229, 231, 235, 0.9);
    padding: 12px 16px 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    pointer-events: auto;
}

.cookie-banner-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.cookie-banner-btn {
    flex-shrink: 0;
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    background: #111827;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.cookie-banner-btn:hover {
    background: #020617;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.cookie-banner-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.cookie-banner.is-visible {
    display: flex;
}

/* ========== Адаптивность ========== */
@media (max-width: 768px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    .page-main {
        padding-top: 24px;
    }

    .content {
        padding: 24px 20px;
    }
    
    .title {
        font-size: 1.6rem;
    }
    
    .form-input {
        padding: 12px 14px;
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    .checkbox-text {
        font-size: 0.9rem;
    }
    
    .submit-btn {
        padding: 14px 28px;
        font-size: 1rem;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .footer-right {
        align-items: flex-start;
    }

    .footer-right-top,
    .footer-right-bottom {
        width: 100%;
        justify-content: flex-start;
    }

    .footer-separator {
        display: none;
    }

    .footer-right-bottom .footer-link {
        display: block;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .page-main {
        padding: 20px 12px 28px;
    }

    .content {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .cookie-banner-inner {
        border-radius: 16px;
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 14px;
        gap: 10px;
    }

    .cookie-banner-btn {
        width: 100%;
        text-align: center;
    }

    .title {
        font-size: 1.35rem;
        margin-bottom: 16px;
    }
    
    .description {
        font-size: 0.875rem;
        margin-bottom: 24px;
    }
    
    .description p {
        margin-bottom: 10px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .checkbox-custom {
        width: 22px;
        height: 22px;
        min-width: 22px;
    }
    
    .checkbox-custom::after {
        width: 5px;
        height: 9px;
    }
    
    .checkbox-wrapper {
        margin-bottom: 14px;
    }

    .booking-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 360px) {
    .title {
        font-size: 1.25rem;
    }
    
    .card {
        padding: 20px 16px;
    }
}

/* ========== Специальные стили для iOS ========== */
@supports (-webkit-touch-callout: none) {
    .form-input,
    .submit-btn,
    .checkbox-wrapper label {
        -webkit-tap-highlight-color: transparent;
    }
}
