/* ============================================================
   D-aerial Popup System v2
   ============================================================ */

/* ---- 右下スライドイン（初回ポップ） ---- */
.daer-initial {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 99999;
  width: min(340px, calc(100vw - 32px));
  animation: daerSlideUp 0.4s cubic-bezier(.22,.68,0,1.2) both;
}
@keyframes daerSlideUp {
  from { transform: translateY(80px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.daer-pi-inner {
  background: #fff;
  border-radius: 16px;
  padding: 20px 20px 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  border-top: 4px solid #2563eb;
  position: relative;
}
.daer-pi-tag {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 6px;
}
.daer-pi-title {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin: 0 0 6px;
  line-height: 1.4;
}
.daer-pi-sub {
  font-size: 12px;
  color: #555;
  margin: 0 0 14px;
  line-height: 1.5;
}

/* ---- オーバーレイ + モーダル（共通） ---- */
.daer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: daerFadeIn 0.3s ease both;
}
@keyframes daerFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.daer-modal {
  background: #fff;
  border-radius: 18px;
  padding: 32px 28px 24px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 60px rgba(0,0,0,.25);
  position: relative;
  animation: daerScaleIn 0.35s cubic-bezier(.22,.68,0,1.15) both;
}
@keyframes daerScaleIn {
  from { transform: scale(.88); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.daer-exit-modal {
  border-top: 5px solid #ef4444;
  text-align: center;
}

/* ---- タイトル・サブ ---- */
.daer-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  margin: 0 0 8px;
  line-height: 1.4;
}
.daer-exit-h { color: #c00; }
.daer-modal-sub {
  font-size: 13px;
  color: #555;
  margin: 0 0 16px;
}

/* ---- 閉じるボタン ---- */
.daer-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  color: #999;
  line-height: 1;
  padding: 4px 8px;
}
.daer-close:hover { color: #333; }
.daer-close-abs {
  position: absolute;
  top: 10px;
  right: 12px;
}

/* ---- CTAボタン ---- */
.daer-btn-primary, .daer-btn-secondary {
  display: block;
  width: 100%;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  transition: transform .15s, box-shadow .15s;
  margin-top: 10px;
}
.daer-btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  padding: 14px 20px;
  font-size: 15px;
  box-shadow: 0 4px 16px rgba(37,99,235,.35);
}
.daer-btn-primary:hover  { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37,99,235,.45); }
.daer-btn-lg             { padding: 16px 20px; font-size: 16px; }
.daer-btn-secondary {
  background: #f1f5f9;
  color: #334155;
  padding: 12px 20px;
  font-size: 13px;
}
.daer-btn-secondary:hover { background: #e2e8f0; }

/* ---- フォーム ---- */
.daer-form-group { margin-bottom: 14px; }
.daer-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.daer-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #111;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
}
.daer-select:focus { outline: none; border-color: #2563eb; }

/* ---- 診断結果 ---- */
.daer-result-box {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 14px 0;
  font-size: 14px;
  color: #1e3a5f;
  line-height: 1.6;
}

/* ---- バッジ ---- */
.daer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.daer-badges span {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
}
.daer-badges-lg { justify-content: center; }
.daer-badges-lg span { font-size: 13px; padding: 6px 14px; }

/* ---- 課題リスト ---- */
.daer-prob-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}
.daer-prob-list li {
  padding: 8px 12px;
  background: #fef2f2;
  border-left: 3px solid #ef4444;
  margin-bottom: 6px;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: #7f1d1d;
}
.daer-solution {
  background: #eff6ff;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: #1e40af;
  font-weight: 600;
  margin-bottom: 4px;
}

/* ---- 離脱ポップ アイコン ---- */
.daer-exit-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

/* ---- モバイル調整 ---- */
@media (max-width: 480px) {
  .daer-initial { bottom: 16px; right: 12px; }
  .daer-pi-inner { padding: 16px 16px 14px; }
  .daer-modal { padding: 24px 18px 20px; border-radius: 14px; }
  .daer-modal-title { font-size: 16px; }
  .daer-btn-primary { font-size: 14px; padding: 13px 16px; }
}
