/* ===========================
   LIQUIDWIRE INC. 1枚ページ
   寸法は幅1676pxのカンプから実測した値
   =========================== */
:root {
  --lw-red:      #c20e23;
  --lw-ink:      #000;
  --lw-panel:    rgba(238, 240, 238, .96); /* 背面のロゴがうっすら透ける濃度 */
  --lw-ease:     cubic-bezier(.22, .61, .36, 1);
  --lw-font:     "LINE Seed JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
}

html, body.lw { height: 100%; }
html { -webkit-text-size-adjust: 100%; }

body.lw {
  margin: 0;
  overflow: hidden;
  font-family: var(--lw-font);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.7;
  color: var(--lw-ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
body.lw *, body.lw *::before, body.lw *::after { box-sizing: border-box; }

/* ---- 中央のロゴ・メニュー ---- */
.lw-stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}
.lw-center {
  position: relative;
  width: min(505px, calc(100vw - 48px));
  transform: translateX(-1px);
}
.lw-logo { margin: 0; line-height: 0; transition: transform .7s var(--lw-ease); }
.lw-logo__svg { display: block; width: 100%; height: auto; overflow: visible; }

.lw-nav {
  position: absolute;
  z-index: 2;
  top: calc(100% + 100px);
  right: 7px;
  display: flex;
  gap: 45px;
  white-space: nowrap;
}
.lw-nav__item {
  appearance: none;
  position: relative;
  margin: 0;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--lw-ink);
  font: 700 12.8px/1.2 var(--lw-font);
  letter-spacing: 0;
  cursor: pointer;
}
.lw-nav__item::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 3px;
  height: 2px;
  background: var(--lw-red);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .35s var(--lw-ease);
}
@media (hover: hover) {
  .lw-nav__item:hover::after { transform: scaleX(1); transform-origin: left; }
}
.lw-nav__item[aria-expanded="true"]::after { transform: scaleX(0); } /* 開いている間は吹き出しが目印 */
.lw-nav__item:focus-visible { outline: 2px solid var(--lw-red); outline-offset: 2px; }

/* スマホのトップだけで使う丸ボタン */
.lw-more { display: none; }

/* ---- モーダル共通 ---- */
.lw-modal {
  position: absolute;
  z-index: 3;
  width: 607px;
  max-width: calc(100vw - 32px);
  border-radius: 8px;
  background: var(--lw-panel);
  outline: 0;
  visibility: hidden;
  opacity: 0;
  filter: blur(6px);
  transform: var(--lw-base, none) translateY(10px);
  transition:
    opacity .45s var(--lw-ease),
    filter .45s var(--lw-ease),
    transform .55s var(--lw-ease),
    visibility 0s linear .45s;
}
.lw-modal.is-open {
  visibility: visible;
  opacity: 1;
  filter: none;
  transform: var(--lw-base, none);
  transition-delay: 0s;
}
.lw-modal__tail {
  position: absolute;
  top: 100%;
  left: var(--lw-tail, 50%);
  width: 22px;
  height: 15px;
  margin-left: -11px;
  background: var(--lw-panel);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
/* カンプどおりPCでは出さない（外側クリックかEscで閉じる）。余白のないスマホだけ表示 */
.lw-modal__close { display: none; }

/* ---- COMPANY / RELATED ---- */
.lw-modal--info {
  left: 50%;
  bottom: -80px;
  height: 242px;
  max-height: calc(100vh - 32px);
  --lw-base: translateX(-50%);
  padding: 30px 56px;
}
.lw-company__name { margin: 0 0 12px; line-height: 0; }
.lw-company__name img { display: block; width: 143px; height: auto; }
.lw-company { margin: 0; }
.lw-company div { display: flex; }
.lw-company dt, .lw-company dd { margin: 0; }
.lw-company, .lw-company__head, .lw-company__list { font-size: 11.5px; line-height: 19px; }
.lw-company a { color: inherit; text-decoration: none; }
.lw-company__head { margin: 0; }
.lw-company__list { margin: 0; padding: 0; list-style: none; }

.lw-related {
  display: flex;
  align-items: center;
  height: 100%;
  margin: 0 0 0 -6px;
  padding: 0;
  list-style: none;
}
.lw-related li:nth-child(2) { margin-left: 44px; }
.lw-related li:nth-child(3) { margin-left: 69px; }
.lw-related a { display: block; line-height: 0; transition: opacity .3s; }
.lw-related img { display: block; height: auto; }
@media (hover: hover) { .lw-related a:hover { opacity: .55; } }

/* ---- CONTACT ---- */
.lw-modal--contact {
  position: fixed;
  left: 50%;
  top: calc(50% - 12px);
  max-height: calc(100dvh - 48px);
  --lw-base: translate(calc(-50% - 1px), -50%);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 38px 0 44px;
}

/* lqdw-contact のスタイルをカンプに合わせて上書き。
   プラグイン本体は他社と共用なので触らず、ここで受ける */
.lw-modal .cf-wrapper { max-width: none; margin: 0; padding: 0; }
.lw-modal .cf-header,
.lw-modal .cf-section-title,
.lw-modal .cf-badge,
.lw-modal #message-count,
.lw-modal .mt-24 { display: none; }  /* .mt-24＝プライバシーポリシー欄 */

.lw-modal .cf-card { background: none; box-shadow: none; border-radius: 0; padding: 0; }

.lw-modal .cf-steps { gap: 86px; margin: 0 0 51px; transform: translateX(-4px); }
.lw-modal .cf-step { flex: 0 0 auto; max-width: none; }
.lw-modal .cf-step::after { display: none; }
.lw-modal .cf-step__label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
}
.lw-modal .cf-step__icon,
.lw-modal .cf-step.is-done .cf-step__icon {
  width: 28px; height: 28px;
  background: var(--lw-red);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  transition: box-shadow .3s;
}
.lw-modal .cf-step.is-active .cf-step__icon {
  background: var(--lw-red);
  box-shadow: 0 0 0 3px #eef0ee, 0 0 0 4px var(--lw-red); /* 全部赤のままで現在地だけ示す */
}

.lw-modal .cf-row {
  grid-template-columns: 173px 1fr;
  gap: 21px;
  margin: 0 109px 37px 0;
  padding: 0;
  border: 0;
}
.lw-modal .cf-row:last-of-type { margin-bottom: 0; }
.lw-modal .cf-label {
  padding: 5px 0 0;
  background: none;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 22px;
  color: var(--lw-ink);
  white-space: nowrap;
  justify-content: flex-end;
}
.lw-modal .cf-field { min-width: 0; position: relative; padding: 0; }

.lw-modal .cf-input,
.lw-modal .cf-textarea {
  display: block;
  width: 100%;
  max-width: none !important; /* プラグインが電話欄へ style で幅を入れている */
  height: 32px;
  margin: 0;
  padding: 2px 8px;
  border: 1px solid var(--lw-ink);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--lw-ink);
  font: 400 14px/1.5 var(--lw-font);
  transition: background .25s;
}
.lw-modal .cf-input::placeholder,
.lw-modal .cf-textarea::placeholder { color: transparent; }
.lw-modal .cf-textarea { height: 193px; padding: 6px 8px; resize: none; }
.lw-modal .cf-input:focus,
.lw-modal .cf-textarea:focus {
  outline: 0;
  border-color: var(--lw-ink);
  box-shadow: none;
  background: rgba(255, 255, 255, .7);
}
.lw-modal .cf-input.is-error,
.lw-modal .cf-textarea.is-error,
.lw-modal .cf-input.has-error,
.lw-modal .cf-textarea.has-error { border-color: var(--lw-red); background: transparent; }

.lw-modal .cf-hint { display: none; }
.lw-modal .cf-error-msg {
  position: absolute;
  left: 0;
  top: 100%;
  margin: 3px 0 0;
  font-size: 11.5px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--lw-red);
}
.lw-modal #cf-server-error { position: static; }

.lw-modal .cf-btn-area { display: flex; justify-content: center; gap: 14px; margin: 50px 0 0; padding: 0; }
.lw-modal #contact-form .cf-btn-area { transform: translateX(-7px); }
.lw-modal .cf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 162px;
  min-width: 0;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 17px;
  background: var(--lw-red);
  box-shadow: none;
  color: #fff;
  font: 700 13px/1 var(--lw-font);
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .25s;
}
.lw-modal .cf-btn--secondary { background: none; box-shadow: inset 0 0 0 1px var(--lw-ink); color: var(--lw-ink); }
@media (hover: hover) { .lw-modal .cf-btn:hover { opacity: .75; transform: none; box-shadow: none; } .lw-modal .cf-btn--secondary:hover { box-shadow: inset 0 0 0 1px var(--lw-ink); } }

/* 確認画面 */
.lw-modal .cf-confirm-notice {
  width: auto;
  margin: 0 56px 20px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--lw-ink);
  font-size: 12.5px;
  line-height: 1.7;
  text-align: center;
}
.lw-modal .cf-confirm-table { width: calc(100% - 112px); margin: 0 56px; border-collapse: collapse; background: none; }
.lw-modal .cf-confirm-table tr { background: none; }
.lw-modal .cf-confirm-table th,
.lw-modal .cf-confirm-table td {
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, .25);
  background: none;
  color: var(--lw-ink);
  font-size: 13px;
  line-height: 1.7;
  text-align: left;
  vertical-align: top;
}
.lw-modal .cf-confirm-table th { width: 120px; font-weight: 700; white-space: nowrap; }
.lw-modal .cf-confirm-table td { font-weight: 400; word-break: break-all; white-space: pre-wrap; }

/* 完了画面 */
.lw-modal .cf-complete { padding: 8px 56px 0; text-align: center; }
.lw-modal .cf-complete__icon { display: none; }
.lw-modal .cf-complete__title { margin: 0 0 16px; font-size: 18px; color: var(--lw-ink); }
.lw-modal .cf-complete__text { margin: 0 0 32px; font-size: 13px; color: var(--lw-ink); }

/* ---- フッター ---- */
.lw-footer {
  position: fixed;
  left: 0; right: 0;
  bottom: max(12px, env(safe-area-inset-bottom));
  font-size: 10px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: .04em;
  text-align: center;
  animation: lw-rise .8s var(--lw-ease) 1.2s both;
}

/* ---- オープニング ---- */
@keyframes lw-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.lw-logo path {
  transform-box: fill-box;
  animation: lw-rise .8s var(--lw-ease) calc(.25s + var(--i) * 28ms) both;
}
.lw-nav { animation: lw-rise .8s var(--lw-ease) 1.2s both; }

@media (prefers-reduced-motion: reduce) {
  .lw-logo path, .lw-nav, .lw-footer { animation: none; }
  .lw-modal { transition: none; filter: none; }
}

/* ---- スマホ ----
   モーダルを開くとロゴが画面下へ移り、空いた上側の中央にモーダルが出る */
@media (max-width: 680px) {
  :root { --lw-foot: calc(9dvh + 17vw); } /* 画面下のロゴ領域 */

  .lw-center { width: 70vw; transform: none; }
  .lw-nav {
    top: calc(100% + 56px);
    left: -8vw; right: -8vw;
    justify-content: space-between;
    gap: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    animation: none;
    transition: opacity .5s var(--lw-ease), transform .5s var(--lw-ease), visibility 0s linear .5s;
  }
  body.lw-nav-on .lw-nav { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .lw-more {
    display: block;
    position: absolute;
    top: calc(100% + 45px);
    left: 50%;
    width: 38px; height: 38px;
    margin-left: -19px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--lw-red);
    cursor: pointer;
    animation: lw-rise .8s var(--lw-ease) 1.2s both;
    transition: opacity .3s var(--lw-ease), visibility 0s linear .3s;
  }
  .lw-more::before {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: 8px; height: 8px;
    margin: -6px 0 0 -4px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
  }
  body.lw-nav-on .lw-more { animation: none; opacity: 0; visibility: hidden; }
  .lw-nav__item { font-size: 13px; padding: 12px 0; }
  body.lw-nav-on.lw-is-open .lw-nav { opacity: 0; visibility: hidden; transition-duration: .35s, .35s, 0s; transition-delay: 0s, 0s, .35s; }
  body.lw-is-open .lw-logo { transform: translateY(41dvh); }

  .lw-modal__tail { display: none; }
  .lw-modal__close {
    display: block;
    position: absolute;
    z-index: 1;
    top: 4px; right: 4px;
    width: 40px; height: 40px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
  }
  .lw-modal__close::before,
  .lw-modal__close::after {
    content: "";
    position: absolute;
    left: 12px; top: 19px;
    width: 16px; height: 1px;
    background: var(--lw-ink);
    transform: rotate(45deg);
  }
  .lw-modal__close::after { transform: rotate(-45deg); }

  .lw-modal--info,
  .lw-modal--contact {
    position: fixed;
    left: 50%;
    top: calc((100dvh - var(--lw-foot)) / 2);
    bottom: auto;
    width: 78vw;
    height: auto;
    max-width: none;
    max-height: calc(100dvh - var(--lw-foot) - 16px);
    --lw-base: translate(-50%, -50%);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  /* COMPANY */
  #lw-company {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 64vw;
    padding: 28px 4vw 28px 5vw;
  }
  .lw-company__name { margin-bottom: 3.4vw; }
  .lw-company__name img { width: 30vw; }
  .lw-company, .lw-company__head, .lw-company__list { font-size: max(10px, 2.6vw); line-height: 1.75; }

  /* RELATED */
  #lw-related { padding: 16vw 0 15vw; }
  .lw-related { flex-direction: column; gap: 12vw; height: auto; margin: 0; padding: 0; }
  .lw-related li:nth-child(n) { margin-left: 0; }
  .lw-related li:nth-child(-n+2) img { width: 31vw; }
  .lw-related li:nth-child(3) img { width: 16vw; }

  /* CONTACT */
  .lw-modal--contact { padding: 52px 25px 44px; }
  .lw-modal .cf-steps { gap: 30px; margin-bottom: 16px; transform: none; }
  .lw-modal .cf-step__icon,
  .lw-modal .cf-step.is-done .cf-step__icon { width: 23px; height: 23px; font-size: 0; }
  .lw-modal .cf-row { display: block; margin: 0 0 14px; }
  .lw-modal .cf-row:last-of-type { margin-bottom: 0; }
  .lw-modal .cf-label {
    position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%);
  }
  /* iOS Safari は16px未満の入力欄でフォーカス時に拡大する */
  .lw-modal .cf-input { height: 38px; font-size: 16px; }
  .lw-modal .cf-textarea { height: 160px; font-size: 16px; }
  .lw-modal .cf-input::placeholder,
  .lw-modal .cf-textarea::placeholder { color: #8a8d8a; font-size: 13px; }
  .lw-modal .cf-error-msg { position: static; margin-top: 3px; }
  .lw-modal .cf-btn-area { gap: 10px; margin-top: 24px; }
  .lw-modal #contact-form .cf-btn-area { transform: none; }
  .lw-modal .cf-btn { width: 100%; max-width: 134px; height: 36px; border-radius: 18px; }
  .lw-modal .cf-confirm-notice, .lw-modal .cf-confirm-table { width: 100%; margin-left: 0; margin-right: 0; }
  .lw-modal .cf-confirm-table th { width: auto; display: block; padding-bottom: 0; border: 0; }
  .lw-modal .cf-confirm-table td { display: block; padding-top: 0; }
  .lw-modal .cf-complete { padding: 8px 0 0; }
}
