/* ============================================================
   退職金相場シミュレーター — スタイルシート
   カラー: #7c3aed (Purple / 学習・教育ジャンル)
   ============================================================ */

:root {
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-rgb: 124, 58, 237;
  --primary-light: #ede9fe;
  --bg: #f9f7f4;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --text-weak: #9ca3af;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
  --transition: 0.15s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'BIZ UDPGothic', -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* ============================================================
   ヘッダー
   ============================================================ */
header {
  background: linear-gradient(135deg, var(--primary) 0%, #6d28d9 100%);
  color: #fff;
  padding: 1.75rem 1.25rem 1.5rem;
  text-align: center;
}

.header-inner {
  max-width: 760px;
  margin: 0 auto;
}

.header-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

header h1 {
  font-family: 'Outfit', 'BIZ UDPGothic', sans-serif;
  font-size: clamp(1.1rem, 3.5vw, 1.6rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.header-sub {
  font-size: 0.875rem;
  opacity: 0.88;
  margin-top: 0.4rem;
}

/* ============================================================
   メインコンテナ
   ============================================================ */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

@media (min-width: 640px) {
  main {
    padding: 1.75rem 1.5rem;
  }
}

/* ============================================================
   広告ユニット
   ============================================================ */
.ad-unit {
  min-height: 0;
  background: #f0ebff;
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a78bfa;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px dashed #c4b5fd;
}

/* ============================================================
   プライバシー通知
   ============================================================ */
.privacy-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #ede9fe;
  border: 1px solid #c4b5fd;
  border-radius: var(--radius-sm);
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  color: #5b21b6;
  margin-bottom: 1rem;
}

.privacy-notice i {
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* ============================================================
   カード
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
  margin-bottom: 1rem;
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

@media (min-width: 640px) {
  .card {
    padding: 1.5rem;
  }
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.section-title i {
  color: var(--primary);
}

/* ============================================================
   入力フォーム
   ============================================================ */
.input-card {
  margin-bottom: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1.25rem;
}

.field-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.field-label i {
  color: var(--primary);
  font-size: 0.875rem;
}

.field-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* スライダー */
.slider-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--slider-percent, 43%), #e2e8f0 var(--slider-percent, 43%), #e2e8f0 100%);
  outline: none;
  cursor: pointer;
  min-height: 44px;
  padding: 0;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: var(--primary);
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(124,58,237,0.35);
  cursor: pointer;
  transition: transform var(--transition);
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--primary);
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(124,58,237,0.35);
  cursor: pointer;
}

.slider-value-wrap {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.years-input {
  width: 64px;
  padding: 0.4rem 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: var(--primary);
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  min-height: 44px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.years-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.unit-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* セレクト */
.form-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  font-family: 'BIZ UDPGothic', sans-serif;
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

/* ============================================================
   ボタン
   ============================================================ */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'BIZ UDPGothic', sans-serif;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 52px;
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.35);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  margin-top: 0.25rem;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.40);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(var(--primary-rgb), 0.30);
}

/* ============================================================
   計算結果エリア
   ============================================================ */
.results-area {
  margin-top: 0.5rem;
}

/* メイン結果カード */
.result-main-card {
  background: linear-gradient(135deg, #faf5ff, #f3e8ff);
  border: 1px solid #d8b4fe;
}

.result-main-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.result-main-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.result-main-header h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 0.2rem;
}

.result-condition-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.result-amount-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.result-amount {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.result-unit {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
}

.result-range-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.result-note { font-size: 0.8rem; color: #6b7280; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid #e5e7eb; }

/* 内訳カード */
.breakdown-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #fafafa;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.breakdown-item.highlight-item {
  background: linear-gradient(135deg, #faf5ff, #f3e8ff);
  border-color: #d8b4fe;
}

.breakdown-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.breakdown-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.breakdown-value.deduction {
  color: #059669;
}

.breakdown-value.taxable {
  color: #d97706;
}

.breakdown-value.tax {
  color: #dc2626;
}

.breakdown-value.take-home {
  color: var(--primary);
  font-size: 1.3rem;
}

/* ============================================================
   グラフ
   ============================================================ */
.chart-wrapper {
  position: relative;
  width: 100%;
  max-height: 300px;
}

.chart-wrapper canvas {
  width: 100% !important;
}

/* ============================================================
   使い方・SEOセクション
   ============================================================ */
.howto-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
  margin-top: 1rem;
}

@media (min-width: 640px) {
  .howto-section {
    padding: 1.75rem 1.5rem;
  }
}

.howto-section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--primary-light);
}

.howto-section h2:first-child {
  margin-top: 0;
}

.howto-section p {
  font-size: 0.9375rem;
  color: #4b5563;
  line-height: 1.8;
  margin-bottom: 0.75rem;
  word-break: break-word;
}

.howto-steps {
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: #4b5563;
  font-size: 0.9375rem;
}

/* ============================================================
   アコーディオン
   ============================================================ */
.accordion-group {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.accordion-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  background: #fafafa;
  min-height: 44px;
  list-style: none;
  transition: background var(--transition);
  gap: 0.5rem;
}

.accordion-summary::-webkit-details-marker {
  display: none;
}

.accordion-summary:hover {
  background: #f3f0ff;
}

.accordion-icon::after {
  content: '+';
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
}

details[open] .accordion-icon::after {
  content: '−';
}

.accordion-body {
  padding: 1rem;
  border-top: 1px solid var(--border);
  background: #fff;
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.75;
}

/* ============================================================
   テーブル
   ============================================================ */
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.info-table th {
  background: #f5f3ff;
  color: var(--primary);
  font-weight: 700;
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 2px solid #ddd6fe;
}

.info-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.info-table tr:last-child td {
  border-bottom: none;
}

.info-table tr:hover td {
  background: #faf5ff;
}

/* ============================================================
   FAQ
   ============================================================ */
.faq-dl dt {
  font-weight: 700;
  color: var(--text);
  margin-top: 1rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--primary);
}

.faq-dl dt:first-child {
  margin-top: 0;
}

.faq-dl dd {
  margin-left: 0;
  margin-top: 0.35rem;
  color: #4b5563;
  font-size: 0.875rem;
  line-height: 1.75;
}

/* ============================================================
   参照リンク・免責事項
   ============================================================ */
.ref-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.ref-links li::before {
  content: '→ ';
  color: var(--primary);
}

.ref-links a {
  color: var(--primary);
  text-decoration: underline;
  font-size: 0.875rem;
  word-break: break-all;
}

.ref-links a:hover {
  color: var(--primary-hover);
}

.disclaimer-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  line-height: 1.65;
}

/* ============================================================
   フッター
   ============================================================ */
footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

footer p {
  margin-bottom: 0.35rem;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

footer a:hover {
  color: var(--primary);
}
