/* ===========================
   contact スタイル（完成版）
   =========================== */

:root{
  --fg:#eaeaea;
  --muted:#bdbdbd;
  --bg:#0b0c0e;
  --panel:#111416;
  --border:#23272a;
  --acc:#e14b3b; /* ブランド赤 */
}

html, body { margin:0; padding:0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* 背景（無限パターン＋固定） */
body.contact-bg{
  background: #111 url('../img/bg_contact.png') repeat fixed;
  background-size: 280px 280px;
  color: var(--fg);
}

/* ヘッダー */
header.contact-header{
  text-align:center;
  padding: 48px 16px 28px;
}
header.contact-header h1{
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: .02em;
  color: #fff;
  margin: 0;
  text-shadow: 0 2px 6px rgba(0,0,0,.45);
}

/* コンテンツラッパー */
main.contact-content{
  max-width: 880px;
  margin: 0 auto;
  padding: 12px 16px 64px;
}

/* 説明文 */
main.contact-content > p{
  margin: 0 0 22px;
  color: var(--muted);
}

/* フォーム */
main.contact-content form{
  display: grid;
  gap: 18px;
  margin-bottom: 40px;
}

main.contact-content label{
  display: block;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}

main.contact-content input[type="text"],
main.contact-content input[type="email"],
main.contact-content textarea{
  width: 100%;
  max-width: 680px;
  background: var(--panel);
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  box-sizing: border-box;
}

main.contact-content textarea{
  min-height: 160px;
  resize: vertical;
}

main.contact-content input:focus,
main.contact-content textarea:focus{
  outline: none;
  border-color: #39424c;
  box-shadow: 0 0 0 3px rgba(225,75,59,.18);
}

main.contact-content .note{
  font-size: 13px;
  color: var(--muted);
}

/* 送信ボタン */
main.contact-content button[type="submit"]{
  background: var(--acc);
  border: 1px solid var(--acc);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .08s ease, filter .2s ease;
}
main.contact-content button[type="submit"]:hover{ filter: brightness(1.05); }
main.contact-content button[type="submit"]:active{ transform: translateY(1px); }

/* ホーム / 上へボタン */
.btn-home,
.btn-top{
  position: fixed;
  z-index: 999;
  background: rgba(0,0,0,.6);
  border-radius: 50%;
  padding: .5rem;
  cursor: pointer;
  transition: transform .25s, opacity .3s;
  border: 1px solid #fff2;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.btn-home{ top: 1rem; left: 1rem; }
.btn-top{ right: 1rem; bottom: 2rem; opacity: 0; pointer-events: none; }
.btn-home:hover, .btn-top:hover{ transform: scale(1.06); }
.btn-top.show{ opacity: 1; pointer-events: auto; }
.btn-home img{ width: 36px; height: 36px; display:block; }
.btn-top img{ width: 32px; height: 32px; display:block; }

/* フッター */
footer.site-footer{
  text-align: center;
  font-size: .85em;
  color: #888;
  padding: 2.2em 1em;
}

/* モバイル最適化 */
@media (max-width: 640px){
  main.contact-content input[type="text"],
  main.contact-content input[type="email"],
  main.contact-content textarea{
    max-width: none;
  }
}
/* ハニーポット: 画面外へ。支援技術に配慮してaria-hidden併用 */
.hp-field{
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
/* エラー表示 */
.field-error{
  color: #f1b6b6;
  font-size: 13px;
  margin: 6px 0 0;
  min-height: 1.2em; /* メッセージが無い時も段差が出ない */
}

input[aria-invalid="true"],
textarea[aria-invalid="true"]{
  border-color: #d87272 !important;
  box-shadow: 0 0 0 3px rgba(216,114,114,.25);
}

/* フォーム全体の通知（読み上げ用も兼ねる） */
.form-alert{
  background: rgba(225,75,59,.15);
  border: 1px solid rgba(225,75,59,.35);
  color: #ffdede;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 14px;
  display: none;
}
.form-alert:not(:empty){ display: block; }
/* 送信ボタンの行 */
.actions{
  margin-top: 6px;
  justify-self: end;     /* 右寄せ。左寄せなら start に */
}

.btn-submit{
  background: var(--acc);
  border: 1px solid var(--acc);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .08s ease, filter .2s ease;
}
.btn-submit:hover{ filter: brightness(1.05); }
.btn-submit:active{ transform: translateY(1px); }

/* 言語切替の配置（色は既存テーマに任せる） */
.contact-header { position: relative; }              /* 既に指定があっても害なし */
.contact-header .lang-switch {
  position: absolute; top: 10px; right: 20px; font-size: .95rem;
}
.contact-header .lang-switch a { margin-left: 6px; text-decoration: underline; }
.contact-header .lang-switch a {
  margin-left: 6px;
  text-decoration: none;
  color: #fff;        /* リンクを白に */
  font-weight: normal;
}
.contact-header .lang-switch a:hover {
  text-decoration: underline;
  color: #ccc;        /* ホバー時は少しグレーで区別 */
}

/* プライバシーポリシー同意 行の整形 */
.policy-consent{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;          /* 幅が狭い端末で折り返しても崩れない */
  margin-top:8px;
}
.policy-label{
  display:flex;
  align-items:center;
  gap:6px;
}
.policy-link{
  font-size:.9rem;
  text-decoration: underline;
  color:#fff;              /* 背景が暗い前提。テーマに合わせたい場合は削除可 */
  opacity:.9;
}
.policy-link:hover{ opacity:1; }
.policy-link:focus-visible{
  outline:2px solid #fff; outline-offset:2px; border-radius:4px;
}
.required { color:#e14b3b; margin-left:2px; font-weight:bold; }
.field-counter { font-size:.85rem; color:#999; margin-top:4px; }

.label-with-counter{
  display:flex;
  align-items:baseline;
  gap:8px;
  flex-wrap:wrap;       /* 狭い幅で折り返しても崩れない */
}
.label-counter{
  font-size:.9rem;
  color:#9aa3ad;
}
.required{ color:#e14b3b; margin-left:2px; font-weight:bold; }
