/* ==========================================================================
   Free / trial / demo download form (ls-cutover-plugins-and-website W1a; mockup variant B, CEO 2026-11-26).
   One dialog per page, built by /src/js/download-form.js; bottom sheet at ≤ 640 px.
   Standalone file (no Tailwind build step). Tokens come from /src/css/lese-theme.css when the page loads it
   (--ink, --ink-2, --line, --dark, --display, --body), with fallbacks for the Tailwind pages.
   Per-product accent via --sdl-accent (set from the product when the dialog opens).
   ========================================================================== */
.sdl-root {
  --sdl-accent: #7e86ad;
  --sdl-ink: var(--ink, #1b242a);
  --sdl-ink-2: var(--ink-2, #58616c);
  --sdl-line: var(--line, #dde0ee);
  --sdl-dark: var(--dark, #182125);
  --sdl-err: #b3402f;
  --sdl-ok: #1a613f;
  font-family: var(--body, "Comfortaa", "Noto Sans TC", system-ui, sans-serif);
  color: var(--sdl-ink);
  text-align: left;
  line-height: 1.5;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
}
.sdl-root *, .sdl-root *::before, .sdl-root *::after { box-sizing: border-box; }
html[lang^="zh"] .sdl-root { font-family: "Noto Sans TC", "PingFang TC", var(--body, system-ui), sans-serif; }
html[lang^="ja"] .sdl-root { font-family: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", system-ui, sans-serif; }

/* ---------- card ---------- */
.sdl-card {
  container-type: inline-size;
  background: #fff;
  border: 1px solid var(--sdl-line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 24px 48px -34px rgba(27, 36, 42, .42);
}
.sdl-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sdl-cover { width: 52px; height: 65px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; border: 1px solid var(--sdl-line); background: #eef0f6; }
.sdl-head-text { flex: 1 1 auto; min-width: 0; }
.sdl-root .sdl-kicker { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--sdl-accent); letter-spacing: normal; text-transform: none; }
.sdl-root .sdl-title { margin: 0; font-family: var(--display, "MuseoModerno", "Noto Sans TC", system-ui, sans-serif) !important; font-weight: 700; font-size: 22px; line-height: 1.2; color: var(--sdl-ink); }
html[lang^="ja"] .sdl-root .sdl-title, html[lang^="ja"] .sdl-root .sdl-done-title { font-family: "Noto Sans JP", "Hiragino Sans", system-ui, sans-serif !important; }
.sdl-close {
  flex: 0 0 auto; align-self: flex-start; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--sdl-line);
  background: #fff; color: var(--sdl-ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.sdl-close:hover { color: var(--sdl-ink); border-color: #c5cadc; }
.sdl-close:focus-visible, .sdl-link:focus-visible, .sdl-consent a:focus-visible { outline: 2px solid var(--sdl-accent); outline-offset: 2px; }
.sdl-root .sdl-lede { text-wrap: pretty; margin: 0 0 16px; font-size: 14.5px; line-height: 1.6; color: var(--sdl-ink-2); }

/* ---------- field row ---------- */
.sdl-root .sdl-label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--sdl-ink); }
.sdl-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.sdl-row > .sdl-input { order: 1; flex: 1 1 0; }
.sdl-row > .sdl-submit { order: 2; }
.sdl-row > .sdl-field-err { order: 3; flex: 0 0 100%; }
.sdl-input {
  flex: 1 1 auto; min-width: 0; height: 48px; padding: 0 20px; border-radius: 999px; margin: 0;
  border: 1px solid #cdd2e2; background: #fff; color: var(--sdl-ink);
  font-family: var(--body-read, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif);
  font-size: 16px; /* 16px: no iOS zoom on focus */
  transition: border-color .15s ease, box-shadow .15s ease;
}
.sdl-input::placeholder { color: #9aa1b0; }
.sdl-input:focus { outline: none; border-color: var(--sdl-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sdl-accent) 20%, transparent); }
.sdl-input[aria-invalid="true"] { border-color: var(--sdl-err); box-shadow: 0 0 0 3px rgba(179, 64, 47, .12); }
.sdl-input[readonly] { background: #f6f7fb; color: var(--sdl-ink-2); }
.sdl-submit {
  flex: 0 0 auto; height: 48px; padding: 0 24px; border: 0; border-radius: 999px; cursor: pointer; margin: 0;
  background: var(--sdl-dark); color: #fff; white-space: nowrap;
  font-family: var(--display, "MuseoModerno", "Noto Sans TC", system-ui, sans-serif); font-weight: 600; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 14px 30px -16px rgba(24, 33, 37, .7);
  transition: transform .15s ease, opacity .15s ease;
}
html[lang^="zh"] .sdl-submit { font-family: "Noto Sans TC", "PingFang TC", system-ui, sans-serif; font-weight: 700; }
html[lang^="ja"] .sdl-submit { font-family: "Noto Sans JP", "Hiragino Sans", system-ui, sans-serif; font-weight: 700; }
.sdl-submit:hover:not(:disabled) { transform: translateY(-1px); }
.sdl-submit:focus-visible { outline: 2px solid var(--sdl-accent); outline-offset: 3px; }
.sdl-submit:disabled { cursor: progress; opacity: .78; }
.sdl-spin { display: none; width: 16px; height: 16px; }
.sdl-dialog[data-state="sending"] .sdl-spin { display: inline-block; animation: sdl-rot .8s linear infinite; }
@keyframes sdl-rot { to { transform: rotate(360deg); } }
.sdl-root .sdl-field-err { margin: 0 0 4px 20px; font-size: 13px; font-weight: 600; color: var(--sdl-err); }
/* narrow dialogs: stack input, error, button */
@container (max-width: 440px) {
  .sdl-row { flex-direction: column; flex-wrap: nowrap; }
  .sdl-row > .sdl-input { flex: 0 0 auto; }
  .sdl-submit { width: 100%; }
  .sdl-row > .sdl-field-err { order: 2; flex: 0 0 auto; }
  .sdl-row > .sdl-submit { order: 3; }
}

/* ---------- honeypot (off-screen, never focusable) ---------- */
.sdl-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none; }

/* ---------- subscription notice + privacy link (always visible, under the field) ---------- */
.sdl-root .sdl-consent { text-wrap: pretty; margin: 16px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--sdl-ink-2); }
.sdl-consent a { color: var(--sdl-ink); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- network error ---------- */
.sdl-net-err {
  display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; padding: 12px 16px; border-radius: 16px;
  background: #fdf1ee; border: 1px solid #f1cbc2; color: #8a2f20; font-size: 13.5px; line-height: 1.5;
}
.sdl-net-err span { text-wrap: pretty; }
.sdl-net-err svg { flex: 0 0 auto; margin-top: 2px; }

/* ---------- success ---------- */
.sdl-done { display: flex; gap: 16px; align-items: flex-start; }
.sdl-done-icon { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 999px; background: #e6f3ec; color: var(--sdl-ok); display: inline-flex; align-items: center; justify-content: center; }
.sdl-root .sdl-done-title { margin: 0 0 4px; font-family: var(--display, "MuseoModerno", "Noto Sans TC", system-ui, sans-serif) !important; font-size: 20px; font-weight: 700; color: var(--sdl-ink); }
.sdl-root .sdl-done-body { text-wrap: pretty; margin: 0; font-size: 14px; line-height: 1.6; color: var(--sdl-ink-2); overflow-wrap: anywhere; }
.sdl-done-body b { color: var(--sdl-ink); font-weight: 700; }
.sdl-link { margin-top: 12px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--sdl-ink); text-decoration: underline; text-underline-offset: 3px; }

.sdl-dialog [hidden] { display: none !important; }

/* ---------- overlay + dialog ---------- */
.sdl-overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(24, 33, 37, .46); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility 0s linear .2s;
}
.sdl-overlay[data-open="true"] { opacity: 1; visibility: visible; transition: opacity .2s ease; }
.sdl-dialog { width: 100%; max-width: 460px; max-height: calc(100vh - 48px); overflow: auto; padding: 24px; transform: translateY(12px); transition: transform .22s ease; }
.sdl-overlay[data-open="true"] .sdl-dialog { transform: none; }
.sdl-grab { display: none; }

/* ---------- phones: bottom sheet ---------- */
@media (max-width: 640px) {
  .sdl-row { flex-direction: column; flex-wrap: nowrap; }
  .sdl-row > .sdl-input { flex: 0 0 auto; }
  .sdl-row > .sdl-field-err { order: 2; flex: 0 0 auto; }
  .sdl-row > .sdl-submit { order: 3; width: 100%; }
  .sdl-overlay { align-items: flex-end; padding: 0; }
  .sdl-dialog { max-width: none; border-radius: 22px 22px 0 0; border-bottom: 0; max-height: 88vh; padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); transform: translateY(24px); }
  .sdl-grab { display: block; width: 40px; height: 4px; border-radius: 999px; background: #d5d9e6; margin: 0 auto 12px; }
  .sdl-root .sdl-title { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .sdl-overlay, .sdl-dialog { transition: none !important; }
  .sdl-dialog[data-state="sending"] .sdl-spin { animation: none; }
}
