:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a8a;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --green: #16a34a;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(30, 64, 175, 0.08);
  --shadow-lg: 0 20px 50px rgba(30, 64, 175, 0.15);
  --font: 'DM Sans', system-ui, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.6;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--gray-900);
  font-weight: 700;
  font-size: 1.25rem;
}

.logo__icon {
  font-size: 1.5rem;
}

.logo__accent {
  color: var(--blue-600);
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  text-decoration: none;
  color: var(--gray-600);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--blue-600);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn--primary {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
  color: var(--white);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn--primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--outline {
  background: transparent;
  border: 2px solid var(--blue-600);
  color: var(--blue-600);
}

.btn--outline:hover {
  background: var(--blue-50);
}

.btn--ghost {
  background: var(--gray-100);
  color: var(--gray-700);
}

.btn--ghost:hover {
  background: var(--gray-200);
}

.btn--sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn--lg {
  padding: 1rem 2rem;
  font-size: 1.05rem;
}

.btn--pay {
  min-width: 180px;
}

/* Hero */
.hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(30, 64, 175, 0.85) 0%, rgba(37, 99, 235, 0.7) 50%, rgba(59, 130, 246, 0.6) 100%),
    url('https://images.unsplash.com/photo-1555990793-da95953fa382?w=1600&q=80') center/cover;
}

.hero__content {
  position: relative;
  z-index: 1;
  color: var(--white);
  padding: 4rem 1.25rem;
  max-width: 720px;
}

.badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.95;
  margin-bottom: 2rem;
}

.hero__search {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 0.75rem;
  background: var(--white);
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.search-field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  margin-bottom: 0.25rem;
}

.search-field input,
.search-field select {
  width: 100%;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--gray-800);
  background: transparent;
  outline: none;
}

.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Sections */
.section {
  padding: 5rem 0;
}

.section--alt {
  background: var(--blue-50);
}

.section__header {
  text-align: center;
  margin-bottom: 3rem;
}

.section__header h2 {
  font-size: 2rem;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.section__header p {
  color: var(--gray-500);
  font-size: 1.05rem;
}

/* Apartments */
.apartments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

.apartment-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  transition: transform 0.25s, box-shadow 0.25s;
}

.apartment-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.apartment-card__img {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.apartment-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.apartment-card:hover .apartment-card__img img {
  transform: scale(1.05);
}

.apartment-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--blue-600);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
}

.apartment-card__body {
  padding: 1.25rem;
}

.apartment-card__location {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 0.35rem;
}

.apartment-card h3 {
  font-size: 1.15rem;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.apartment-card__features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-bottom: 1rem;
}

.apartment-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-100);
}

.apartment-card__price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue-700);
}

.apartment-card__price span {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--gray-500);
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.step {
  text-align: center;
  padding: 1.5rem;
}

.step__num {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 auto 1rem;
}

.step h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--gray-900);
}

.step p {
  font-size: 0.9rem;
  color: var(--gray-500);
}

/* CTA */
.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  background: linear-gradient(135deg, var(--blue-700), var(--blue-900));
  color: white;
  padding: 3rem;
  border-radius: var(--radius-lg);
}

.cta h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.cta p {
  opacity: 0.9;
}

/* Footer */
.footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: 3rem 0 2rem;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.footer__brand .logo__text {
  color: white;
  font-weight: 700;
  font-size: 1.15rem;
}

.footer__brand p {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.footer__links {
  display: flex;
  gap: 1.5rem;
}

.footer__links a {
  color: var(--gray-400);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer__links a:hover {
  color: white;
}

.footer__demo {
  width: 100%;
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  opacity: 0.6;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

.modal__dialog {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s;
}

.modal.open .modal__dialog {
  transform: translateY(0);
}

.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--gray-100);
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--gray-600);
  z-index: 1;
}

.modal__close:hover {
  background: var(--gray-200);
}

.modal__header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-right: 2rem;
}

.modal__thumb {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  object-fit: cover;
}

.modal__header h2 {
  font-size: 1.15rem;
  color: var(--gray-900);
}

.modal__location {
  font-size: 0.85rem;
  color: var(--gray-500);
}

.modal__price {
  font-weight: 700;
  color: var(--blue-600);
  margin-top: 0.25rem;
}

/* Booking steps indicator */
.booking-steps {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.booking-step {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-400);
  background: var(--gray-100);
  border-radius: 8px;
  transition: all 0.2s;
}

.booking-step.active {
  background: var(--blue-600);
  color: white;
}

.booking-step.done {
  background: var(--blue-100);
  color: var(--blue-700);
}

.booking-panel {
  display: none;
}

.booking-panel.active {
  display: block;
}

/* Calendar */
.calendar-wrap {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.calendar-header h3 {
  font-size: 1rem;
  color: var(--gray-900);
}

.cal-nav {
  width: 36px;
  height: 36px;
  border: 1px solid var(--gray-200);
  background: white;
  border-radius: 8px;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--blue-600);
}

.cal-nav:hover {
  background: var(--blue-50);
  border-color: var(--blue-200);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: 0.5rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
  color: var(--gray-800);
  transition: all 0.15s;
}

.cal-day:hover:not(:disabled):not(.empty) {
  background: var(--blue-50);
}

.cal-day.empty {
  cursor: default;
}

.cal-day.disabled {
  color: var(--gray-300);
  cursor: not-allowed;
  text-decoration: line-through;
}

.cal-day.booked {
  background: var(--gray-100);
  color: var(--gray-400);
  cursor: not-allowed;
}

.cal-day.in-range {
  background: var(--blue-100);
  color: var(--blue-800);
}

.cal-day.check-in,
.cal-day.check-out {
  background: var(--blue-600);
  color: white;
  font-weight: 600;
}

.date-summary {
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.date-summary strong {
  color: var(--blue-700);
}

/* Forms */
.form-row {
  margin-bottom: 1rem;
}

.form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.35rem;
}

.form-row input,
.form-row select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-row--half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.panel-actions {
  margin-top: 1.25rem;
}

.panel-actions--split {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.panel-actions--split .btn {
  flex: 1;
}

/* Payment */
.payment-notice {
  display: flex;
  gap: 1rem;
  background: linear-gradient(135deg, var(--blue-50), var(--blue-100));
  border: 1px solid var(--blue-200);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.payment-notice__icon {
  font-size: 1.5rem;
}

.payment-notice strong {
  display: block;
  color: var(--blue-800);
  margin-bottom: 0.25rem;
}

.payment-notice p {
  font-size: 0.85rem;
  color: var(--gray-600);
}

.order-summary {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

.order-summary .row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.order-summary .total {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--blue-700);
  padding-top: 0.5rem;
  border-top: 1px solid var(--gray-200);
  margin-top: 0.5rem;
}

.card-brands {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-400);
  margin-bottom: 0.5rem;
}

/* Success */
.success {
  text-align: center;
  padding: 2rem 1rem;
}

.success__icon {
  width: 72px;
  height: 72px;
  background: var(--green);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 auto 1.25rem;
}

.success h3 {
  font-size: 1.5rem;
  color: var(--gray-900);
  margin-bottom: 0.75rem;
}

.success__ref {
  margin: 1rem 0 1.5rem;
  color: var(--gray-600);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner.hidden {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 900px) {
  .nav {
    display: none;
  }

  .hero__search {
    grid-template-columns: 1fr 1fr;
  }

  .hero__search .btn {
    grid-column: 1 / -1;
  }

  .steps {
    grid-template-columns: 1fr 1fr;
  }

  .cta {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .steps {
    grid-template-columns: 1fr;
  }

  .hero__search {
    grid-template-columns: 1fr;
  }

  .apartments-grid {
    grid-template-columns: 1fr;
  }
}
