/* Kinolog LIFE — premium lead modal */

#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 .kl-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999998;
  background: rgba(20, 16, 12, 0.62);
  backdrop-filter: blur(10px);
  animation: klFadeIn 0.35s ease;
}

#kl-lead-modal .kl-dialog {
  position: fixed;
  z-index: 999999;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100vw - 1.5rem));
  max-height: min(700px, calc(100vh - 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: klSlideUp 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes klFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes klSlideUp {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 18px)) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

#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);
  border-radius: 0 28px 28px 0;
  clip-path: inset(0 round 0 28px 28px 0);
  box-sizing: border-box;
}

#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-panel .kl-grid,
#kl-lead-modal .kl-panel > .kl-field {
  flex: 0 0 auto;
}

#kl-lead-modal .kl-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--kl-cream);
  color: var(--kl-espresso);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  z-index: 2;
}

#kl-lead-modal .kl-close:hover {
  transform: scale(1.05);
  background: #f0e8dc;
}

#kl-lead-modal .kl-brand {
  margin: 0 0 0.65rem;
  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.5rem;
}

#kl-lead-modal .kl-lead {
  margin: 0.75rem 0 1.35rem;
  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.5rem;
}

#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);
}

#kl-lead-modal .kl-tabs {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.35rem;
  padding-top: 0.15rem;
  border-bottom: 1px solid var(--kl-line);
}

#kl-lead-modal .kl-tab {
  border: 0;
  background: none;
  padding: 0 0 0.85rem;
  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.5rem;
  margin-bottom: 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6a5f54;
}

#kl-lead-modal .kl-field input {
  width: 100%;
  border: 1px solid rgba(42, 33, 25, 0.14);
  border-radius: 14px;
  padding: 0.92rem 1.05rem;
  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.65rem;
  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.84rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  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;
}

#kinolog-lk-auth-bar {
  display: none !important;
}

body.kl-lead-ready a[href="/lk/login"]:not(#kl-lead-modal a),
body.kl-lead-ready a[href="/lk/register"]:not(#kl-lead-modal a) {
  display: none !important;
}

@media (max-width: 820px) {
  #kl-lead-modal .kl-dialog {
    grid-template-columns: 1fr;
    width: min(440px, calc(100vw - 1rem));
    max-height: calc(100vh - 1rem);
  }

  #kl-lead-modal .kl-visual {
    min-height: 160px;
  }

  #kl-lead-modal .kl-visual-inner {
    padding: 1.1rem 1.25rem;
  }

  #kl-lead-modal .kl-visual-quote {
    font-size: 1.25rem;
  }

  #kl-lead-modal .kl-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  #kl-lead-modal .kl-dialog {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-height: 94vh;
    border-radius: 24px 24px 0 0;
    animation: klSheetUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  }

  @keyframes klSlideUp {
    from { opacity: 0; transform: translate(-50%, calc(-50% + 18px)) scale(0.98); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  }

  @keyframes klSheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  #kl-lead-modal .kl-body {
    border-radius: 0 0 0 0;
    clip-path: none;
    padding: 1.65rem 1.35rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }
}
