/* フォームセクション */
.form-section {
  margin-bottom: 3rem;
  padding: 2rem;
  border: 2px solid #ddd;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
}

.section-header {
  margin-bottom: 2rem;
  text-align: center;
}

.section-header h2 {
  font-size: 1.5rem;
  color: #000;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* フォームグリッド */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  position: relative;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

/* 住所フィールドのレスポンシブレイアウト */
@media (min-width: 768px) {
  .form-grid .address-row:nth-of-type(1) {
    grid-column: 1;
  }

  .form-grid .address-row:nth-of-type(2) {
    grid-column: 2;
  }
}

.input-field[readonly] {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

/* ラベル */
.field-label {
  font-weight: 600;
  color: #000;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.field-label.required::after {
  content: " *";
  color: #000;
  font-weight: bold;
}

/* フィールド注意文 */
.field-note {
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.25rem;
  line-height: 1.3;
}

/* フィールドエラー表示 */
.field-error {
  font-size: 0.75rem;
  color: #ff4444;
  margin-top: 0.25rem;
  line-height: 1.3;
  font-weight: 500;
}

.input-field.error,
.select-field.error {
  border-color: #ff4444;
  background-color: #fff5f5;
}

/* 入力フィールド */
.input-field,
.select-field {
  padding: 0.875rem 1rem;
  border: 1px solid #000;
  font-size: 1rem;
  background: white;
  /* iOS Safari対応 - ズーム防止のため最小16pxを確保 */
  font-size: max(1rem, 16px);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.input-field:focus,
.select-field:focus {
  outline: none;
  border: 1px solid #000;
}

/* iOS Safari専用修正 - ズーム防止 */
@media screen and (-webkit-min-device-pixel-ratio: 2) {
  .input-field,
  .select-field,
  .prefecture-select,
  .theater-select,
  input[type="text"],
  input[type="tel"],
  input[type="email"],
  input[type="date"],
  input[type="time"],
  select {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100%;
  }
}

/* ファイル入力 */
.file-input-group {
  grid-column: 1 / -1;
}

.file-input {
  padding: 0.75rem;
  border: 1px solid #000;
  background: #fff;
  cursor: pointer;
}

.file-help-text {
  font-size: 0.8rem;
  color: #000;
  margin-top: 0.25rem;
}

/* 画像プレビュー */
.image-preview-container {
  display: none;
}

.image-preview-container.visible {
  display: block;
}

/* プレビュー表示時はファイル入力を隠す */
.file-input-group.has-preview .file-input {
  display: none;
}

.file-input-group.has-preview .file-help-text {
  display: none;
}

.image-preview {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.image-info {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #666;
}

.image-info .filename {
  font-weight: 600;
  color: #000;
}

.image-info .filesize {
  color: #888;
}

.remove-image-btn {
  background: #ff4444;
  color: white;
  border: none;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  margin-top: 0.5rem;
  border-radius: 3px;
}

.remove-image-btn:hover {
  background: #cc0000;
}

/* 送信ボタン */
.form-actions {
  text-align: center;
  margin-top: 2rem;
}

.submit-button {
  width: 100%;
  background-color: #ff5196;
  color: white;
  border: none;
  border-radius: 9999px;
  padding: 1rem 3rem;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, opacity 0.3s ease;
}

.submit-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
}

.submit-button.disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
}

.submit-button.loading {
  background: #ff5196;
  cursor: not-allowed;
  opacity: 0.8;
  position: relative;
}

.submit-button.loading::after {
  content: "";
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 10px;
}

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