/* Reset & Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary-color: #56c0cf;
  --primary-hover: #42a9b7;
  --primary-light: #e8f6f8;
  --primary-lighter: #f0f9fa;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --warning-color: #f38630;
  --accent-color: #1C65B0;
  --background: #f9f9f9;
  --surface: #ffffff;
  --text-primary: #383838;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-color: #dddddd;
  --border-light: #88d3dd;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0px 0px 10px rgba(0, 0, 0, 0.2);
  --radius-sm: 5px;
  --radius-md: 10px;
  --radius-lg: 20px;
  --radius-full: 90px;
  --transition: all 0.3s ease;
}

body {
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  background: var(--primary-lighter);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  line-height: 1.6;
  color: var(--text-primary);
}

/* Main Container */
.diagnosis-container {
  width: 100%;
  max-width: 700px;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Header */
.diagnosis-header {
  background: var(--primary-color);
  color: white;
  padding: 40px 30px;
  text-align: center;
  position: relative;
}

.diagnosis-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #88d3dd, var(--primary-color));
}

.diagnosis-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.diagnosis-header .subtitle {
  font-size: 0.95rem;
  opacity: 0.95;
  font-weight: 500;
}

/* Progress Bar */
.progress-container {
  padding: 20px 30px;
  background: var(--surface);
  border-bottom: 3px solid var(--primary-color);
}

.progress-bar {
  height: 8px;
  background: #c8e8ec;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: var(--primary-color);
  border-radius: var(--radius-full);
  width: 20%;
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 0.9rem;
  color: var(--primary-color);
  font-weight: 600;
}

/* Form */
.diagnosis-form {
  padding: 40px 30px;
  background: var(--primary-lighter);
}

/* Steps */
.step {
  display: none;
  animation: fadeIn 0.4s ease;
}

.step.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.question-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 28px;
  color: var(--primary-color);
  padding-bottom: 12px;
  border-bottom: 3px solid var(--primary-color);
}

/* Options */
.options {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.option {
  display: block;
  cursor: pointer;
}

.option input[type="radio"],
.option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.option-content {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  background: var(--surface);
}

.option:hover .option-content {
  border-color: var(--primary-color);
  background: var(--primary-light);
}

.option input[type="radio"]:checked + .option-content,
.option input[type="checkbox"]:checked + .option-content {
  border-color: var(--primary-color);
  background: var(--primary-light);
  box-shadow: inset 0 0 0 2px var(--primary-color);
}

.option input[type="radio"]:focus + .option-content,
.option input[type="checkbox"]:focus + .option-content {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.option-number {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-right: 10px;
  flex-shrink: 0;
}

.option-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Checkbox indicator for multiple selection */
.checkbox-options .option-content::before {
  content: '';
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  border-radius: 3px;
  flex-shrink: 0;
  transition: var(--transition);
  background: var(--surface);
}

.checkbox-options .option input[type="checkbox"]:checked + .option-content::before {
  background: var(--primary-color);
  border-color: var(--primary-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
  background-size: 16px;
  background-position: center;
  background-repeat: no-repeat;
}

/* Navigation Buttons */
.navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 3px solid #88d3dd;
}

.btn {
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-prev {
  background: var(--surface);
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
}

.btn-prev:not(:disabled):hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-next,
.btn-submit {
  background: var(--surface);
  color: var(--text-primary);
  border: 3px solid var(--primary-color);
  position: relative;
  padding-right: 50px;
}

.btn-next::after,
.btn-submit::after {
  content: '→';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--primary-color);
}

.btn-next:not(:disabled):hover,
.btn-submit:not(:disabled):hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Results Section */
.results-section {
  padding: 40px 30px;
  background: var(--primary-lighter);
  animation: fadeIn 0.5s ease;
}

.result-card {
  text-align: center;
}

/* Result Header */
.result-header {
  margin-bottom: 28px;
}

.result-main-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
  position: relative;
  display: inline-block;
}

.result-main-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100%;
  height: 4px;
  background: #88d3dd;
  border-radius: var(--radius-full);
}

/* Result Summary */
.result-summary {
  background: var(--primary-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-label {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  font-weight: 500;
}

.summary-value {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.1rem;
}

/* Experts Section */
.result-experts {
  margin-bottom: 28px;
  text-align: left;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.experts-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--primary-color);
}

.expert-item {
  display: flex;
  align-items: center;
  padding: 18px;
  background: var(--primary-lighter);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  border-left: 4px solid var(--primary-color);
  transition: var(--transition);
}

.expert-item:hover {
  transform: translateX(4px);
}

.expert-item:last-child {
  margin-bottom: 0;
}

.expert-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: var(--radius-md);
  font-size: 1.6rem;
  margin-right: 18px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.expert-info {
  flex: 1;
}

.expert-name {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
}

.expert-priority {
  background: var(--primary-color);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.expert-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.expert-link {
  color: inherit;
  text-decoration: underline;
}

.expert-link:hover {
  color: var(--primary-color);
}

/* Supplement Section */
.result-supplement {
  background: #fff7f0;
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
  text-align: left;
  border-left: 4px solid var(--warning-color);
}

.supplement-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #c26a1f;
  margin-bottom: 10px;
}

.result-supplement p {
  color: #8b5a2b;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Result Note */
.result-note {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 28px;
  text-align: left;
  border: 1px solid var(--border-color);
}

.result-note p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Result Actions */
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn-retry {
  background: var(--surface);
  color: var(--primary-color);
  border: 3px solid var(--primary-color);
  padding: 16px 32px;
}

.btn-retry:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 480px) {
  body {
    padding: 10px;
    align-items: flex-start;
  }

  .diagnosis-container {
    border-radius: var(--radius-sm);
  }

  .diagnosis-header {
    padding: 28px 20px;
  }

  .diagnosis-header h1 {
    font-size: 1.4rem;
  }

  .progress-container {
    padding: 16px 20px;
  }

  .diagnosis-form {
    padding: 28px 20px;
  }

  .question-title {
    font-size: 1.15rem;
  }

  .option-content {
    padding: 14px 16px;
  }

  .option-text {
    font-size: 0.95rem;
  }

  .btn {
    padding: 12px 24px;
    font-size: 0.95rem;
  }

  .btn-next,
  .btn-submit {
    padding-right: 44px;
  }

  .results-section {
    padding: 28px 20px;
  }

  .result-main-title {
    font-size: 1.3rem;
  }

  .result-summary {
    padding: 20px;
  }

  .summary-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .result-experts {
    padding: 20px;
  }

  .expert-item {
    padding: 14px;
  }

  .expert-icon {
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
    margin-right: 14px;
  }

  .expert-name {
    flex-wrap: wrap;
    font-size: 1rem;
  }

  .expert-desc {
    font-size: 0.85rem;
  }
}
