/* マルチステップフォーム用スタイル */

/* プログレスバー */
.form-progress-container {
  margin: 20px 0;
  padding: 10px 15px;
  background-color: #f7f7f7;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-progress-text {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 8px;
  text-align: center;
  color: #333;
}

.form-progress-text #steps-remaining {
  color: #e74c3c;
  font-size: 18px;
}

.form-progress-bar-container {
  width: 100%;
  height: 10px;
  background-color: #ddd;
  border-radius: 5px;
  overflow: hidden;
}

.form-progress-bar {
  height: 100%;
  background: linear-gradient(to right, #ff5e3a, #ff2a68);
  border-radius: 5px;
  transition: width 0.5s ease;
}

/* フォームステップ */
.form-step {
  display: none;
  animation: fadeIn 0.5s ease;
  padding: 10px;
}

.form-step.active {
  display: block;
}

/* ステップ3に背景とスタイルを追加 */
.form-step.step-3 {
  background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e3e8f0;
}

@media screen and (max-width: 768px) {
  .form-step.step-3 {
    padding: 20px 15px;
    border-radius: 12px;
  }
}

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

.step-title {
  font-size: 26px;
  font-weight: bold;
  margin-bottom: 25px;
  text-align: center;
  color: #003399;
  position: relative;
  padding: 15px;
  letter-spacing: 0.05em;
  text-shadow: none;
  background-color: #f0f7ff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  border-left: 5px solid #003399;
}

.step-title::before {
  content: "▼";
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  color: #ff5b00;
}

@media screen and (max-width: 570px) {
  .step-title {
    font-size: 20px;
    margin-bottom: 20px;
    padding: 10px;
  }
}

/* お客様情報フォームのスタイリング */
.customer-info-form {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

@media screen and (max-width: 768px) {
  .customer-info-form {
    padding: 20px 15px;
  }
}

/* 車両タイプ選択 */
.vehicle-type-selection {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  margin: 20px 0;
}

/* 個人/法人選択 */
.customer-type-selection {
  display: flex;
  gap: 15px;
  margin: 10px 0;
}

.customer-type-btn {
  flex: 1;
  padding: 15px 25px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #333;
}

.customer-type-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.customer-type-btn.selected {
  border-color: #ff5e3a;
  background-color: rgba(255, 94, 58, 0.05);
  box-shadow: 0 3px 10px rgba(255, 94, 58, 0.2);
  color: #ff5e3a;
}

.corporate-only {
  animation: slideDown 0.3s ease;
}

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

.vehicle-type-option {
  width: 30%;
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.vehicle-type-option:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.vehicle-type-option.selected {
  border-color: #ff5e3a;
  background-color: rgba(255, 94, 58, 0.05);
  box-shadow: 0 5px 15px rgba(255, 94, 58, 0.2);
}

.vehicle-type-option img {
  width: 60px;
  height: 60px;
  margin-bottom: 10px;
  transition: transform 0.3s ease;
}

.vehicle-type-option.selected img {
  transform: scale(1.1);
}

.vehicle-type-option p {
  font-weight: bold;
  color: #333;
}

/* ===============================
   モバイル用：車両タイプボタン最適化
   ===============================*/
@media screen and (max-width: 570px) {
  .vehicle-type-selection {
    gap: 10px;                   /* ボタン間の隙間を調整 */
  }

  .vehicle-type-option {
    width: 90%;                  /* 横幅は 1 カラムで余白多め */
    padding: 8px 12px;           /* ← ここが高さを決める主因（元 15px） */
    margin-bottom: 10px;         /* 余白をやや詰める */
  }

  .vehicle-type-option img {
    width: 48px;                 /* サイズを 20 % 減らして全体バランスを保つ */
    height: 48px;
    margin-bottom: 6px;          /* 下余白も圧縮 */
  }

  .vehicle-type-option.selected {
    box-shadow: 0 3px 10px rgba(255, 94, 58, 0.25);  /* モバイルで強すぎない影 */
  }
}


/* フォームフィールド */
.form-row {
  margin-bottom: 20px;
}

.form-row label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.form-row .required-mark {
  color: #e74c3c;
  margin-left: 5px;
}

.form-row select,
.form-row input[type="text"],
.form-row input[type="tel"],
.form-row input[type="email"] {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-row textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.form-row select:focus,
.form-row input[type="text"]:focus,
.form-row input[type="tel"]:focus,
.form-row input[type="email"]:focus,
.form-row textarea:focus {
  border-color: #ff5e3a;
  box-shadow: 0 0 8px rgba(255, 94, 58, 0.4);
  outline: none;
}

.name-inputs {
  display: flex;
  gap: 10px;
}

.name-inputs input {
  width: 50%;
}

.helper-text {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
  line-height: 1.6;
  padding-left: 8px;
  border-left: 2px solid #e0e0e0;
}

/* 基本情報の簡潔な案内（CVR向上） */
.basic-info-notice {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  border-left: 4px solid #ff9800;
  border-radius: 8px;
  padding: 12px 18px;
  margin-bottom: 15px;
}

.basic-info-notice p {
  margin: 0;
  font-size: 14px;
  color: #e65100;
  font-weight: 600;
  line-height: 1.6;
}

.basic-info-notice strong {
  color: #bf360c;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: #ff9800;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

/* ユーザーに寄り添う案内メッセージ（CVR向上） */
.friendly-notice {
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
  border: 3px solid #66bb6a;
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: 0 3px 12px rgba(129, 199, 132, 0.2);
  animation: gentlePulse 2s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

/* 背景の装飾 */
.friendly-notice::before {
  content: '✓';
  position: absolute;
  right: -10px;
  top: -10px;
  font-size: 120px;
  color: rgba(129, 199, 132, 0.08);
  font-weight: bold;
  transform: rotate(15deg);
}

/* メインメッセージ */
.friendly-notice .notice-main {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: #1b5e20;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

/* サブメッセージ */
.friendly-notice .notice-sub {
  margin: 5px 0;
  font-size: 14px;
  color: #2e7d32;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

.friendly-notice .notice-sub:last-child {
  margin-bottom: 0;
}

.friendly-notice strong {
  color: #1b5e20;
  font-weight: 700;
  background: linear-gradient(transparent 60%, rgba(129, 199, 132, 0.3) 60%);
  padding: 0 2px;
}

@keyframes gentlePulse {
  0%, 100% {
    box-shadow: 0 3px 12px rgba(129, 199, 132, 0.2);
    border-color: #66bb6a;
  }
  50% {
    box-shadow: 0 5px 18px rgba(129, 199, 132, 0.35);
    border-color: #4caf50;
  }
}

/* ボタン */
.step-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
}

.next-step-btn,
.prev-step-btn,
.submit-form-btn {
  padding: 12px 25px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  border: none;
}

.next-step-btn {
  background: linear-gradient(45deg, #ff5e3a, #ff2a68);
  color: white;
  flex-grow: 1;
  margin-left: 10px;
}

.next-step-btn:hover:not(.disabled) {
  background: linear-gradient(45deg, #ff2a68, #ff5e3a);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 94, 58, 0.4);
}

.next-step-btn.disabled {
  background: #ccc;
  cursor: not-allowed;
  pointer-events: none; /* タッチイベント干渉防止 */
}

.prev-step-btn {
  background: white;
  color: #333;
  border: 1px solid #ddd;
}

.prev-step-btn:hover {
  background: #f5f5f5;
}

.submit-form-btn {
  background: linear-gradient(45deg, #ff5e3a, #ff2a68);
  color: white;
  position: relative;
  flex-grow: 1;
  margin-left: 10px;
  overflow: hidden;
}

.submit-form-btn.disabled {
  background: #ccc !important;
  cursor: not-allowed;
  pointer-events: none; /* タッチイベント干渉防止 */
  opacity: 0.6;
}

.submit-form-btn:hover {
  background: linear-gradient(45deg, #ff2a68, #ff5e3a);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 94, 58, 0.4);
}

.submit-form-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  70% {
    opacity: 0.3;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

/* インセンティブボックス */
.form-incentive {
  margin: 20px 0;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

@media screen and (max-width: 768px) {
  .form-incentive {
    padding: 15px;
  }
}

.incentive-box {
  background-color: #fff9e6;
  border: 2px dashed #ffc107;
  border-radius: 8px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.incentive-icon {
  width: 40px;
  height: 40px;
}

.incentive-box p {
  margin: 0;
  color: #333;
  font-size: 14px;
}

.highlight {
  color: #ff5e3a;
  font-weight: bold;
  font-size: 1.1em;
}

/* 離脱ポップアップ */
.exit-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.exit-popup-content {
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: popIn 0.5s ease;
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.exit-popup-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  color: #999;
  cursor: pointer;
}

.exit-popup-content h3 {
  font-size: 22px;
  margin-bottom: 15px;
  color: #333;
}

.exit-popup-content p {
  margin-bottom: 15px;
  color: #666;
}

.continue-btn {
  background: linear-gradient(45deg, #ff5e3a, #ff2a68);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.continue-btn:hover {
  background: linear-gradient(45deg, #ff2a68, #ff5e3a);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 94, 58, 0.4);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .vehicle-type-selection {
    flex-direction: column;
    align-items: center;
  }
  
  .vehicle-type-option {
    width: 80%;
    margin-bottom: 15px;
  }
  
  .name-inputs {
    flex-direction: column;
    gap: 15px;
  }
  
  .name-inputs input {
    width: 100%;
  }
  
  .incentive-box {
    flex-direction: column;
    text-align: center;
  }
}

.bonus-text {
  font-size: 14px;
  display: block;
  line-height: 1.3;
}

/* フィールドエラー表示 */
.field-error {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 8px;
  padding: 8px 12px;
  background-color: #fff5f5;
  border-left: 3px solid #e74c3c;
  border-radius: 4px;
  animation: fadeIn 0.3s ease, shake 0.5s ease;
  font-weight: 600;
}

.invalid-field {
  border-color: #e74c3c !important;
  background-color: #fff8f8 !important;
  animation: shake 0.5s ease;
}

.valid-field {
  border-color: #2ecc71 !important;
  background-color: #f8fff8;
}

/* 入力フィールドの検証アニメーション */
.form-row input:focus,
.form-row select:focus {
  animation: pulse-focus 1.5s infinite;
}

@keyframes pulse-focus {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 94, 58, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(255, 94, 58, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 94, 58, 0);
  }
}

/* バリデーション関連の強化スタイル */
.invalid-field {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
}

@keyframes shake {
  10%, 90% {
    transform: translate3d(-1px, 0, 0);
  }
  
  20%, 80% {
    transform: translate3d(2px, 0, 0);
  }

  30%, 50%, 70% {
    transform: translate3d(-4px, 0, 0);
  }

  40%, 60% {
    transform: translate3d(4px, 0, 0);
  }
}

.valid-field {
  transition: all 0.3s ease;
  position: relative;
}

.valid-field::after {
  content: '✓';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #2ecc71;
  font-size: 16px;
  animation: checkmark 0.5s ease-in-out;
}

@keyframes checkmark {
  0% {
    opacity: 0;
    transform: translateY(-50%) scale(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) scale(1.2);
  }
  100% {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}

/* フィールドのフォーカス解除時のアニメーション */
.form-row input:not(:focus):valid,
.form-row select:not(:focus):valid {
  border-color: #2ecc71;
  background-color: #f8fff8;
  transition: all 0.3s ease;
}

.form-row input:not(:focus):invalid,
.form-row select:not(:focus):invalid {
  border-color: #e74c3c;
  background-color: #fff8f8;
  transition: all 0.3s ease;
}

/* 入力完了時のスムーズなトランジション */
.form-row input,
.form-row select {
  transition: border-color 0.3s ease, 
              background-color 0.3s ease, 
              transform 0.2s ease, 
              box-shadow 0.3s ease;
}

.form-row input:hover,
.form-row select:hover {
  border-color: #ff5e3a;
}

/* 必須マークのアニメーション */
.required-mark {
  position: relative;
  display: inline-block;
  animation: pulse-required 2s infinite;
}

@keyframes pulse-required {
  0% {
    color: #e74c3c;
  }
  50% {
    color: #ff8f7f;
  }
  100% {
    color: #e74c3c;
  }
}

/* 次のステップへのボタンのアニメーション */
.next-step-btn:not(.disabled)::before,
.submit-form-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 15px;
  width: 8px;
  height: 8px;
  border-top: 2px solid white;
  border-right: 2px solid white;
  transform: translateY(-50%) rotate(45deg);
  animation: arrow-pulse 1.5s infinite;
}

@keyframes arrow-pulse {
  0% {
    opacity: 0.5;
    right: 20px;
  }
  50% {
    opacity: 1;
    right: 15px;
  }
  100% {
    opacity: 0.5;
    right: 20px;
  }
}

.next-step-btn:not(.disabled),
.submit-form-btn {
  padding-right: 35px;
}

/* 既存フォームとの互換性 */
.show-error {
  color: #e74c3c;
  font-size: 12px;
  margin-top: 5px;
  display: block;
}

/* 既存フォームが表示された場合のスタイル */
.p-form input[type="text"],
.p-form input[type="tel"],
.p-form input[type="email"],
.p-form select,
.p-form textarea {
  transition: border-color 0.3s ease;
}

.p-form input[type="text"]:focus,
.p-form input[type="tel"]:focus,
.p-form input[type="email"]:focus,
.p-form select:focus,
.p-form textarea:focus {
  border-color: #ff5e3a;
  outline: none;
  box-shadow: 0 0 5px rgba(255, 94, 58, 0.3);
}

/* マルチステップフォームと既存フォームの連携スタイル */
.transition-fade {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.transition-fade.show {
  opacity: 1;
}

/* 送信ボタン強調表示 */
.p-form_btnSend_submit,
#multistep-submit {
  position: relative;
  overflow: hidden;
}

.p-form_btnSend_submit::after,
#multistep-submit::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(30deg);
  animation: shine-effect 3s infinite;
}

@keyframes shine-effect {
  0% {
    left: -100%;
  }
  20%, 100% {
    left: 100%;
  }
}

/* フォーカスアウトレイヤー（入力フォーカスを促進するエフェクト） */
.focus-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.focus-layer.show {
  opacity: 1;
  display: block;
}

.focused-field {
  position: relative;
  z-index: 101;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
  transform: scale(1.02);
  transition: all 0.3s ease;
}

/* ========================================
   車両情報フォーム（ステップ2と3の統合）
   ======================================== */

/* 車両情報フォーム全体のコンテナ */
.vehicle-info-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 情報セクション（基本情報、詳細情報） */
.form-section {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  padding: 25px;
  border-radius: 12px;
  border: 2px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.form-section:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #ff5e3a;
}

/* セクションラベル */
.section-label {
  font-size: 18px;
  font-weight: bold;
  color: #ff5e3a;
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 3px solid #ff5e3a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #ff5e3a;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.3);
  }
}

/* 相場表示エリア（統合後も互換性維持） */
.vehicle-info-form .additional-info-form {
  margin-top: 10px;
}

/* レスポンシブデザイン: スマホ */
@media screen and (max-width: 768px) {
  .form-section {
    padding: 20px 15px;
  }

  .section-label {
    font-size: 16px;
    margin-bottom: 15px;
    padding-bottom: 10px;
  }

  .basic-info-notice {
    padding: 10px 15px;
    margin-bottom: 12px;
  }

  .basic-info-notice p {
    font-size: 13px;
  }

  .friendly-notice {
    padding: 15px 18px;
    margin-bottom: 15px;
  }

  .friendly-notice::before {
    font-size: 80px;
    right: -5px;
    top: -5px;
  }

  .friendly-notice .notice-main {
    font-size: 15px;
    margin-bottom: 8px;
  }

  .friendly-notice .notice-sub {
    font-size: 13px;
  }

  .vehicle-info-form {
    gap: 15px;
  }
}

/* レスポンシブデザイン: タブレット以上 */
@media screen and (min-width: 769px) {
  /* PCでは2カラム表示も可能（オプション） */
  /* 必要に応じてコメント解除してください
  .vehicle-info-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  
  .vehicle-info-form .additional-info-form {
    grid-column: 1 / -1;
  }
  */
} 