/**
 * sinopak/lead-form block styles
 *
 * Default skin = React prototype .lead-form (src/styles.css): translucent
 * navy card for gradient/dark hosts (cta-plan, inquiry modal, FAQ form
 * card) — rounded per the site-wide card/input/CTA language (12/10px). Hosts that need the fields flat on their own gradient
 * strip the card with `.host .spk-x-lead-form { padding:0; border:0;
 * background:transparent }` — the field grid lives on the form element and
 * .spk-x-lead-form__grid is display:contents, so those overrides keep
 * working unchanged.
 *
 * Standalone use (direct child of the post content, e.g. the About/Service/
 * machine page tails) switches to the React .about-compact-inquiry /
 * .about-mini-form treatment: a full-bleed light band whose inner grid is
 * the white 3-column panel.
 */
@layer spk-block {
  .spk-x-lead-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: clamp(24px, 4vw, 46px);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 12px;
    background: rgba(2, 27, 61, 0.32);
  }

  .spk-x-lead-form__grid {
    display: contents;
  }

  .spk-x-lead-form__field {
    display: grid;
    gap: 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }
  .spk-x-lead-form__field--full {
    grid-column: 1 / -1;
  }

  /* 对齐原型 .lead-form input/select/textarea:字体走 reset 里的
     input{font:inherit},白底、细白描边;圆角对齐首页输入框语言(10px)。 */
  .spk-x-lead-form input,
  .spk-x-lead-form select,
  .spk-x-lead-form textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    padding: 15px 16px;
    background: rgba(255, 255, 255, 0.96);
    color: #152431;
    outline: 0;
    transition: border-color 0.18s ease, background 0.18s ease;
  }
  .spk-x-lead-form input::placeholder,
  .spk-x-lead-form textarea::placeholder {
    color: #586875;
  }
  .spk-x-lead-form textarea {
    min-height: 128px;
    resize: vertical;
  }

  .spk-x-lead-form__cta {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 15px 22px;
    background: #f28a2e;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease;
  }
  .spk-x-lead-form__cta:hover,
  .spk-x-lead-form__cta:focus-visible {
    transform: translateY(-2px);
    background: #ff902d;
  }

  .spk-x-lead-form__assurance {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    line-height: 1.5;
  }

  .spk-x-lead-form__status {
    grid-column: 1 / -1;
    margin: 0;
    min-height: 1em;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
  }
  .spk-x-lead-form__status:empty {
    display: none;
  }

  /* Handler-module-off fallback notice keeps its container visible. */
  .spk-x-lead-form--fallback {
    display: block;
  }

  /* ── Standalone (direct child of the post content) — React
     .about-compact-inquiry band + .about-mini-form panel ── */
  .wp-block-post-content > .spk-x-lead-form {
    display: block;
    /* Side padding reproduces the React inner-page shell gutter
       (min(85vw,1240px) centered → 7.5vw min gutter each side) so the panel
       lines up with the neighbouring 1240px sections. */
    padding: clamp(44px, 5vw, 68px) max(calc((100% - 1240px) / 2), 7.5vw);
    border: 0;
    border-bottom: 1px solid #dce4e9;
    background: #f4f7f9;
  }
  .wp-block-post-content > .spk-x-lead-form .spk-x-lead-form__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 24px;
    border: 1px solid #dce4e9;
    border-radius: 12px;
    background: #fff;
  }
  .wp-block-post-content > .spk-x-lead-form .spk-x-lead-form__field {
    align-content: start;
    gap: 7px;
    color: #062b5c;
    letter-spacing: 0.02em;
    text-transform: none;
  }
  .wp-block-post-content > .spk-x-lead-form .spk-x-lead-form__field--full {
    grid-column: span 2;
  }
  .wp-block-post-content > .spk-x-lead-form input,
  .wp-block-post-content > .spk-x-lead-form select,
  .wp-block-post-content > .spk-x-lead-form textarea {
    min-height: 44px;
    border: 1px solid #d8e1e8;
    padding: 11px 12px;
    background: #f8fafc;
    color: #152431;
    font-size: 14px;
  }
  .wp-block-post-content > .spk-x-lead-form input:focus,
  .wp-block-post-content > .spk-x-lead-form select:focus,
  .wp-block-post-content > .spk-x-lead-form textarea:focus {
    border-color: #087eae;
    background: #fff;
  }
  .wp-block-post-content > .spk-x-lead-form textarea {
    min-height: 76px;
  }
  .wp-block-post-content > .spk-x-lead-form .spk-x-lead-form__cta {
    grid-column: auto;
    align-self: end;
    min-height: 44px;
    padding: 12px 16px;
    white-space: nowrap;
  }
  .wp-block-post-content > .spk-x-lead-form .spk-x-lead-form__assurance {
    color: #51616e;
  }
  .wp-block-post-content > .spk-x-lead-form .spk-x-lead-form__status {
    color: #064a7d;
  }
}

@layer spk-responsive {
  @media (max-width: 1180px) {
    .wp-block-post-content > .spk-x-lead-form {
      /* shell 1180 断点:calc(100% - 72px) → 36px gutter */
      padding-left: 36px;
      padding-right: 36px;
    }
  }
  @media (max-width: 820px) {
    .spk-x-lead-form {
      grid-template-columns: 1fr;
    }
    .wp-block-post-content > .spk-x-lead-form {
      /* shell 820 断点:calc(100% - 34px) → 17px gutter */
      padding-left: 17px;
      padding-right: 17px;
    }
    .wp-block-post-content > .spk-x-lead-form .spk-x-lead-form__grid {
      grid-template-columns: 1fr;
      padding: 18px;
    }
    .wp-block-post-content > .spk-x-lead-form .spk-x-lead-form__field--full {
      grid-column: auto;
    }
    .wp-block-post-content > .spk-x-lead-form .spk-x-lead-form__cta {
      grid-column: 1 / -1;
      white-space: normal;
    }
  }
}
