/*
=====================================
フォームページ専用CSS
form.php用スタイル
=====================================
*/

/* ========================================
   フォームレイアウト
======================================== */
.subpage {
  width: 100%;
}

.form-block {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

#wide-title {
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  padding: 20px;
  background-color: var(--color-primary, #0095d8);
  color: white;
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
}

#wide-attention {
  text-align: center;
  padding: 10px;
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
  border-top: none;
  border-radius: 0 0 8px 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

/* ========================================
   エラー表示
======================================== */
.error {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.error ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.error li {
  color: #721c24;
  padding: 5px 0;
  padding-left: 20px;
  position: relative;
}

.error li::before {
  content: "⚠";
  position: absolute;
  left: 0;
  font-weight: bold;
}

/* ========================================
   フォームテーブル
======================================== */
#form-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
  background-color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

#form-table th {
  background-color: #E0FFFF;
  font-weight: bold;
  text-align: center;
  padding: 15px;
  border: 1px solid #ccc;
  width: 200px;
  vertical-align: middle;
}

#form-table th span {
  color: #f00;
  font-weight: bold;
  margin-right: 5px;
}

#form-table td {
  background-color: white;
  padding: 15px 20px;
  border: 1px solid #ccc;
}

#form-table tr:hover {
  background-color: #f9f9f9;
}

/* ========================================
   フォーム入力要素
======================================== */
#form-table input[type="text"],
#form-table input[type="email"],
#form-table input[type="tel"],
#form-table textarea,
#form-table select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#form-table input[type="text"]:focus,
#form-table input[type="email"]:focus,
#form-table input[type="tel"]:focus,
#form-table textarea:focus,
#form-table select:focus {
  outline: none;
  border-color: var(--color-primary, #0095d8);
  box-shadow: 0 0 0 3px rgba(0, 149, 216, 0.1);
}

#form-table textarea {
  min-height: 120px;
  resize: vertical;
}

/* エラー状態 */
#form-table input.error-field,
#form-table textarea.error-field,
#form-table select.error-field {
  border-color: #dc3545;
  background-color: #fff5f5;
}

#form-table input.error-field:focus,
#form-table textarea.error-field:focus,
#form-table select.error-field:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* 成功状態 */
#form-table input.success-field,
#form-table textarea.success-field,
#form-table select.success-field {
  border-color: #28a745;
}

/* ========================================
   ラジオボタン・チェックボックス
======================================== */
#form-table input[type="radio"],
#form-table input[type="checkbox"] {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

#form-table .check-box ul,
#form-table #sex ul,
#form-table #movein ul,
#form-table #affiliation ul,
#form-table #type ul {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

#form-table .check-box li,
#form-table #sex li,
#form-table #movein li,
#form-table #affiliation li,
#form-table #type li {
  display: flex;
  align-items: center;
}

#form-table .check-box label,
#form-table #sex label,
#form-table #movein label,
#form-table #affiliation label,
#form-table #type label {
  cursor: pointer;
  display: flex;
  align-items: center;
  user-select: none;
}

/* ========================================
   入力欄のサイズ調整
======================================== */
#bukken-name input {
  max-width: 500px;
}

.tel input,
.mail input {
  max-width: 350px;
}

.zip input {
  max-width: 200px;
}

.full-name ul {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.full-name input {
  max-width: 200px;
}

/* ========================================
   ボタン（v3: 送信ボタンを大きく目立たせる）
======================================== */
.contact-button {
  text-align: center;
  margin: 40px auto;
}

/* 送信誘導メッセージ */
.submit-guidance {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  color: #d32f2f;
  margin-bottom: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  border: 3px solid #ff9800;
  border-radius: 12px;
  animation: pulse-border 2s ease-in-out infinite;
}

.submit-guidance i {
  font-size: 24px;
  margin-right: 10px;
  color: #ff5722;
}

@keyframes pulse-border {
  0%, 100% {
    border-color: #ff9800;
    box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.4);
  }
  50% {
    border-color: #ff5722;
    box-shadow: 0 0 0 10px rgba(255, 152, 0, 0);
  }
}

.contact-button button,
.contact-button input[type="submit"] {
  min-width: 280px;
  padding: 20px 50px;
  font-size: 20px;
  font-weight: bold;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.contact-button button::before,
.contact-button input[type="submit"]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.contact-button button:hover::before,
.contact-button input[type="submit"]:hover::before {
  width: 300px;
  height: 300px;
}

.contact-button button:hover,
.contact-button input[type="submit"]:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.contact-button button:active,
.contact-button input[type="submit"]:active {
  transform: translateY(0);
}

/* 送信ボタン（目立つデザイン） */
.contact-button button[name="button"],
.contact-button input[type="submit"] {
  background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(229, 57, 53, 0.4);
  animation: button-glow 2s ease-in-out infinite;
}

@keyframes button-glow {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.4);
  }
  50% {
    box-shadow: 0 4px 25px rgba(229, 57, 53, 0.6);
  }
}

.contact-button button[name="button"]:hover,
.contact-button input[type="submit"]:hover {
  background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
}

/* 戻るボタン */
.contact-button button[type="button"] {
  background-color: #6c757d;
  color: white;
  min-width: 200px;
  padding: 15px 40px;
  font-size: 16px;
}

.contact-button button[type="button"]:hover {
  background-color: #5a6268;
}

/* ボタンテーブル */
#button-table {
  margin: 30px auto;
}

#button-table table {
  margin: auto;
  border-collapse: collapse;
}

#button-table td {
  padding: 10px;
  text-align: center;
}

/* ========================================
   完了画面
======================================== */
.form-end {
  max-width: 700px;
  margin: 50px auto;
  padding: 40px;
  background-color: #d4edda;
  border: 2px solid #c3e6cb;
  border-radius: 12px;
  text-align: center;
}

.form-end p {
  margin-bottom: 20px;
  line-height: 1.8;
  font-size: 16px;
}

.form-end p:last-child {
  margin-bottom: 0;
}

/* ========================================
   プライバシーポリシー
======================================== */
#privacy {
  font-size: 14px;
  text-align: center;
  margin: 20px auto;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

#privacy a {
  color: var(--color-primary, #0095d8);
  text-decoration: underline;
}

/* ========================================
   reCAPTCHAバッジ調整
======================================== */
.grecaptcha-badge {
  z-index: 100;
}

/* ========================================
   リアルタイムバリデーション表示
======================================== */
.field-error-message {
  color: #dc3545;
  font-size: 13px;
  margin-top: 5px;
  display: none;
}

.field-error-message.show {
  display: block;
}

.field-success-message {
  color: #28a745;
  font-size: 13px;
  margin-top: 5px;
  display: none;
}

.field-success-message.show {
  display: block;
}

/* ========================================
   ローディング表示
======================================== */
.form-loading {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.form-loading.show {
  display: flex;
}

.form-loading-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
}

.form-loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--color-primary, #0095d8);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ========================================
   レスポンシブ（SP）
======================================== */
@media (max-width: 768px) {
  .form-block {
    padding: 10px;
  }
  
  #wide-title {
    font-size: 20px;
    padding: 15px 10px;
  }
  
  #form-table th {
    display: block;
    width: 100%;
    text-align: left;
    border-bottom: none;
  }
  
  #form-table td {
    display: block;
    width: 100%;
    border-top: none;
    padding: 10px 15px 20px;
  }
  
  #form-table tr {
    display: block;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
  }
  
  #form-table .check-box ul,
  #form-table #sex ul,
  #form-table #type ul {
    flex-direction: column;
    gap: 10px;
  }
  
  .full-name ul {
    flex-direction: column;
  }
  
  .full-name input,
  #bukken-name input,
  .tel input,
  .mail input,
  .zip input {
    max-width: 100%;
  }
  
  .contact-button button,
  .contact-button input[type="submit"] {
    min-width: 150px;
    padding: 12px 30px;
    font-size: 15px;
  }
  
  #button-table table {
    width: 100%;
  }
  
  #button-table td {
    display: block;
    width: 100%;
    padding: 5px;
  }
  
  .form-end {
    padding: 30px 20px;
    margin: 30px 10px;
  }
}
