:root {
    color-scheme: dark;
    /* Лесная палитра чистого воздуха */
    --bg-dark: #07130d;
    --bg-gradient: radial-gradient(circle at 50% -20%, #173d2b 0%, #08150e 70%, #040906 100%);
    --card-bg: rgba(18, 42, 30, 0.65);
    --card-border: rgba(52, 211, 153, 0.18);
    --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    
    --text-main: #f0fdf4;
    --text-muted: #95c4a6;
    --text-dim: #5c8f70;
    
    --accent-emerald: #10b981;
    --accent-glow: #34d399;
    --accent-hover: #059669;
    --accent-light: rgba(52, 211, 153, 0.15);
    
    --gold: #f59e0b;
    --danger: #ef4444;
    
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 8px;
    
    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

html {
    background-color: #040906;
    color-scheme: dark;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100%;
    position: relative;
    width: 100%;
}

/* Эффект матового лесного тумана на заднем плане */
body::before {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 28px 20px 120px;
    position: relative;
    z-index: 1;
}

/* Шапка WebApp */
.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: var(--accent-glow);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
}

h1 {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hint {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 24px;
    font-weight: 400;
}

/* Карточка Формы */
form {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

form:hover {
    border-color: rgba(52, 211, 153, 0.35);
}

/* Навигация по месяцам */
.month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.month-label {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    text-transform: capitalize;
}

.month-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.month-btn:hover {
    background: var(--accent-light);
    border-color: var(--accent-glow);
    color: var(--accent-glow);
    transform: scale(1.05);
}

/* Обертка календаря */
.calendar-wrap {
    background: rgba(8, 24, 16, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 16px;
}

.calendar-legend {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 13.5px;
    color: var(--text-muted);
}

.selected-range-tag {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-glow);
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

/* Сетка Календаря */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.day-name {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    padding-bottom: 6px;
}

.day-btn {
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    padding: 0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.day-num {
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
}

.day-price {
    display: block;
    font-size: 8px;
    font-weight: 600;
    color: #34d399;
    line-height: 1;
    opacity: 0.9;
    position: absolute;
    bottom: 3px;
}

.day-btn.disabled .day-price {
    display: none;
}

.day-btn.selected .day-price,
.day-btn.in-range .day-price {
    color: #ffffff;
    opacity: 1;
}

.day-btn:hover:not(.disabled) {
    background: var(--accent-light);
    border-color: var(--accent-glow);
    color: #ffffff;
    transform: translateY(-2px);
}

.day-btn.disabled,
.day-btn.past {
    background: rgba(0, 0, 0, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.03) !important;
    color: #4b5563 !important;
    cursor: not-allowed !important;
    opacity: 0.35 !important;
    transform: none !important;
    box-shadow: none !important;
}

.day-btn.selected {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border-color: var(--accent-glow) !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    transform: scale(1.05);
}

.day-btn.in-range {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: rgba(52, 211, 153, 0.3) !important;
    color: var(--accent-glow);
}

/* Поля ввода и выпадающие списки */
.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

input,
select {
    font-family: var(--font-body);
    font-size: 15px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: rgba(5, 18, 12, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    outline: none;
    transition: all 0.2s ease;
}

input:focus,
select:focus {
    border-color: var(--accent-glow);
    background: rgba(10, 30, 20, 0.85);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

input::placeholder {
    color: var(--text-dim);
}

select option {
    background: #0d2117;
    color: #ffffff;
}

/* Информационные плашки */
.balance-info,
.price-info {
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 14.5px;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

.balance-info {
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #bae6fd;
}

.balance-info.has-balance {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: var(--text-main);
}

.price-info {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(5, 150, 105, 0.1) 100%);
    border: 1px solid rgba(52, 211, 153, 0.35);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.price-info strong {
    font-family: var(--font-heading);
    font-size: 20px;
    color: var(--accent-glow);
}

/* Главная кнопка отправки */
#submit-btn {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    padding: 16px 28px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
    margin-top: 6px;
}

#submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    box-shadow: 0 14px 30px rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
}

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

#submit-btn:disabled {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    box-shadow: none;
    cursor: not-allowed;
}

.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-top: 12px;
}

.error.success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(52, 211, 153, 0.3);
    color: var(--accent-glow);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    .container {
        padding: 16px 14px 40px;
    }
    form {
        padding: 20px 16px;
    }
    .row {
        grid-template-columns: 1fr;
    }
    h1 {
        font-size: 26px;
    }
}

/* Полноэкранная модальная табличка успешной брони */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 15, 10, 0.92);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: linear-gradient(135deg, rgba(18, 48, 33, 0.95) 0%, rgba(8, 26, 17, 0.98) 100%);
    border: 1px solid rgba(52, 211, 153, 0.35);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    border-radius: 28px;
    padding: 40px 32px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.modal-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.18);
    border: 2px solid rgba(52, 211, 153, 0.4);
    color: var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-bottom: 6px;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
}

.modal-text {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
}

.modal-booking-number {
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 700;
    color: var(--accent-glow);
    background: rgba(16, 185, 129, 0.12);
    padding: 8px 18px;
    border-radius: 12px;
    border: 1px solid rgba(52, 211, 153, 0.25);
    margin: 4px 0;
}

.modal-close-btn {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    padding: 14px 36px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 10px;
}

.modal-close-btn:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    transform: translateY(-2px);
}

/* Выбор Домиков Карточками */
.rooms-selection-wrap {
    margin-bottom: 20px;
}

.rooms-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dim);
}

.rooms-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.room-card {
    background: rgba(18, 38, 28, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(52, 211, 153, 0.3);
    border-radius: var(--radius-md);
    padding: 12px 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 85px;
    position: relative;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    text-align: center;
}

.room-card:hover:not(.disabled) {
    border-color: #34d399;
    background: rgba(16, 185, 129, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.room-card.selected {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.4), rgba(5, 150, 105, 0.3));
    border: 2px solid #34d399;
    box-shadow: 0 0 22px rgba(52, 211, 153, 0.5);
}

.room-card.disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: rgba(10, 24, 18, 0.6);
    border: 1.5px dashed rgba(255, 255, 255, 0.2);
}

.room-card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.room-card-icon {
    font-size: 15px;
}

.room-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

.room-card-status {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 3px;
}

.room-card.selected .room-card-status {
    color: #34d399;
    font-weight: 600;
}

.room-card-price {
    font-size: 14px;
    font-weight: 700;
    color: #34d399;
    margin-top: 6px;
}

.room-card.disabled .room-card-price {
    color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 580px) {
    .rooms-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .room-card {
        padding: 8px 4px;
        min-height: 75px;
        border-radius: var(--radius-sm);
    }

    .room-card-header {
        gap: 2px;
    }

    .room-card-icon {
        font-size: 12px;
    }

    .room-card-title {
        font-size: 11px;
    }

    .room-card-status {
        font-size: 9px;
        margin-top: 2px;
    }

    .room-card-price {
        font-size: 11px;
        margin-top: 4px;
    }
}

