:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-alt: #efece4;
  --forest: #172720;
  --forest-light: #243b31;
  --accent: #d4743b;
  --accent-hover: #be6029;
  --text: #1c2420;
  --text-muted: #5d6a63;
  --border: #e0dcd1;
  --avail-bg: #eef7f1;
  --avail-border: #b9dec6;
  --avail-text: #1b6535;
  --busy-bg: #f5f2ec;
  --busy-text: #aba599;
  --selected-bg: #172720;
  --selected-text: #ffffff;
  --range-bg: #dcebe3;
  --radius: 16px;
  --shadow: 0 12px 32px rgba(23, 39, 32, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--forest);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-badge {
  background: var(--forest);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--accent);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-forest {
  background: var(--forest);
  color: #fff;
}

.btn-forest:hover {
  background: var(--forest-light);
}

.btn-outline {
  background: transparent;
  color: var(--forest);
  border: 1.5px solid var(--forest);
}

.btn-outline:hover {
  background: var(--forest);
  color: #fff;
}

.btn-max {
  background: #0077ff;
  color: #fff;
}

.btn-max:hover {
  background: #0062d6;
}

.btn-tg {
  background: #2aabee;
  color: #fff;
}

.btn-tg:hover {
  background: #1d96d6;
}

/* Hero */
.hero {
  position: relative;
  min-height: 82vh;
  display: flex;
  align-items: center;
  background-image: linear-gradient(105deg, rgba(17, 29, 24, 0.85) 0%, rgba(17, 29, 24, 0.55) 55%, rgba(17, 29, 24, 0.3) 100%), url('/static/images/hero.jpg');
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 64px 0;
}

.hero-content {
  max-width: 680px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}

.hero p {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 28px;
  max-width: 560px;
}

.hero-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.hero-spec {
  background: rgba(23, 39, 32, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-cta .btn {
  padding: 14px 26px;
  font-size: 1rem;
}

/* Sections */
.section {
  padding: 76px 0;
}

.section-alt {
  background: var(--surface-alt);
}

.section-header {
  text-align: center;
  max-width: 660px;
  margin: 0 auto 44px;
}

.section-header h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  font-weight: 800;
  color: var(--forest);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Booking Section */
.booking-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: start;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.calendar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.calendar-month-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--forest);
}

.cal-nav-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--forest);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.cal-nav-btn:hover {
  background: var(--forest);
  color: #fff;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-day {
  min-height: 62px;
  border-radius: 10px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid transparent;
  transition: all 0.15s;
  user-select: none;
}

.cal-day.empty {
  background: transparent;
}

.cal-day.available {
  background: var(--avail-bg);
  border-color: var(--avail-border);
  color: var(--avail-text);
  cursor: pointer;
}

.cal-day.available:hover {
  border-color: var(--forest);
  transform: translateY(-1px);
}

.cal-day.busy {
  background: var(--busy-bg);
  color: var(--busy-text);
  cursor: not-allowed;
}

.cal-day.in-range {
  background: var(--range-bg);
  border-color: var(--forest);
  color: var(--forest);
}

.cal-day.selected {
  background: var(--selected-bg) !important;
  border-color: var(--selected-bg) !important;
  color: var(--selected-text) !important;
}

.cal-day-num {
  font-weight: 800;
  font-size: 0.95rem;
}

.cal-day-price {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.9;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.legend-dot.avail { background: var(--avail-bg); border: 1px solid var(--avail-border); }
.legend-dot.busy { background: var(--busy-bg); border: 1px solid #d7d2c6; }
.legend-dot.sel { background: var(--forest); }

/* Booking Form */
.booking-summary {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.booking-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.booking-summary-row:last-child {
  margin-bottom: 0;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--forest);
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--forest);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--forest);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 12px 0 18px;
  cursor: pointer;
}

.checkbox-label a {
  color: var(--forest);
}

.bot-sync-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.bot-sync-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.bot-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 14px;
  display: none;
}

.form-alert.success {
  display: block;
  background: #e6f6ec;
  color: #165e31;
  border: 1px solid #a9dfbe;
}

.form-alert.error {
  display: block;
  background: #fdecec;
  color: #9e2222;
  border: 1px solid #f4bebe;
}

/* House Cards */
.house-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.house-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.house-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.house-card-body {
  padding: 22px;
  flex: 1;
}

.house-card-body h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--forest);
  margin-bottom: 8px;
}

.house-card-body p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Video */
.video-wrap {
  max-width: 860px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #000;
  aspect-ratio: 16 / 9;
}

.video-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Amenities */
.amenities-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.amenity-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 16px;
  text-align: center;
  transition: transform 0.2s;
}

.amenity-card:hover {
  transform: translateY(-3px);
}

.amenity-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.amenity-card h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 4px;
}

.amenity-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-item {
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  border: 1px solid var(--border);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 13, 0.92);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 12px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 26px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Rules & Terms */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.rules-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rules-list li {
  position: relative;
  padding-left: 26px;
  font-size: 0.95rem;
  color: var(--text);
}

.rules-list li::before {
  position: absolute;
  left: 0;
  top: 0;
}

.rules-list.terms li::before { content: "•"; color: var(--accent); font-weight: 800; font-size: 1.2rem; line-height: 1.3; }
.rules-list.allowed li::before { content: "✔️"; font-size: 0.85rem; }
.rules-list.forbidden li::before { content: "✖️"; font-size: 0.85rem; }

@media (max-width: 960px) {
  .rules-grid {
    grid-template-columns: 1fr;
  }
}

/* Contacts & Footer */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.contact-card h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.contact-card p,
.contact-card a {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--forest);
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
}

.footer {
  background: var(--forest);
  color: rgba(255, 255, 255, 0.8);
  padding: 36px 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-links a {
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.12);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.2s;
}

.social-links a:hover {
  background: var(--accent);
}

@media (max-width: 960px) {
  .booking-grid,
  .house-grid,
  .contacts-grid {
    grid-template-columns: 1fr;
  }
  .amenities-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .nav {
    display: none;
  }
}

@media (max-width: 540px) {
  .form-row,
  .bot-buttons,
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .cal-day {
    min-height: 52px;
    padding: 4px 2px;
  }
  .cal-day-price {
    font-size: 0.65rem;
  }
}
