/**
 * Aska Form - 共通スタイル
 *
 * ベース: apps/wordpress-form/prod/entry.html
 * カラー:
 *   - プライマリ: #2f7fc1
 *   - 必須バッジ: #0094c8
 *   - エラー: #a72323
 *   - 成功: #006a92
 * フォント: 'Hiragino Sans', 'Noto Sans JP', sans-serif
 */

/* ==========================================================================
   基本レイアウト
   ========================================================================== */

.aska-form {
  font-family: 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  color: #1f2933;
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}

.aska-form__inner {
  display: grid;
  gap: 1.5rem;
}

/* ==========================================================================
   フォームグループ
   ========================================================================== */

.aska-form .form-group {
  display: grid;
  gap: 0.5rem;
}

.aska-form .form-group--horizontal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 480px) {
  .aska-form .form-group--horizontal {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* ==========================================================================
   ラベル
   ========================================================================== */

.aska-form label {
  font-weight: 600;
  color: #24303c;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.aska-form .required {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: #fff;
  background: #0094c8;
  border-radius: 999px;
  padding: 0.125rem 0.5rem;
}

.aska-form .optional {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: #666;
  background: #e5e5e5;
  border-radius: 999px;
  padding: 0.125rem 0.5rem;
}

/* ==========================================================================
   入力フィールド
   ========================================================================== */

.aska-form input[type='text'],
.aska-form input[type='email'],
.aska-form input[type='tel'],
.aska-form input[type='date'],
.aska-form select,
.aska-form textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid #cfdbe6;
  border-radius: 10px;
  box-sizing: border-box;
  background: #f8fbff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.aska-form input:focus,
.aska-form select:focus,
.aska-form textarea:focus {
  outline: none;
  border-color: #0094c8;
  box-shadow: 0 0 0 3px rgba(0, 148, 200, 0.1);
  background: #fff;
}

.aska-form input::placeholder,
.aska-form textarea::placeholder {
  color: #9aa5b1;
}

.aska-form input:disabled,
.aska-form select:disabled,
.aska-form textarea:disabled {
  background: #e5e5e5;
  cursor: not-allowed;
}

/* セレクトボックス矢印 */
.aska-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* テキストエリア */
.aska-form textarea {
  min-height: 120px;
  resize: vertical;
}

/* 日付入力 */
.aska-form input[type='date'] {
  padding-right: 0.5rem;
}

/* ==========================================================================
   チェックボックス / ラジオボタン
   ========================================================================== */

.aska-form .checkbox-group,
.aska-form .radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.aska-form .checkbox-item,
.aska-form .radio-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.aska-form .checkbox-item input[type='checkbox'],
.aska-form .radio-item input[type='radio'] {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  cursor: pointer;
  accent-color: #2f7fc1;
}

.aska-form .checkbox-item label,
.aska-form .radio-item label {
  font-weight: 400;
  cursor: pointer;
}

/* モバイルでは縦並び */
@media (max-width: 480px) {
  .aska-form .checkbox-group,
  .aska-form .radio-group {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* ==========================================================================
   送信ボタン
   ========================================================================== */

.aska-form button[type='submit'],
.aska-form .submit-button {
  cursor: pointer;
  padding: 0.85rem 2.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  background: #2f7fc1;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  width: fit-content;
  margin: 1rem auto 0;
  display: block;
  min-width: 200px;
}

.aska-form button[type='submit']:hover,
.aska-form .submit-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(47, 127, 193, 0.2);
}

.aska-form button[type='submit']:active,
.aska-form .submit-button:active {
  transform: translateY(0);
}

.aska-form button[type='submit']:disabled,
.aska-form .submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   メッセージボックス
   ========================================================================== */

.aska-form .message {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  font-size: 0.95rem;
  display: none;
  border: 1px solid transparent;
}

.aska-form .message--visible {
  display: block;
}

.aska-form .message--success {
  display: block;
  background: #e6f7ff;
  border-color: #8bd4f6;
  color: #006a92;
}

.aska-form .message--error {
  display: block;
  background: #fff5f5;
  border-color: #f5a0a0;
  color: #a72323;
}

.aska-form .message--info {
  display: block;
  background: #f0f8ff;
  border-color: #b8d4f0;
  color: #2f7fc1;
}

/* フィールド単位のエラー */
.aska-form .field-error {
  color: #a72323;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.aska-form input.error,
.aska-form select.error,
.aska-form textarea.error {
  border-color: #f5a0a0;
  background: #fff5f5;
}

/* ==========================================================================
   サンクス表示
   ========================================================================== */

.aska-form .thanks {
  text-align: center;
  padding: 2rem 1rem;
}

.aska-form .thanks__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: #e6f7ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aska-form .thanks__icon svg {
  width: 32px;
  height: 32px;
  color: #006a92;
}

.aska-form .thanks__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #24303c;
  margin-bottom: 0.5rem;
}

.aska-form .thanks__text {
  color: #52606d;
  line-height: 1.6;
}

/* ==========================================================================
   条件付き表示フィールド
   ========================================================================== */

.aska-form .conditional-fields {
  display: none;
}

.aska-form .conditional-fields--visible {
  display: grid;
  gap: 1.5rem;
  animation: fadeIn 0.3s ease;
}

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

/* ==========================================================================
   ヘルプテキスト
   ========================================================================== */

.aska-form .help-text {
  font-size: 0.85rem;
  color: #7b8794;
  margin-top: 0.25rem;
}

/* ==========================================================================
   レスポンシブ対応
   ========================================================================== */

/* タップ領域確保 */
@media (max-width: 768px) {
  .aska-form input[type='text'],
  .aska-form input[type='email'],
  .aska-form input[type='tel'],
  .aska-form input[type='date'],
  .aska-form select,
  .aska-form textarea {
    min-height: 44px;
  }

  .aska-form button[type='submit'],
  .aska-form .submit-button {
    min-height: 44px;
    width: 100%;
  }

  .aska-form .checkbox-item,
  .aska-form .radio-item {
    min-height: 44px;
  }
}

/* ==========================================================================
   ローディング状態
   ========================================================================== */

.aska-form.is-loading {
  position: relative;
  pointer-events: none;
}

.aska-form.is-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   フォーム非表示（送信完了後）
   ========================================================================== */

.aska-form .form-content--hidden {
  display: none;
}

/* ==========================================================================
   2段階フォーム ステップ切替
   ========================================================================== */

/* ステップ非表示 */
.aska-form.aska-form--hidden {
  display: none;
}

/* ステップ表示（明示的） */
.aska-form.aska-form--visible {
  display: block;
}

/* ステップ切替アニメーション */
.aska-form.aska-form--visible {
  animation: stepFadeIn 0.4s ease;
}

@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ステップインジケーター（オプション） */
.aska-step-indicator {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.aska-step-indicator__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #9aa5b1;
}

.aska-step-indicator__item.active {
  color: #2f7fc1;
  font-weight: 600;
}

.aska-step-indicator__item.completed {
  color: #006a92;
}

.aska-step-indicator__number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  background: #e5e5e5;
  color: #666;
}

.aska-step-indicator__item.active .aska-step-indicator__number {
  background: #2f7fc1;
  color: #fff;
}

.aska-step-indicator__item.completed .aska-step-indicator__number {
  background: #006a92;
  color: #fff;
}

.aska-step-indicator__item.completed .aska-step-indicator__number::before {
  content: '✓';
}

/* ==========================================================================
   アクセシビリティ
   ========================================================================== */

.aska-form *:focus-visible {
  outline: 2px solid #2f7fc1;
  outline-offset: 2px;
}

/* スクリーンリーダー用非表示テキスト */
.aska-form .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   STC FV内フォーム（コンパクト版）
   詳細度を上げるため .fv を追加
   ========================================================================== */

/* .fv_form 自体に幅を設定（親のalign-items:centerで縮小されるのを防ぐ） */
.fv .fv_form {
  width: 100% !important;
}

/* FV内フォームコンテナ - 詳細度を上げて確実に適用 */
.fv .fv_form .aska-form,
.fv_form .aska-form {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.fv .fv_form .aska-form__inner,
.fv_form .aska-form__inner {
  gap: 1rem;
}

/* ラベル */
.fv .fv_form .aska-form label,
.fv_form .aska-form label {
  font-size: 0.9rem;
  gap: 0.4rem;
}

.fv .fv_form .aska-form .required,
.fv .fv_form .aska-form .optional,
.fv_form .aska-form .required,
.fv_form .aska-form .optional {
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
}

/* 入力フィールド */
.fv .fv_form .aska-form input[type='text'],
.fv .fv_form .aska-form input[type='email'],
.fv .fv_form .aska-form input[type='tel'],
.fv .fv_form .aska-form select,
.fv_form .aska-form input[type='text'],
.fv_form .aska-form input[type='email'],
.fv_form .aska-form input[type='tel'],
.fv_form .aska-form select {
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
  border-radius: 8px;
  width: 100% !important;
  max-width: 100% !important;
}

/* セレクトボックス矢印位置調整 */
.fv .fv_form .aska-form select,
.fv_form .aska-form select {
  padding-right: 2.25rem;
  background-position: right 0.6rem center;
}

/* 送信ボタン */
.fv .fv_form .aska-form button[type='submit'],
.fv .fv_form .aska-form .submit-button,
.fv_form .aska-form button[type='submit'],
.fv_form .aska-form .submit-button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  width: 100% !important;
  min-width: auto;
  margin-top: 0.75rem;
}

/* メッセージボックス調整 */
.fv .fv_form .aska-form .message,
.fv_form .aska-form .message {
  margin-top: 0.75rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
}

/* フォームグループ間隔調整 */
.fv .fv_form .aska-form .form-group,
.fv_form .aska-form .form-group {
  gap: 0.25rem;
}

/* サンクス表示調整 */
.fv .fv_form .aska-form .thanks,
.fv_form .aska-form .thanks {
  padding: 1rem 0.5rem;
}

.fv .fv_form .aska-form .thanks__icon,
.fv_form .aska-form .thanks__icon {
  width: 48px;
  height: 48px;
  margin-bottom: 0.75rem;
}

.fv .fv_form .aska-form .thanks__icon svg,
.fv_form .aska-form .thanks__icon svg {
  width: 24px;
  height: 24px;
}

.fv .fv_form .aska-form .thanks__title,
.fv_form .aska-form .thanks__title {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.fv .fv_form .aska-form .thanks__text,
.fv_form .aska-form .thanks__text {
  font-size: 0.85rem;
}

/* ==========================================================================
   STC 下部フォームセクション
   ========================================================================== */

.sec-form__title {
  text-align: center;
  margin-bottom: 1.5rem;
}

.sec-form__title .--text01 {
  display: block;
  font-size: 1.75rem;
  color: #2f7fc1;
  margin-bottom: 0.5rem;
}

.sec-form__title .--text01 strong {
  font-weight: 700;
}

.sec-form__title .--text02 {
  display: block;
  font-size: 1rem;
  color: #333;
}
