/* ==========================================================
   WHT Whitepaper DL: [whitepaper] のDLフォーム

   色はサイトごとに「外観 > カスタマイズ > 追加CSS」などで上書きできる:
     :root {
       --whtdl-accent: #1FD27B;       ボタン・枠線
       --whtdl-accent-dark: #14A862;  ボタンのホバー
     }
   ほかに --whtdl-border / --whtdl-bg-soft / --whtdl-text-sub
   ========================================================== */

.dl-gate,
.dl-gate * {
  box-sizing: border-box;
}

.dl-gate {
  border: 2px solid var(--whtdl-accent, #2563eb);
  border-radius: 12px;
  padding: 28px;
  margin: 40px 0;
  background: #fff;
  font-family: inherit;
  line-height: 1.7;
  scroll-margin-top: 80px; /* #dl-gate へ飛んだとき固定ヘッダーに隠れないように */
}

/* 文章は <div> で出している（テーマの p 向けの文字サイズ・余白を受けないため） */
.dl-gate p {
  margin: 0;
}

.dl-gate-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--whtdl-border, #e5e7eb);
}

/* 資料のアイコン（紙の形） */
.dl-gate-doc {
  flex: none;
  width: 42px;
  height: 54px;
  border: 1px solid var(--whtdl-border, #e5e7eb);
  border-top: 4px solid var(--whtdl-accent, #2563eb);
  border-radius: 3px;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 6px,
    var(--whtdl-bg-soft, #f6f7f9) 6px 10px
  );
}

.dl-gate-info {
  flex: 1;
  min-width: 0;
}

.dl-gate-name {
  display: block;
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.dl-gate-spec {
  display: block;
  font-size: 0.8125rem;
  color: var(--whtdl-text-sub, #6b7280);
  line-height: 1.7;
}

.dl-gate-fields {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.dl-gate .dl-gate-label {
  display: block;
  margin: 0;
}

.dl-gate .dl-gate-label span {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.dl-gate .dl-gate-label input {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--whtdl-border, #e5e7eb);
  border-radius: 8px;
  font-size: 1rem; /* 16px 未満だと iPhone で入力時に拡大される */
  font-family: inherit;
  line-height: 1.5;
  color: inherit;
  background: var(--whtdl-bg-soft, #f6f7f9);
  box-shadow: none;
}

.dl-gate .dl-gate-label input:focus {
  outline: 2px solid var(--whtdl-accent, #2563eb);
  border-color: transparent;
  background: #fff;
}

.dl-gate .dl-gate-btn {
  display: inline-block;
  background: var(--whtdl-accent, #2563eb);
  color: #fff !important; /* テーマのリンク色（!important のこともある）でボタンの文字が背景に溶けないように */
  font-weight: 700;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
  text-decoration: none;
  text-align: center;
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  cursor: pointer;
}

.dl-gate .dl-gate-btn:hover,
.dl-gate .dl-gate-btn:focus-visible {
  background: var(--whtdl-accent-dark, #1d4ed8);
  opacity: 1; /* テーマの button:hover { opacity } を打ち消す */
}

/* 送信中（二度押し防止で押せなくしている間） */
.dl-gate .dl-gate-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.dl-gate .dl-gate-submit {
  display: block;
  width: 100%;
}

.dl-gate .dl-gate-note {
  font-size: 0.75rem;
  color: var(--whtdl-text-sub, #6b7280);
  text-align: center;
  margin-top: 14px;
}

.dl-gate .dl-gate-email-note {
  font-size: 0.75rem;
  color: var(--whtdl-text-sub, #6b7280);
  margin-top: -8px;
}

.dl-gate .dl-gate-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 18px;
}

/* サンクス表示 */
.dl-gate--thanks {
  text-align: center;
  padding: 40px 28px;
}

.dl-gate .dl-gate-check {
  font-size: 2.5rem;
  color: var(--whtdl-accent, #2563eb);
  line-height: 1;
  margin-bottom: 12px;
}

/* GA4 計測のため .dl-gate-msg だけは <p> のまま。テーマの p の余白指定
   （!important のこともある）に負けないよう、間隔は下のボタン側で取る */
.dl-gate .dl-gate-msg {
  font-size: 1.125rem;
  font-weight: 700;
}

.dl-gate--thanks .dl-gate-btn {
  margin-top: 20px;
}

.dl-gate .dl-gate-sub {
  font-size: 0.8125rem;
  color: var(--whtdl-text-sub, #6b7280);
  margin-top: 18px;
}

@media (max-width: 560px) {
  .dl-gate {
    padding: 20px 16px;
  }

  .dl-gate--thanks {
    padding: 28px 16px;
  }
}
