/* ==============================
   チタプポ体操 展示用 CSS（iPhone / iPad / PC対応 完全版）
   ============================== */

/* ------------------------------
   🎨 ブランドカラー定義
   ------------------------------ */
:root {
  --bcp: #5263a2; /* Brand Color Purple */
  --bcw: #f3f2eb; /* Brand Color White */
}

/* ------------------------------
   🩰 ベース設定
   ------------------------------ */
body {
  background-color: var(--bcp);
  font-family: 'Noto Sans JP', sans-serif;
  color: #aaa;
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%; /* ✅ iOSで文字サイズ拡大を防ぐ */
}

/* ------------------------------
   📦 メインカード
   ------------------------------ */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 480px;
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  padding: 32px 28px;
  margin: 24px auto;
  box-sizing: border-box;
  background-color: transparent;
  transition: all 0.3s ease;
}

/* ------------------------------
   🪶 ヘッダー・ロゴ
   ------------------------------ */
header {
  width: 100%;
  margin-bottom: 20px;
  text-align: center;
}

.logo {
  display: block;
  margin: 0 auto 16px;
  width: 100%;
  height: auto;
}

header h1 {
  color: var(--bcw);
  font-size: 1.6rem;
  margin-bottom: 8px;
  font-weight: 700;
}

header p {
  color: var(--bcw);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ------------------------------
   📖 使い方ガイド
   ------------------------------ */
.guide {
  text-align: center;
  padding: 16px 8px;
  margin-bottom: 28px;
  width: 100%;
}

.guide h2 {
  color: var(--bcw);
  font-size: 1.1rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.guide ol {
  list-style: decimal;
  padding-left: 1.4em;
  text-align: left;
  display: inline-block;
  margin: 0;
  color: var(--bcw);
}

.guide li {
  font-size: 0.9rem;
  margin-bottom: 6px;
  line-height: 1.6;
}

/* ------------------------------
   🧾 フォーム共通設定
   ------------------------------ */
form {
  width: 94%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

input, textarea, select, button {
  font-family: inherit;
  font-size: 1rem;
  border-radius: 12px;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

input, select, button {
  background-color: var(--bcw);
  padding: 16px 20px;
}

/* テキスト入力時の文字色 */
input, textarea {
  color: #000;
}

/* フォーカス時 */
input:focus, select:focus {
  border-color: var(--bcp);
  outline: none;
  box-shadow: 0 0 0 2px rgba(82,99,162,0.25);
}

/* ------------------------------
   ⬇️ プルダウン（セレクト）調整
   ------------------------------ */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid #ccc;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%235263a2' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 20px;
  cursor: pointer;
}

select:invalid { color: #999; }
select:valid { color: #000; }
select option { color: #000; }

/* プレースホルダー */
::placeholder {
  color: #999;
  opacity: 1;
}

/* ------------------------------
   🎥 カメラ・ライブラリ選択ボタン群
   ------------------------------ */
.file-button-group {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  width: 80%;
}

/* 実際にボタンとして表示 */
.custom-file-button {
  background-color: var(--bcw);
  color: var(--bcp);
  font-weight: bold;
  padding: 14px 18px;
  border-radius: 24px;
  cursor: pointer;
  text-align: center;
  width: 48%;
  box-sizing: border-box;
  transition: background-color 0.2s, transform 0.1s;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  border: none;
  user-select: none;
}

.custom-file-button:hover {
  background-color: color-mix(in srgb, var(--bcp) 85%, white);
}

.custom-file-button:active {
  transform: scale(0.97);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* モバイルでは全幅に */
@media (max-width: 480px) {
  .custom-file-button {
    width: 100%;
  }
}

/* ------------------------------
   ☑️ 同意チェックボックスブロック
   ------------------------------ */
.consent-box {
  width: 100%;
  text-align: center;
  background-color: var(--bcw);
  border-radius: 12px;
  padding: 18px 12px;
  color: var(--bcp);
  box-sizing: border-box;
}

.consent-box p {
  font-size: 0.9rem;
  margin-bottom: 10px;
  line-height: 1.5;
  text-align: left;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--bcp);
}

/* ------------------------------
   🟣 分析ボタン（submitBtn）
   ------------------------------ */
#submitBtn {
  background-color: var(--bcw);
  color: var(--bcp);
  font-weight: bold;
  padding: 14px 18px;
  border-radius: 24px; /* ✅ カメラボタンと同じ丸み */
  cursor: pointer;
  text-align: center;
  width: 100%; /* ✅ 中央寄せ・幅を統一 */
  max-width: 320px;
  box-sizing: border-box;
  transition: background-color 0.2s, transform 0.1s;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  border: none;
  user-select: none;
}

#submitBtn:hover {
  background-color: color-mix(in srgb, var(--bcp) 85%, white);
}

#submitBtn:active {
  transform: scale(0.97);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

#submitBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* ------------------------------
   💬 メッセージ表示
   ------------------------------ */
#message {
  text-align: center;
  margin-top: 10px;
  font-weight: 600;
  color: var(--bcw);
  font-size: 0.9rem;
  min-height: 1.5em;
}

/* ------------------------------
   🦶 フッター
   ------------------------------ */
footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--bcw);
  margin: 16px 0;
}

/* ------------------------------
   📱 iPhone（～480px）
   ------------------------------ */
@media (max-width: 480px) {
  main {
    margin: 8px;
    padding: 36px 20px;
    border-radius: 12px;
  }

  header h1 {
    font-size: 1.35rem;
  }

  input, select, button {
    font-size: 0.95rem;
    padding: 10px 12px;
  }

  .custom-file-button {
    width: 100%;
  }
}

/* ------------------------------
   💻 iPad・タブレット（768〜1024px）
   ------------------------------ */
@media (min-width: 768px) and (max-width: 1024px) {
  main {
    max-width: 640px;
    padding: 60px 48px;
    border-radius: 20px;
  }

  header h1 {
    font-size: 1.9rem;
  }

  header p {
    font-size: 1rem;
  }

  input, select, button {
    font-size: 1.05rem;
    padding: 14px;
  }

  .custom-file-button {
    width: 46%;
  }
}

/* ------------------------------
   🖥️ PC（1025px〜）
   ------------------------------ */
@media (min-width: 1025px) {
  main {
    max-width: 720px;
    padding: 48px 56px;
    border-radius: 22px;
  }

  header h1 {
    font-size: 2.1rem;
  }

  header p {
    font-size: 1.05rem;
  }

  .custom-file-button {
    width: 45%;
  }
}