/* Pension landing — faithful Figma port */
:root { background: #0e1730; }

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

html, body {
  margin: 0;
  padding: 0;
  background: #0e1730;
}

/* Figma file uses Manrope everywhere; the generated classes carry a broken
   family name ("Manrope:Regular"), so force the real family but keep weights. */
.canvas, .canvas * {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif !important;
  box-sizing: border-box;
}

/* A "canvas" is a fixed-width design surface scaled to the viewport by JS. */
.canvas {
  position: relative;
  transform-origin: top left;
  margin: 0 auto;
}

#desktop { width: 1600px; }
#mobile  { width: 360px; }

/* Each section reproduces a Figma frame: fixed size, clips overflow children. */
.fig-sec {
  position: relative;
  margin: 0 auto;
  background: #1f2e57;
}

/* default visibility; JS refines on resize */
#mobile { display: none; }

@media (max-width: 767px) {
  #desktop { display: none; }
  #mobile  { display: block; }
}

/* --- mask utilities shim (Tailwind v3 CDN lacks v4 mask-* utilities) --- */
[class*="mask-no-repeat"] { -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
[class*="mask-alpha"]     { -webkit-mask-mode: alpha; mask-mode: alpha; }

/* --- Checkout Modal Styles --- */
.checkout-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.checkout-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.checkout-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 18, 41, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.checkout-modal-content {
  position: relative;
  width: 92%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}

.checkout-modal.active .checkout-modal-content {
  transform: scale(1) translateY(0);
}

.checkout-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  padding: 0 0 2px 0;
  color: #112250;
  transition: background 0.2s, transform 0.2s;
  z-index: 10;
}

.checkout-modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.checkout-modal-close:active {
  transform: scale(0.95);
}

.checkout-modal-body {
  padding: 40px 16px 16px 16px;
  max-height: 93vh;
  overflow-y: auto;
}

.checkout-modal-title {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #112250;
  text-align: center;
  margin-bottom: 4px;
}

.checkout-modal-subtitle {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  color: #384e80;
  opacity: 0.8;
  text-align: center;
  margin-bottom: 16px;
}

.widget-container iframe {
  display: block;
  width: 100% !important;
  border: none;
  margin: 0;
  padding: 0;
}

/* ВАЖНО: форма виджета рендерится в <iframe> с домена monterium.ru.
   Её внутренние отступы (.lt-form padding:34px, .block-box padding:40/30) задаются
   ВНУТРИ айфрейма и из нашего CSS недоступны (cross-origin). Менять их нужно в
   настройках блока в админке monterium ("Стиль блока" / форм-бокс). Снаружи мы
   управляем только обёрткой .widget-container (ширина/высота айфрейма). */

/* Виджет ставит контейнеру фикс. высоту (~1175px) — снизу остаётся большой пустой
   хвост (плюс наш сдвиг вверх). Делаем контейнер по контенту и обрезаем низ
   отрицательным margin-bottom (высота viewport-а iframe не меняется, режется хвост). */
.widget-container {
  height: auto !important;
  overflow: hidden !important;
}
.widget-container iframe {
  margin-bottom: -110px !important;
}

/* На мобилке внутренний padding виджета (~40px с каждой стороны) съедает почти
   всю ширину. Дотянуться внутрь iframe нельзя, поэтому делаем iframe ШИРЕ
   контейнера и сдвигаем влево — лишние боковые поля уходят за край и обрезаются
   overflow:hidden. Контент виджета не трогаем, двигаем только сам <iframe>. */
@media (max-width: 767px) {
  .checkout-modal-content {
    width: 100%;
    max-width: 100%;
  }
  .checkout-modal-body {
    padding: 40px 0 8px 0;       /* убираем боковые поля модалки */
    max-height: 96vh;            /* выше окно — меньше скролла */
  }
  .widget-container {
    overflow: hidden !important; /* обрезаем вынесенные за край поля iframe */
  }
  .widget-container iframe {
    width: calc(100% + 110px) !important;  /* +55px с каждой стороны */
    margin-left: -55px !important;
    margin-top: -120px !important;         /* убираем пустоту сверху формы */
  }
}

/* Тот же приём для ПК: режем пустоту сверху И боковой внутренний padding,
   чтобы форма-блок был шире внутри окна. */
@media (min-width: 768px) {
  .widget-container {
    overflow: hidden !important;
  }
  .widget-container iframe {
    width: calc(100% + 72px) !important;  /* +36px с каждой стороны */
    margin-left: -36px !important;
    margin-top: -120px !important;
  }
}

/* Spinner */
.checkout-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.checkout-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(17, 34, 80, 0.1);
  border-top-color: #112250;
  border-radius: 50%;
  animation: checkout-spin 1s linear infinite;
}

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