/* ------------------------------------------- */
/* My Advanced Contact Form Basic Styles
/* ------------------------------------------- */

/* フォーム全体 */
.sacf-form {
  max-width: 600px; /* PCでの最大幅 */
  margin: 0 auto;
  font-size: 16px;
}

/* 各項目（ラベルと入力欄のセット） */
.sacf-form__item {
  background-color: #f7f7f7;
  border: 1px solid #ddd;
  border-radius: 5px;
  margin-bottom: 20px;
  padding: 15px;
}

/* ラベル */
.sacf-form__label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}

/* ラベルタグ（必須/任意） */
.sacf-form__label-tag {
  display: inline-block;
  color: #fff;
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 3px;
  margin-right: 8px;
}
.sacf-form__label-tag--required {
  background-color: #555; /* 必須の色 */
}
.sacf-form__label-tag--optional {
  background-color: #888; /* 任意の色 */
}

/* 入力コントロール（input, textarea, selectのラッパー） */
.sacf-form__control input[type="text"],
.sacf-form__control input[type="email"],
.sacf-form__control input[type="tel"],
.sacf-form__control textarea,
.sacf-form__control select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  font-size: 16px;
  box-sizing: border-box; /* paddingを含めてwidthを100%に */
}

.sacf-form__control select {
  /* selectの矢印スタイル */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%208l5%205%205-5%22%20stroke%3D%22%23555%22%20stroke-width%3D%222%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 35px; /* 矢印のスペースを確保 */
}

/* チェックボックス */
.sacf-form__acceptance {
  text-align: center;
  margin: 25px 0;
}
.sacf-form__acceptance label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.sacf-form__acceptance input[type="checkbox"] {
  margin-right: 10px;
  width: 18px;
  height: 18px;
}

/* 送信ボタン */
.sacf-form__submit {
  text-align: center;
}
.sacf-form__submit button {
  background-color: #5a7b80; /* デザインに近い色 */
  color: #fff;
  border: none;
  padding: 15px 40px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  transition: opacity 0.3s;
}
.sacf-form__submit button:hover {
  opacity: 0.8;
}

/* 送信後のメッセージ */
.sacf-response-output {
  margin-bottom: 20px;
  padding: 15px;
  border-radius: 5px;
  text-align: center;
}
.sacf-response-output p {
  margin: 0;
}

/* PC用のスタイル調整 (768px以上) */
@media (min-width: 768px) {
  .sacf-form {
    max-width: 100%; /* 例: PCでは最大幅を900pxに広げる */
  }
  .sacf-form__item {
    display: flex;
    align-items: flex-start; /* 上揃え */
    padding: 0;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid #ddd; /* 線を下に */
  }
  .sacf-form__label {
    width: 30%; /* ラベルの幅 */
    padding: 20px;
    background-color: #f7f7f7;
    margin-bottom: 0;
  }
  .sacf-form__control {
    width: 70%; /* 入力欄の幅 */
    padding: 20px;
  }
  .sacf-form__control input[type="text"],
  .sacf-form__control input[type="email"],
  .sacf-form__control input[type="tel"],
  .sacf-form__control textarea {
    /* こちらが基準となるスタイル */
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    font-size: 16px;
    box-sizing: border-box; /* 必須 */
  }
  .sacf-form__control textarea {
    height: 15em; /* PCでの高さを調整 */
  }
  .sacf-form__control select {
    width: 100%;
    height: 42px; /* inputの高さ (10+10+1+1+16) に合わせる */
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    font-size: 16px;
    box-sizing: border-box;
    padding-top: 0;
    padding-left: 10px; /* padding-top/bottomはheightで制御するため左右のみ指定 */
    padding-right: 35px; /* 矢印のスペースを確保 */

    /* 矢印のスタイル */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%208l5%205%205-5%22%20stroke%3D%22%23555%22%20stroke-width%3D%222%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
  }
}

/* ==================================================
   エラー表示用スタイル
================================================== */

/* エラーになった入力フィールドの強調 */
.sacf-form__control .sacf-invalid-field {
  border: 2px solid #d9534f !important;
  background-color: #fff9f9 !important;
}

/* 項目ごとのエラーメッセージ（チップ） */
.sacf-error-tip {
  color: #d9534f;
  font-size: 0.85em;
  font-weight: bold;
  display: block;
  margin-top: 5px;
  line-height: 1.4;
  /* ふわっと表示させるアニメーション */
  animation: sacfFadeIn 0.3s ease-out forwards;
}

/* 同意チェックボックスのエラー表示位置の微調整 */
.sacf-form__acceptance .sacf-error-tip {
  text-align: center;
  margin-top: 10px;
}

@keyframes sacfFadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================================================
   全体メッセージ
================================================== */
.sacf-response-output {
  margin-bottom: 20px;
  padding: 15px;
  border-radius: 5px;
  text-align: center;
  font-weight: bold;
  display: none; /* 初期状態は非表示 */
}

/* is-active クラスがついた時だけ表示 */
.sacf-response-output.is-active {
  display: block;
}

.sacf-response-output.success {
  background-color: #dff0d8;
  color: #3c763d;
  border: 1px solid #d6e9c6;
}

.sacf-response-output.error {
  background-color: #f2dede;
  color: #a94442;
  border: 1px solid #ebccd1;
}

.sacf-response-output p {
  margin: 0;
}
