/* お問い合わせページ（page-contact.php / assets/contact.js）。
   2026-10-05 フォームを2つのタブに分割。同日、フォームの中央揃えと「お電話でのご相談」以下の演出を追加。
   演出は contact.js が <html> に .cx-motion を付けたときだけ効く。JSが動かない・動きを減らす設定の人には静止表示。 */

.contact-phones,
.contact-forms { --contact-web: #21b8ce; --contact-event: #33b371; --contact-ink: #202426; --contact-line: #d3d9dc; --cx-ease: cubic-bezier(.16,1,.3,1); --cx-back: cubic-bezier(.34,1.56,.64,1); }

/* ---------- 見出し（電話・フォーム共通）：2色のバー ---------- */
.contact-phones h2::after,
.contact-forms > h2::after { content: ""; display: block; width: 42px; height: 4px; margin-top: 18px; background: var(--contact-web); box-shadow: 42px 0 0 var(--contact-event); transform-origin: left; }
.contact-forms > h2::after { margin: 18px auto 0; translate: -21px 0; transform-origin: center; }

/* 1文字ずつ分割した見出し（JSが作る） */
.cx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cx-chars { display: inline; }
.cx-cmask { display: inline-block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; vertical-align: bottom; }
.cx-char { display: inline-block; }

/* ---------- 電話窓口 ---------- */
.contact-phones { position: relative; overflow: hidden; isolation: isolate; }
.cx-marquee { position: absolute; left: 0; top: 50%; z-index: -1; display: flex; white-space: nowrap; pointer-events: none; font-size: clamp(90px, 15vw, 230px); font-weight: 900; line-height: 1; letter-spacing: -.04em; color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.13); translate: var(--cx-shift, 0px) -50%; }
.cx-marquee-track { display: flex; animation: cx-marquee 32s linear infinite; }
.cx-marquee-track span { padding-right: .35em; }
@keyframes cx-marquee { to { transform: translateX(-50%); } }

.phone-panels { perspective: 1400px; }
.phone-panels a { position: relative; overflow: hidden; isolation: isolate; transition: border-color .4s ease; }
.phone-panels a > * { position: relative; }
/* 上辺のアクセントバー */
.phone-panels a::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 3px; background: var(--contact-web); transform-origin: left; }
.phone-panels a:nth-child(2)::before { background: var(--contact-event); }
/* ホバーで左から色が満ちる */
.phone-panels a::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--contact-web); opacity: .14; transform: scaleX(0); transform-origin: left; transition: transform .7s var(--cx-ease); }
.phone-panels a:nth-child(2)::after { background: var(--contact-event); }
.phone-panels a:hover::after,
.phone-panels a:focus-visible::after { transform: scaleX(1); }
.phone-panels a:hover { border-color: var(--contact-web); }
.phone-panels a:nth-child(2):hover { border-color: var(--contact-event); }
.phone-panels a > span { transition: translate .6s var(--cx-ease); }
.phone-panels a:hover > span { translate: 10px 0; }
/* 受付中の点滅ドット */
.phone-panels p::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%; background: var(--contact-web); vertical-align: middle; animation: cx-pulse 1.8s ease-out infinite; }
.phone-panels a:nth-child(2) p::before { background: var(--contact-event); animation-name: cx-pulse-event; }
@keyframes cx-pulse { 0% { box-shadow: 0 0 0 0 rgba(33,184,206,.65); } 100% { box-shadow: 0 0 0 12px rgba(33,184,206,0); } }
@keyframes cx-pulse-event { 0% { box-shadow: 0 0 0 0 rgba(51,179,113,.65); } 100% { box-shadow: 0 0 0 12px rgba(51,179,113,0); } }
/* 電話番号の1桁ずつ */
.cx-digits { display: inline-flex; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; vertical-align: bottom; }
.cx-digit { display: inline-block; }

/* ---------- フォーム：中央揃え ---------- */
.contact-forms { position: relative; overflow: hidden; isolation: isolate; }
.contact-forms > h2 { margin: 0; text-align: center; }
.contact-forms-lead { max-width: 640px; margin: 18px auto 0; color: #5c6a70; font-size: 14px; line-height: 1.9; text-align: center; }

/* 回転する ✳（JSが作る装飾） */
.cx-star { position: absolute; z-index: -1; pointer-events: none; font-size: clamp(170px, 24vw, 340px); line-height: 1; color: var(--contact-web); opacity: .1; translate: 0 var(--cx-star-y, 0px); animation: cx-spin 26s linear infinite; }
.cx-star--web { top: 10px; right: -70px; }
.cx-star--event { bottom: 120px; left: -80px; font-size: clamp(120px, 16vw, 220px); color: var(--contact-event); translate: 0 calc(var(--cx-star-y, 0px) * -1); animation-direction: reverse; animation-duration: 34s; }
@keyframes cx-spin { to { rotate: 360deg; } }

/* タブ。JSが動いたときだけ出す（.is-tabbed）。動かないときはフォームを縦に並べる。 */
.contact-tabs { display: none; grid-template-columns: 1fr 1fr; gap: 0; max-width: 860px; margin: 40px auto 0; border: 1px solid var(--contact-line); background: #fff; }
.contact-forms.is-tabbed .contact-tabs { display: grid; }
.contact-tab { position: relative; isolation: isolate; overflow: hidden; padding: 22px 20px; border: 0; background: #fff; color: var(--contact-ink); font: inherit; font-size: 15px; font-weight: 700; line-height: 1.5; text-align: center; cursor: pointer; transition: color .35s ease; }
.contact-tab + .contact-tab { border-left: 1px solid var(--contact-line); }
/* 選ばれたタブは下から色が満ちる */
.contact-tab::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--contact-ink); transform: scaleY(0); transform-origin: bottom; transition: transform .5s var(--cx-ease); }
.contact-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--contact-web); transform: scaleX(0); transform-origin: left; transition: transform .55s var(--cx-ease) .12s; }
.contact-tab--event::after { background: var(--contact-event); transform-origin: right; }
.contact-tab:hover { color: #0f8ea1; }
.contact-tab--event:hover { color: #23874f; }
.contact-tab[aria-selected="true"] { color: #fff; }
.contact-tab[aria-selected="true"]::before { transform: scaleY(1); }
.contact-tab[aria-selected="true"]::after { transform: scaleX(1); }
.contact-tab:focus-visible { outline: 3px solid var(--contact-web); outline-offset: -3px; }

.contact-panel { margin: 0; padding: 40px 0 0; }
.contact-forms:not(.is-tabbed) .contact-panel + .contact-panel { margin-top: 56px; border-top: 1px solid var(--contact-line); }
.contact-panel-title { margin: 0 0 24px; font-size: 18px; text-align: center; }
.contact-forms.is-tabbed .contact-panel-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 入力欄 ---------- */
.contact-panel .wpcf7-form { max-width: 760px; margin: 0 auto; }
.contact-panel .cf-field { display: block; margin: 0 0 24px; }
.contact-panel .cf-label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 9px; color: var(--contact-ink); font-size: 14px; font-weight: 700; transition: color .3s ease, translate .4s var(--cx-ease); }
.contact-panel .cf-field:focus-within .cf-label { color: #0f8ea1; translate: 6px 0; }
.contact-panel--event .cf-field:focus-within .cf-label { color: #23874f; }
.contact-panel .cf-label small { color: #7a888e; font-size: 12px; font-weight: 400; }
.contact-panel .cf-req { display: inline-block; padding: 2px 7px; background: var(--contact-ink); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.contact-panel--web .cf-req { background: #0f8ea1; }
.contact-panel--event .cf-req { background: #23874f; }
.contact-panel input[type="text"],
.contact-panel input[type="email"],
.contact-panel input[type="tel"],
.contact-panel input[type="url"],
.contact-panel select,
.contact-panel textarea { box-sizing: border-box; width: 100%; padding: 14px 16px; border: 1px solid var(--contact-line); border-radius: 0; background: #fff; color: var(--contact-ink); font: inherit; font-size: 16px; line-height: 1.6; transition: border-color .2s ease, box-shadow .3s var(--cx-ease); }
.contact-panel textarea { min-height: 160px; resize: vertical; }
.contact-panel input:focus,
.contact-panel select:focus,
.contact-panel textarea:focus { outline: none; border-color: var(--contact-web); box-shadow: 0 0 0 3px rgba(33,184,206,.18), inset 0 -3px 0 var(--contact-web); }
.contact-panel--event input:focus,
.contact-panel--event select:focus,
.contact-panel--event textarea:focus { border-color: var(--contact-event); box-shadow: 0 0 0 3px rgba(51,179,113,.18), inset 0 -3px 0 var(--contact-event); }
.contact-panel ::placeholder { color: #9aa6ab; }

/* チェックボックス・ラジオ（選ぶとピルが色付きになる） */
.contact-panel .wpcf7-checkbox,
.contact-panel .wpcf7-radio { display: flex; flex-wrap: wrap; gap: 10px; }
.contact-panel .wpcf7-list-item { margin: 0; }
.contact-panel .wpcf7-list-item label { display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border: 1px solid var(--contact-line); background: #fff; font-size: 14px; cursor: pointer; transition: border-color .25s ease, background .25s ease, translate .3s var(--cx-ease); }
.contact-panel .wpcf7-list-item label:hover { translate: 0 -2px; }
.contact-panel--web .wpcf7-list-item label:has(input:checked) { border-color: var(--contact-web); background: rgba(33,184,206,.09); }
.contact-panel--event .wpcf7-list-item label:has(input:checked) { border-color: var(--contact-event); background: rgba(51,179,113,.09); }
.contact-panel .wpcf7-list-item input { width: 18px; height: 18px; margin: 0; accent-color: var(--contact-web); }
.contact-panel--event .wpcf7-list-item input { accent-color: var(--contact-event); }
.contact-panel .wpcf7-list-item input:checked { animation: cx-pop .4s var(--cx-back); }
@keyframes cx-pop { 0% { scale: .6; } 100% { scale: 1; } }

/* 個人情報・同意 */
.contact-panel .cf-privacy { margin: 8px 0 22px; padding: 18px 20px; border: 1px solid var(--contact-line); background: #fff; color: #5c6a70; font-size: 13px; line-height: 1.85; }
.contact-panel .cf-privacy p { margin: 0; }
.contact-panel .cf-privacy .cf-privacy-title { margin: 0 0 6px; color: var(--contact-ink); font-weight: 700; }
.contact-panel .cf-privacy a { color: inherit; text-decoration: underline; text-underline-offset: .2em; }
.contact-panel .cf-accept { margin: 0 0 26px; font-size: 14px; text-align: center; }
.contact-panel .cf-accept label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.contact-panel .cf-accept input { width: 18px; height: 18px; accent-color: var(--contact-web); }
.contact-panel--event .cf-accept input { accent-color: var(--contact-event); }

/* 送信（同意すると脈打つ） */
.contact-panel .cf-submit { margin: 0; text-align: center; }
.contact-panel .wpcf7-submit { display: block; width: 100%; max-width: 420px; margin: 0 auto; padding: 19px 28px; border: 0; border-radius: 0; background: var(--contact-ink); color: #fff; font: inherit; font-size: 15px; font-weight: 700; letter-spacing: .06em; cursor: pointer; transition: background .3s ease, translate .35s var(--cx-ease), opacity .3s ease; }
.contact-panel .wpcf7-submit:not(:disabled) { animation: cx-ready 2s ease-out infinite; }
.contact-panel--event .wpcf7-submit:not(:disabled) { animation-name: cx-ready-event; }
.contact-panel--web .wpcf7-submit:not(:disabled):hover { background: #0f8ea1; translate: 0 -3px; }
.contact-panel--event .wpcf7-submit:not(:disabled):hover { background: #23874f; translate: 0 -3px; }
.contact-panel .wpcf7-submit:disabled { opacity: .4; cursor: not-allowed; }
@keyframes cx-ready { 0% { box-shadow: 0 0 0 0 rgba(33,184,206,.55); } 100% { box-shadow: 0 0 0 16px rgba(33,184,206,0); } }
@keyframes cx-ready-event { 0% { box-shadow: 0 0 0 0 rgba(51,179,113,.55); } 100% { box-shadow: 0 0 0 16px rgba(51,179,113,0); } }
.contact-panel .wpcf7-spinner { display: block; margin: 14px auto 0; }
.contact-panel .wpcf7-not-valid-tip { margin-top: 6px; font-size: 13px; }
.contact-panel .wpcf7-response-output { margin: 22px 0 0 !important; padding: 14px 18px !important; font-size: 14px; text-align: center; }

/* ================= 登場アニメーション（.cx-motion のときだけ） ================= */

/* 見出し：1文字ずつ回転しながらせり上がる＋バーが伸びる */
.cx-motion .cx-split .cx-char { opacity: 0; transform: translateY(115%) rotate(10deg); transition: transform 1s var(--cx-ease), opacity .6s ease; transition-delay: calc(var(--ci, 0) * 42ms); }
.cx-motion .cx-split.is-in .cx-char { opacity: 1; transform: none; }
.cx-motion .cx-split::after { transform: scaleX(0); transition: transform 1.1s var(--cx-ease) .55s; }
.cx-motion .cx-split.is-in::after { transform: scaleX(1); }

/* 電話パネル：奥から起き上がる → 上辺バー → 番号が1桁ずつ */
.cx-motion .phone-panels a { opacity: 0; transform: translate3d(0, 110px, -120px) rotateX(32deg) scale(.9); transform-origin: 50% 100%; transition: transform 1.25s var(--cx-back), opacity .8s ease, border-color .4s ease; transition-delay: calc(var(--pi, 0) * 170ms); }
.cx-motion .phone-panels.is-in a { opacity: 1; transform: none; }
.cx-motion .phone-panels a::before { transform: scaleX(0); transition: transform 1.2s var(--cx-ease); transition-delay: calc(var(--pi, 0) * 170ms + 550ms); }
.cx-motion .phone-panels.is-in a::before { transform: scaleX(1); }
.cx-motion .phone-panels .cx-digit { transform: translateY(110%) rotateX(-80deg); opacity: 0; transition: transform .85s var(--cx-ease), opacity .4s ease; transition-delay: calc(var(--pi, 0) * 170ms + 380ms + var(--di, 0) * 48ms); }
.cx-motion .phone-panels.is-in .cx-digit { transform: none; opacity: 1; }
.cx-motion .phone-panels p { opacity: 0; translate: -24px 0; transition: opacity .6s ease, translate .9s var(--cx-ease); transition-delay: calc(var(--pi, 0) * 170ms + 260ms); }
.cx-motion .phone-panels.is-in p { opacity: 1; translate: 0 0; }

/* リード文：ぼかしから */
.cx-motion .contact-forms-lead { opacity: 0; filter: blur(10px); translate: 0 24px; transition: opacity .9s ease, filter .9s ease, translate 1s var(--cx-ease); transition-delay: .35s; }
.cx-motion .contact-forms-lead.is-in { opacity: 1; filter: none; translate: 0 0; }

/* タブ：左右から飛び込む */
.cx-motion .contact-tabs { opacity: 0; scale: .96; transition: opacity .6s ease, scale .9s var(--cx-back); }
.cx-motion .contact-tabs.is-in { opacity: 1; scale: 1; }
.cx-motion .contact-tab--web { translate: -120px 0; transition: translate 1.1s var(--cx-back), color .35s ease; }
.cx-motion .contact-tab--event { translate: 120px 0; transition: translate 1.1s var(--cx-back) .08s, color .35s ease; }
.cx-motion .contact-tabs.is-in .contact-tab { translate: 0 0; }

/* 入力欄：ぼかしから時間差でせり上がる（タブを切り替えるたびに再生） */
.cx-motion .contact-panel .cx-item { opacity: 0; transform: translate3d(0, 50px, 0) scale(.98); filter: blur(8px); }
.cx-motion .contact-panel.cx-play .cx-item { opacity: 1; transform: none; filter: none; transition: opacity .6s ease, transform .95s var(--cx-ease), filter .6s ease; transition-delay: calc(var(--fi, 0) * 55ms); }

@media (max-width: 720px) {
  .contact-tabs { grid-template-columns: 1fr; }
  .contact-tab + .contact-tab { border-left: 0; border-top: 1px solid var(--contact-line); }
  .contact-tab { padding: 18px 16px; font-size: 14px; }
  .contact-panel { padding-top: 28px; }
  .cx-motion .contact-tab--web { translate: -60px 0; }
  .cx-motion .contact-tab--event { translate: 60px 0; }
  .cx-star--web { right: -90px; }
  .cx-star--event { display: none; }
}

/* reCAPTCHA：右下のバッジは隠し、フォームの下の文言で代える（2026-10-06）。
   display:none にすると reCAPTCHA が動かなくなるので visibility で隠す */
.grecaptcha-badge { visibility: hidden; }
.contact-recaptcha-note { max-width: 760px; margin: 28px auto 0; font-size: 12px; line-height: 1.8; color: #6b7275; text-align: center; text-wrap: balance; }
.contact-recaptcha-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .cx-marquee-track, .cx-star, .phone-panels p::before,
  .contact-panel .wpcf7-submit:not(:disabled) { animation: none; }
  .contact-tab::before, .contact-tab::after, .phone-panels a::after { transition: none; }
}
