/* ============================================
   survey.css - エルドラ祭 アンケートフォーム装飾
   ============================================ */

/* フォーム全体のラッパー */
.survey-wrapper {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 15px 30px;
}

/* 各設問ブロック */
.survey-question {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(201, 166, 75, 0.3);
  border-radius: 8px;
  padding: 20px 18px;
  margin-bottom: 20px;
}

/* 設問ラベル行（Q番号 + 必須/任意バッジ） */
.survey-q-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.survey-q-num {
  font-size: 18px;
  font-weight: 700;
  color: #c9a64b;
  letter-spacing: 0.05em;
}

.survey-q-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 3px;
  letter-spacing: 0.05em;
}

.survey-required {
  background: #c83939;
  color: #fff;
}

.survey-optional {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 設問テキスト */
.survey-q-text {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.8;
  color: #fff;
  margin-bottom: 16px;
}

/* 選択肢エリア */
.survey-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}


/* ── ラジオボタン（単一選択） ── */

.survey-radio-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.survey-radio-label:hover {
  background: rgba(201, 166, 75, 0.08);
  border-color: rgba(201, 166, 75, 0.3);
  border: 1px solid rgba(78, 60, 0, 0.76);
}

/* ネイティブinputを隠す */
.survey-radio-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* カスタムラジオ */
.survey-radio-custom {
  display: inline-block;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  position: relative;
  transition: border-color 0.2s;
}

.survey-radio-label input[type="radio"]:checked~.survey-radio-custom {
  border-color: #c9a64b;
}

.survey-radio-label input[type="radio"]:checked~.survey-radio-custom::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: #c9a64b;
  border-radius: 50%;
}

/* 選択時のラベル背景 */
.survey-radio-label:has(input[type="radio"]:checked) {
  background: rgba(124, 91, 7, 0.808);
  border-color: rgba(201, 166, 75, 0.4);
}

.survey-radio-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}


/* ── チェックボックス（複数選択） ── */

.survey-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.survey-checkbox-label:hover {
  background: rgba(201, 166, 75, 0.08);
  border-color: rgba(201, 166, 75, 0.3);
  border: 1px solid rgba(78, 60, 0, 0.76);
}

/* ネイティブinputを隠す */
.survey-checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* カスタムチェックボックス */
.survey-checkbox-custom {
  display: inline-block;
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin-top: 2px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  position: relative;
  transition: border-color 0.2s, background 0.2s;
}

.survey-checkbox-label input[type="checkbox"]:checked~.survey-checkbox-custom {
  border-color: #c9a64b;
  background: #c9a64b;
}

.survey-checkbox-label input[type="checkbox"]:checked~.survey-checkbox-custom::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 5px;
  width: 6px;
  height: 10px;
  border: solid #111;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* 選択時のラベル背景 */
.survey-checkbox-label:has(input[type="checkbox"]:checked) {
  background: rgba(124, 91, 7, 0.808);
  border-color: rgba(201, 166, 75, 0.4);
}

.survey-checkbox-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}


/* ── テキスト入力 ── */

input[type="text"] {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

input[type="text"]:focus {
  border-color: #c9a64b;
  box-shadow: 0 0 0 2px rgba(201, 166, 75, 0.2);
}



.survey-input-wrap {
  margin-top: 4px;
}

.survey-input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.survey-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.survey-input:focus {
  border-color: #c9a64b;
  box-shadow: 0 0 0 2px rgba(201, 166, 75, 0.2);
}


/* ── エラーメッセージ ── */

.survey-error {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.survey-error b {
  color: #c83939;
}


/* ── :has() 非対応ブラウザ用フォールバック ── */
/* 必要に応じてJSで .is-checked クラスを付与 */
.survey-radio-label.is-checked,
.survey-checkbox-label.is-checked {
  background: rgba(201, 166, 75, 0.12);
  border-color: rgba(201, 166, 75, 0.4);
}


/* ── レスポンシブ ── */

@media screen and (max-width: 480px) {
  .survey-wrapper {
    padding: 15px 10px 25px;
  }

  .survey-question {
    padding: 16px 14px;
  }

  .survey-q-text {
    font-size: 13px;
  }

  .survey-radio-text,
  .survey-checkbox-text {
    font-size: 13px;
  }

  .survey-radio-label,
  .survey-checkbox-label {
    padding: 8px 12px;
    gap: 10px;
  }

  .survey-input {
    font-size: 14px;
    padding: 10px 12px;
  }
}