/**
 * S-CONNECT AI診断モーダルフォーム スタイル
 * 白基調＋ピンク/紫/青グラデーション、大胆なタイポグラフィ
 */

/* ========== モーダルオーバーレイ ========== */
.diagnosis-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.diagnosis-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ========== モーダル本体 ========== */
.diagnosis-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  background: #FFFFFF;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.diagnosis-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* スクロールバースタイリング */
.diagnosis-modal::-webkit-scrollbar {
  width: 8px;
}
.diagnosis-modal::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 0 24px 24px 0;
}
.diagnosis-modal::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #FF3366, #8B5CF6);
  border-radius: 10px;
}
.diagnosis-modal::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #FF6B99, #A78BFA);
}

/* 閉じるボタン */
.diagnosis-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #666;
  transition: all 0.3s ease;
  z-index: 10;
}

.diagnosis-modal-close:hover {
  background: rgba(255, 51, 102, 0.1);
  color: #FF3366;
  transform: rotate(90deg);
}

/* ========== ステップコンテナ ========== */
.diagnosis-step {
  display: none;
  padding: 60px 80px;
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  min-height: auto;
  flex: 1;
}

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

.diagnosis-step.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ========== 診断タイプ選択（ステップ0） ========== */
.diagnosis-header {
  text-align: center;
  margin-bottom: 40px;
}

.diagnosis-header h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(135deg, #FF3366, #8B5CF6, #3B82F6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.diagnosis-header p {
  font-size: 16px;
  color: #666;
}

.diagnosis-type-selection {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.diagnosis-type-card {
  background: #FFFFFF;
  border: 2px solid #E5E7EB;
  border-radius: 20px;
  padding: 40px 30px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
}

.diagnosis-type-card:hover {
  border-color: #FF3366;
  box-shadow: 0 10px 30px rgba(255, 51, 102, 0.2);
  transform: translateY(-5px);
}

.diagnosis-type-card.featured {
  border-color: #FF3366;
  background: linear-gradient(135deg, rgba(255, 51, 102, 0.05), rgba(139, 92, 246, 0.05));
}

.dt-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background: linear-gradient(135deg, #FF3366, #8B5CF6);
  color: #FFFFFF;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.dt-icon {
  font-size: 48px;
  background: linear-gradient(135deg, #FF3366, #8B5CF6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}

.diagnosis-type-card h3 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #111827;
}

.dt-time {
  font-size: 14px;
  color: #6B7280;
  margin-bottom: 16px;
}

.dt-time i {
  color: #FF3366;
  margin-right: 6px;
}

.dt-desc {
  font-size: 15px;
  color: #374151;
  margin-bottom: 24px;
  line-height: 1.6;
}

.dt-features {
  list-style: none;
  padding: 0;
  margin: 0 0 30px 0;
  text-align: left;
}

.dt-features li {
  font-size: 14px;
  color: #4B5563;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.dt-features li i {
  color: #10B981;
  margin-right: 10px;
  font-size: 16px;
}

.dt-features strong {
  color: #FF3366;
  font-weight: 600;
}

/* ========== 進捗バー ========== */
.diagnosis-progress {
  margin-bottom: 40px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #E5E7EB;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF3366, #8B5CF6, #3B82F6);
  border-radius: 10px;
  transition: width 0.4s ease;
  width: 0%;
}

.progress-text {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #6B7280;
}

/* ========== 質問フォーム ========== */
.diagnosis-question {
  margin-bottom: 40px;
}

.diagnosis-question label {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 16px;
}

.diagnosis-question .required {
  color: #FF3366;
  font-size: 14px;
  font-weight: 600;
  margin-left: 8px;
}

.diagnosis-question .optional {
  color: #6B7280;
  font-size: 14px;
  font-weight: 500;
  margin-left: 8px;
}

.diagnosis-question input[type="text"],
.diagnosis-question input[type="email"],
.diagnosis-question input[type="tel"],
.diagnosis-question input[type="url"],
.diagnosis-question select {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  background: #FFFFFF;
  transition: all 0.3s ease;
  font-family: 'Noto Sans JP', sans-serif;
}

.diagnosis-question input:focus,
.diagnosis-question select:focus {
  outline: none;
  border-color: #FF3366;
  box-shadow: 0 0 0 4px rgba(255, 51, 102, 0.1);
}

.diagnosis-question select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1.41 0L6 4.59L10.59 0L12 1.41l-6 6l-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

.input-help {
  font-size: 13px;
  color: #6B7280;
  margin-top: 10px;
  display: flex;
  align-items: flex-start;
}

.input-help i {
  margin-right: 6px;
  margin-top: 2px;
  color: #3B82F6;
}

.input-help.highlight {
  background: rgba(255, 193, 7, 0.1);
  border-left: 3px solid #FFC107;
  padding: 12px 16px;
  border-radius: 8px;
  display: block;
}

.input-help.highlight i {
  color: #FFC107;
}

.input-help.highlight strong {
  color: #F59E0B;
  font-weight: 600;
}

/* チェックボックスグループ */
.checkbox-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #FFFFFF;
}

.checkbox-item:hover {
  border-color: #FF3366;
  background: rgba(255, 51, 102, 0.03);
}

.checkbox-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  cursor: pointer;
  accent-color: #FF3366;
}

.checkbox-item span {
  font-size: 15px;
  color: #374151;
  font-weight: 500;
}

.checkbox-item input[type="checkbox"]:checked + span {
  color: #FF3366;
  font-weight: 600;
}

/* エラーメッセージ */
.error-message {
  background: #FEE2E2;
  color: #DC2626;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 10px;
  display: flex;
  align-items: center;
}

.error-message i {
  margin-right: 8px;
}

/* ========== ナビゲーションボタン ========== */
.diagnosis-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 40px;
}

.btn-secondary {
  padding: 16px 32px;
  background: #F3F4F6;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #6B7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
}

.btn-secondary:hover:not(:disabled) {
  background: #E5E7EB;
  color: #374151;
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  padding: 16px 32px;
  background: linear-gradient(135deg, #FF3366, #8B5CF6);
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  justify-content: center;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255, 51, 102, 0.4);
}

.diagnosis-nav .btn-primary {
  margin-left: auto;
}

/* ========== 送信完了画面 ========== */
.diagnosis-complete {
  text-align: center;
  padding: 60px 40px;
}

.dc-icon {
  font-size: 80px;
  color: #10B981;
  margin-bottom: 30px;
  animation: successBounce 0.6s ease;
}

@keyframes successBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.diagnosis-complete h2 {
  font-size: 32px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 20px;
}

.diagnosis-complete p {
  font-size: 16px;
  color: #6B7280;
  line-height: 1.8;
  margin-bottom: 30px;
}

.diagnosis-complete strong {
  color: #FF3366;
  font-weight: 700;
}

.dc-info {
  background: #F9FAFB;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 30px;
}

.dc-info p {
  font-size: 15px;
  color: #374151;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dc-info p:last-child {
  margin-bottom: 0;
}

.dc-info i {
  margin-right: 10px;
  color: #3B82F6;
  font-size: 18px;
}

/* レポートボタン（完了画面） */
.dc-report-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #FF3366, #8B5CF6);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 16px 36px;
  border-radius: 50px;
  text-decoration: none;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(255,51,102,0.35);
  transition: opacity 0.2s, transform 0.2s;
  animation: pulseCTA 2s ease infinite;
}
.dc-report-btn:hover {
  opacity: 0.88;
  transform: translateY(-2px);
}
@keyframes pulseCTA {
  0%, 100% { box-shadow: 0 8px 24px rgba(255,51,102,0.35); }
  50%       { box-shadow: 0 8px 36px rgba(255,51,102,0.6); }
}
.diagnosis-complete-close-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1.5px solid #e5e7eb;
  color: #6B7280;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}
.diagnosis-complete-close-btn:hover {
  background: #f3f4f6;
}

/* ========== レスポンシブ対応 ========== */
@media (max-width: 768px) {
  .diagnosis-modal {
    width: 95%;
    max-height: 95vh;
    border-radius: 16px;
  }
  
  .diagnosis-step {
    padding: 40px 30px;
    min-height: auto;
  }
  
  .diagnosis-header h2 {
    font-size: 36px;
  }
  
  .diagnosis-type-selection {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .diagnosis-type-card {
    padding: 30px 20px;
  }
  
  .diagnosis-question label {
    font-size: 18px;
  }
  
  .diagnosis-nav {
    flex-direction: column;
  }
  
  .diagnosis-nav .btn-primary {
    margin-left: 0;
  }
  
  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .diagnosis-step {
    padding: 30px 20px;
  }
  
  .diagnosis-header h2 {
    font-size: 28px;
  }
  
  .diagnosis-type-card h3 {
    font-size: 22px;
  }
  
  .dt-icon {
    font-size: 36px;
  }
}
