/* Lofty Front 留资组件样式（弹窗 + 内嵌表单 + 提示条 + 头部 Sign In 隐藏）。
   移植自 blaze-frontend 的 CompareCostModal / BlazeCompareForm / LeadConsent / Toast，
   配色按 UI 新版（对齐官网 svc-* 组件库的主题蓝）。
   自带设计令牌，挂在组件根 .lf-lead 上，不依赖宿主页面的容器或变量，对比页和服务页通用。
   刻意不用 `.lf-lead *` 通配重置，只重置组件自己的元素，免得把宿主页的 .module-wrap 等布局类冲掉。 */

/* ============ 头部：隐藏 Sign In，保留 Request a Demo ============
   页面放了弹窗（.lf-lead-overlay）才生效，不改全局 header。
   !important 是因为 header.js 会按登录态用 jQuery .show()/.hide() 写内联 display。
   第二条是移动端菜单底部的 Login：同组里只有 Request a Demo 带 data-click-event-handler，
   按这个区分，不依赖后台配置的元素 id。已登录时的头像菜单（.mh-account）保留。
   Request a Demo 的点击改由 index.js 接管。 */
body:has(.lf-lead-overlay) .mp-header .mh-login-wrap,
body:has(.lf-lead-overlay) .mp-header .mh-rad-wrap a.md-button:not([data-click-event-handler]) {
  display: none !important;
}

/* ============ 设计令牌 ============ */
.lf-lead {
  --lf-accent: #3b5cde;        /* 官网主题蓝 */
  --lf-accent-light: #4f6ce1;  /* 悬停 */
  --lf-accent-soft: #eef1ff;
  --lf-text: #1A1622;
  --lf-text-dim: #4B4754;
  --lf-text-muted: #6C6775;
  --lf-border: #E7E8EC;
  --lf-error: #E5484D;
  font-family: 'Manrope', 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--lf-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.lf-lead h2, .lf-lead p, .lf-lead figure, .lf-lead form { margin: 0; padding: 0; }
.lf-lead input, .lf-lead button { box-sizing: border-box; font-family: inherit; }
.lf-lead a { text-decoration: none; }
.lf-lead .lf-lead-wrap { width: 90%; max-width: 1280px; margin: 0 auto; }

/* ============ 留资同意声明（LeadConsent） ============ */
.lf-lead .lf-lead-consent {
  margin: 10px 0 12px; color: #6B6B7B;
  font-size: 12px; line-height: 1.55; text-align: left;
}
.lf-lead .lf-lead-consent a { color: var(--lf-accent); font-weight: 600; }
.lf-lead .lf-lead-consent a:hover, .lf-lead .lf-lead-consent a:focus-visible { text-decoration: underline; text-underline-offset: 2px; }

/* ============ 内嵌表单（BlazeCompareForm） ============ */
.lf-lead.lf-lead-form-section { padding: 64px 0; background: #FFFFFF; }
.lf-lead .cmp-form-grid { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.lf-lead .cmp-form-card { background: #FFFFFF; border-radius: 24px; padding: clamp(26px, 3vw, 38px); box-shadow: 0 30px 64px -28px rgba(46, 35, 72, .22); }
.lf-lead .cmp-form-card h2 { font-family: 'Manrope', sans-serif; font-size: clamp(24px, 2.6vw, 32px); font-weight: 600; letter-spacing: -.035em; line-height: 1.12; color: var(--lf-text); text-align: center; }
.lf-lead .cmp-form-kicker { margin-top: 8px; text-align: center; font-family: 'JetBrains Mono', ui-monospace, monospace; text-transform: uppercase; letter-spacing: .14em; font-size: 11.5px; font-weight: 600; color: var(--lf-accent); }
.lf-lead .cmp-form-sub { margin: 12px auto 0; max-width: 42ch; text-align: center; font-size: 14.5px; line-height: 1.6; color: var(--lf-text-dim); }
.lf-lead .cmp-form-card h2 + .cmp-field,
.lf-lead .cmp-form-kicker + .cmp-field,
.lf-lead .cmp-form-sub + .cmp-field { margin-top: 22px; }
.lf-lead .cmp-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.lf-lead .cmp-field { margin-bottom: 12px; }
.lf-lead .cmp-field input { width: 100%; height: 50px; padding: 0 16px; border: 1.5px solid var(--lf-border); border-radius: 10px; font-size: 15px; color: var(--lf-text); background: #fff; transition: border-color .15s, box-shadow .15s; }
.lf-lead .cmp-field input::placeholder { color: #8B8795; }
.lf-lead .cmp-field input:focus { outline: none; border-color: var(--lf-accent); box-shadow: 0 0 0 3px rgba(59, 92, 222, .12); }
.lf-lead .cmp-field input.error { border-color: #D0453B; }
.lf-lead .cmp-field-error { margin-top: 5px; font-size: 12px; color: #D0453B; }
.lf-lead .cmp-form-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 44px; margin-top: 4px; padding: 12px 36px;
  border: none; border-radius: 25px; cursor: pointer;
  font-size: 16px; font-weight: 600; line-height: 1.2;
  background: var(--lf-accent); color: #fff;
  box-shadow: 0 6px 18px rgba(59, 92, 222, .28);
  transition: background .25s ease;
}
.lf-lead .cmp-form-submit:hover { background: var(--lf-accent-light); }
.lf-lead .cmp-form-submit svg { display: inline-block; flex: 0 0 auto; width: 16px; height: 16px; }
.lf-lead .cmp-form-submit[disabled] { opacity: .6; cursor: not-allowed; }
.lf-lead .cmp-form-safe { margin-top: 12px; text-align: center; font-size: 12px; color: var(--lf-text-dim); }
.lf-lead .cmp-form-shot img { width: 100%; height: auto; display: block; }

/* ============ 留资弹窗（CompareCostModal + LeadModalShell） ============ */
.lf-lead.lf-lead-overlay {
  position: fixed; inset: 0; z-index: 10000;
  display: none; padding: 32px; overflow-y: auto;
  background: rgba(20, 16, 32, 0.74);
  backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .25s ease;
}
.lf-lead.lf-lead-overlay.is-visible { display: flex; }
.lf-lead.lf-lead-overlay.is-shown { opacity: 1; }
.lf-lead.lf-lead-overlay > * { margin: auto; }
body.lead-modal-open { overflow: hidden; }

.lf-lead .ccm-card {
  position: relative;
  width: min(440px, 100%);
  background: #FFFFFF;
  border-radius: 20px;
  padding: 32px 32px 26px;
  box-shadow: 0 40px 90px rgba(20, 10, 45, 0.35);
}
.lf-lead .ccm-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--lf-text-muted);
  font-size: 14px; line-height: 1; cursor: pointer;
}
/* 静止态保持灰色，只在悬停时染主题蓝（blaze-frontend 1616b47） */
.lf-lead .ccm-close:hover { background: #EBEFFC; color: var(--lf-accent); }
.lf-lead .ccm-card h2 { font-size: 21px; font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; margin: 0 0 8px; color: var(--lf-text); }
.lf-lead .ccm-lead { font-size: 13.5px; line-height: 1.55; color: var(--lf-text-muted); margin: 0 0 20px; }
.lf-lead .ccm-field { margin-bottom: 14px; }
.lf-lead .ccm-field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--lf-text); }
.lf-lead .ccm-input {
  width: 100%; height: auto;
  border: 1px solid var(--lf-border); border-radius: 11px;
  padding: 12px 14px; font-size: 14px; color: var(--lf-text);
  background: #fff; outline: none;
}
.lf-lead .ccm-input:focus { border-color: var(--lf-accent); }
.lf-lead .ccm-input.error { border-color: var(--lf-error); }
.lf-lead .ccm-field-err { font-size: 12px; font-weight: 500; line-height: 1.4; color: var(--lf-error); margin: 4px 0 0; }
.lf-lead .ccm-submit {
  width: 100%; margin-top: 4px;
  border: 0; border-radius: 999px; padding: 14px 24px;
  background: var(--lf-accent); color: #fff;
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.lf-lead .ccm-submit:hover { background: var(--lf-accent-light); }
.lf-lead .ccm-submit:disabled { opacity: 0.6; cursor: default; }

/* ============ 提交结果提示（Front 的 Toast，top-center） ============ */
.lf-lead-toast {
  position: fixed; top: 24px; left: 50%; z-index: 10001;
  transform: translate(-50%, -8px); opacity: 0;
  max-width: calc(100% - 32px);
  padding: 12px 20px; border-radius: 12px;
  font-family: 'Manrope', -apple-system, sans-serif; font-size: 14px; font-weight: 600; line-height: 1.45;
  color: #fff; background: #1A1622;
  box-shadow: 0 12px 32px rgba(20, 16, 32, .25);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.lf-lead-toast.is-success { background: #2E8B57; }
.lf-lead-toast.is-error { background: #E5484D; }
.lf-lead-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ============ responsive ============ */
@media (max-width: 900px) {
  .lf-lead.lf-lead-form-section { padding: 48px 0; }
  .lf-lead .cmp-form-grid { grid-template-columns: 1fr; }
  /* 单列时配图放到表单之前：先给一眼成品，再要联系方式 */
  .lf-lead .cmp-form-shot { order: -1; max-width: 460px; margin: 0 auto; }
  /* 16px 是硬性下限：iOS Safari 对更小的输入框会在聚焦时自动放大整页 */
  .lf-lead .cmp-field input, .lf-lead .ccm-input { font-size: 16px; }
}

@media (max-width: 760px) {
  .lf-lead.lf-lead-overlay { padding: 16px; }
}

@media (max-width: 560px) {
  .lf-lead.lf-lead-overlay {
    padding: 12px; height: 100dvh;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .lf-lead .ccm-card { padding: 28px 22px 22px; border-radius: 18px; }
}
