/* Kinolog LIFE — lead modal (desktop card + mobile bottom sheet) */

#kl-lead-modal {
  --kl-espresso: #2a2119;
  --kl-brown: #7a5c44;
  --kl-brown-hover: #634a36;
  --kl-gold: #c9a56a;
  --kl-cream: #faf6f0;
  --kl-paper: #fffcf8;
  --kl-muted: #7d7166;
  --kl-line: rgba(42, 33, 25, 0.1);
  font-family: Manrope, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#kl-lead-modal[hidden] {
  display: none !important;
}

#kl-lead-modal:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
}

#kl-lead-modal .kl-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(20, 16, 12, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: klFadeIn 0.3s ease;
}

#kl-lead-modal .kl-dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(700px, calc(100vh - 2.5rem));
  max-height: min(700px, calc(100dvh - 2.5rem));
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
  border-radius: 28px;
  background: var(--kl-paper);
  box-shadow:
    0 40px 100px rgba(20, 16, 12, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  animation: klPopIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes klFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes klPopIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes klSheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

#kl-lead-modal .kl-handle {
  display: none;
}

#kl-lead-modal .kl-visual {
  position: relative;
  min-height: 100%;
  background: #e8dfd3 center / cover no-repeat;
  color: var(--kl-paper);
}

#kl-lead-modal .kl-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 16, 12, 0.08) 0%, rgba(20, 16, 12, 0.72) 100%);
}

#kl-lead-modal .kl-visual-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem 1.85rem;
}

#kl-lead-modal .kl-visual-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  margin-bottom: auto;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.16);
  border: 1px solid rgba(255, 252, 248, 0.22);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

#kl-lead-modal .kl-visual-quote {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 600;
  line-height: 1.2;
  max-width: 16rem;
}

#kl-lead-modal .kl-visual-note {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  opacity: 0.85;
  line-height: 1.45;
  max-width: 18rem;
}

#kl-lead-modal .kl-body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  padding: 1.85rem 1.75rem 1.65rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--kl-paper);
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

#kl-lead-modal .kl-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

#kl-lead-modal .kl-panel form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

#kl-lead-modal .kl-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--kl-cream);
  color: var(--kl-espresso);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 0;
}

#kl-lead-modal .kl-close:hover {
  transform: scale(1.05);
  background: #f0e8dc;
}

#kl-lead-modal .kl-brand {
  margin: 0 0 0.55rem;
  padding-right: 2.5rem;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--kl-gold);
  font-weight: 800;
}

#kl-lead-modal .kl-title {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.55rem, 2.8vw, 2rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--kl-espresso);
  max-width: 24rem;
  padding-right: 1.75rem;
}

#kl-lead-modal .kl-lead {
  margin: 0.65rem 0 1.15rem;
  color: var(--kl-muted);
  font-size: 0.86rem;
  line-height: 1.55;
  max-width: 24rem;
}

#kl-lead-modal .kl-perks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 1.25rem;
}

#kl-lead-modal .kl-perk {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: var(--kl-cream);
  border: 1px solid var(--kl-line);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--kl-brown);
}

#kl-lead-modal .kl-perk-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--kl-gold);
  flex-shrink: 0;
}

#kl-lead-modal .kl-tabs {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.15rem;
  padding-top: 0.15rem;
  border-bottom: 1px solid var(--kl-line);
}

#kl-lead-modal .kl-tab {
  border: 0;
  background: none;
  padding: 0 0 0.8rem;
  margin-bottom: -1px;
  color: var(--kl-muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

#kl-lead-modal .kl-tab.active {
  color: var(--kl-espresso);
  border-bottom-color: var(--kl-brown);
}

#kl-lead-modal .kl-panel[hidden] {
  display: none !important;
}

#kl-lead-modal .kl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}

#kl-lead-modal .kl-grid .kl-field-full {
  grid-column: 1 / -1;
}

#kl-lead-modal .kl-field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6a5f54;
}

#kl-lead-modal .kl-field input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(42, 33, 25, 0.14);
  border-radius: 14px;
  padding: 0.88rem 1rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  background: #fff;
  color: var(--kl-espresso);
  transition: border-color 0.2s, box-shadow 0.2s;
}

#kl-lead-modal .kl-field input::placeholder {
  color: #b0a498;
  font-weight: 400;
}

#kl-lead-modal .kl-field input:focus {
  outline: none;
  border-color: rgba(122, 92, 68, 0.45);
  box-shadow: 0 0 0 4px rgba(201, 165, 106, 0.18);
}

#kl-lead-modal .kl-submit {
  width: 100%;
  margin-top: 0.4rem;
  margin-bottom: 0;
  border: 0;
  border-radius: 14px;
  padding: 0.95rem 1.15rem;
  background: linear-gradient(135deg, #8a684f 0%, #6f5340 100%);
  color: var(--kl-paper);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(111, 83, 64, 0.22);
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  box-sizing: border-box;
}

#kl-lead-modal .kl-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(111, 83, 64, 0.28);
}

#kl-lead-modal .kl-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

#kl-lead-modal .kl-error {
  margin: 0 0 0.65rem;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  background: rgba(180, 35, 24, 0.07);
  color: #b42318;
  font-size: 0.82rem;
}

#kl-lead-modal .kl-foot {
  margin: 0.75rem 0 0.15rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--kl-muted);
  flex-shrink: 0;
}

#kl-lead-modal .kl-foot button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--kl-brown);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

#kl-lead-modal .kl-req {
  color: #b42318;
  font-weight: 700;
}

#kl-lead-modal .kl-pending {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.25rem 0 0.5rem;
}

#kl-lead-modal .kl-pending-title {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--kl-espresso);
}

#kl-lead-modal .kl-pending-text {
  margin: 0;
  color: var(--kl-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

#kl-lead-modal .kl-stub {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.5rem 0 0.25rem;
}

#kl-lead-modal .kl-stub-title {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--kl-espresso);
}

#kl-lead-modal .kl-stub-text {
  margin: 0 0 0.35rem;
  color: var(--kl-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

#kinolog-lk-auth-bar {
  display: none !important;
}

/* ==== Auth nav in Tilda header (legacy) ==== */

.kl-auth-nav {
  position: absolute;
  z-index: 6;
  top: 43px;
  left: calc(50% - 600px + 1104px);
  transform: translateX(-100%);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: Manrope, system-ui, sans-serif;
  pointer-events: auto;
}

.kl-auth-nav .kl-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  pointer-events: auto;
  height: 44px;
  padding: 0 21px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.kl-auth-nav .kl-auth-btn--ghost {
  color: #6f5340 !important;
  background: rgba(255, 252, 248, 0.88);
  border: 1px solid rgba(111, 83, 64, 0.24);
  box-shadow: 0 6px 16px rgba(42, 33, 25, 0.12);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.kl-auth-nav .kl-auth-btn--ghost:hover {
  color: #4b3729 !important;
  background: #fffcf8;
  transform: translateY(-1px);
}

.kl-auth-nav .kl-auth-btn--solid {
  color: #fffcf8 !important;
  background: linear-gradient(135deg, #8a684f 0%, #6f5340 100%);
  border: 1px solid rgba(79, 58, 43, 0.55);
  box-shadow: 0 8px 18px rgba(111, 83, 64, 0.3);
}

.kl-auth-nav .kl-auth-btn--solid:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 24px rgba(111, 83, 64, 0.36);
}

.kl-auth-nav .kl-auth-short {
  display: none;
}

@media screen and (max-width: 1199px) {
  .kl-auth-nav {
    top: 35px;
    left: calc(50% - 320px + 567px);
    gap: 8px;
  }

  .kl-auth-nav .kl-auth-btn {
    height: 40px;
    padding: 0 17px;
    font-size: 12px;
  }
}

@media screen and (max-width: 639px) {
  .kl-auth-nav {
    top: 19px;
    left: calc(50% - 160px + 260px);
    gap: 6px;
  }

  .kl-auth-nav .kl-auth-btn {
    height: 32px;
    padding: 0 13px;
    font-size: 11px;
    letter-spacing: 0;
    box-shadow: 0 4px 12px rgba(42, 33, 25, 0.14);
  }

  .kl-auth-nav .kl-auth-btn--register {
    display: none;
  }

  .kl-auth-nav .kl-auth-full {
    display: none;
  }

  .kl-auth-nav .kl-auth-short {
    display: inline;
  }
}

.t450__list_item.kl-menu-auth {
  margin-top: 10px !important;
}

.t450__list_item.kl-menu-auth--first {
  margin-top: 20px !important;
  padding-top: 20px !important;
  border-top: 1px solid rgba(42, 33, 25, 0.12);
}

.t450__list_item.kl-menu-auth > a[data-kl-menu-auth] {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  padding: 13px 18px !important;
  border-radius: 999px !important;
  font-family: Manrope, system-ui, sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-align: center !important;
  text-decoration: none !important;
}

.t450__list_item.kl-menu-auth > a[data-kl-menu-auth="login"] {
  color: #6f5340 !important;
  background: rgba(255, 252, 248, 0.92) !important;
  border: 1px solid rgba(111, 83, 64, 0.26) !important;
}

.t450__list_item.kl-menu-auth > a[data-kl-menu-auth="register"] {
  color: #fffcf8 !important;
  background: linear-gradient(135deg, #8a684f 0%, #6f5340 100%) !important;
  border: 1px solid rgba(79, 58, 43, 0.55) !important;
  box-shadow: 0 8px 18px rgba(111, 83, 64, 0.24);
}

/* ==== Mobile / tablet: bottom sheet ==== */

@media (max-width: 900px) {
  #kl-lead-modal:not([hidden]) {
    align-items: flex-end;
    justify-content: stretch;
    padding: 0;
  }

  #kl-lead-modal .kl-dialog {
    width: 100% !important;
    max-width: 100% !important;
    max-height: min(92dvh, 100%) !important;
    margin: 0 !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    border-radius: 22px 22px 0 0 !important;
    grid-template-columns: 1fr !important;
    animation: klSheetUp 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 -12px 40px rgba(20, 16, 12, 0.28);
  }

  #kl-lead-modal .kl-handle {
    display: block;
    width: 42px;
    height: 4px;
    margin: 0.55rem auto 0.15rem;
    border-radius: 999px;
    background: rgba(42, 33, 25, 0.18);
    flex-shrink: 0;
  }

  #kl-lead-modal .kl-visual {
    display: none !important;
  }

  #kl-lead-modal .kl-body {
    border-radius: 0;
    clip-path: none !important;
    padding: 0.35rem 1.15rem calc(1rem + env(safe-area-inset-bottom, 0px));
    max-height: none;
    overflow-y: auto;
  }

  #kl-lead-modal .kl-close {
    top: 0.55rem;
    right: 0.75rem;
    width: 34px;
    height: 34px;
    font-size: 1.25rem;
    background: rgba(250, 246, 240, 0.95);
  }

  #kl-lead-modal .kl-brand {
    margin: 0.15rem 0 0.35rem;
    font-size: 0.62rem;
  }

  #kl-lead-modal .kl-title {
    font-size: 1.4rem;
    padding-right: 2.4rem;
    max-width: none;
  }

  #kl-lead-modal .kl-lead {
    margin: 0.4rem 0 0.85rem;
    font-size: 0.84rem;
    max-width: none;
  }

  #kl-lead-modal .kl-perks {
    display: none;
  }

  #kl-lead-modal .kl-tabs {
    gap: 1.25rem;
    margin-bottom: 0.9rem;
  }

  #kl-lead-modal .kl-tab {
    font-size: 0.92rem;
    padding-bottom: 0.7rem;
  }

  #kl-lead-modal .kl-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  #kl-lead-modal .kl-field {
    margin-bottom: 0.65rem;
  }

  #kl-lead-modal .kl-field input {
    font-size: 16px;
    padding: 0.82rem 0.9rem;
    border-radius: 12px;
  }

  #kl-lead-modal .kl-submit {
    margin-top: 0.55rem;
    padding: 0.95rem 1rem;
    font-size: 0.95rem;
    border-radius: 12px;
  }

  #kl-lead-modal .kl-foot {
    margin-top: 0.85rem;
    padding-bottom: 0.25rem;
  }
}

@media (max-width: 380px) {
  #kl-lead-modal .kl-title {
    font-size: 1.28rem;
  }

  #kl-lead-modal .kl-body {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Пока наша модалка открыта — прячем тильда-попапы, чтобы не наезжали */
body.kl-lead-open .t-popup,
body.kl-lead-open .t-popup_show,
body.kl-lead-open [class*="t-popup"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.kl-lead-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}
