/* ==========================================================================
   HARINOKI / 鍼ノ木 — 体質チェック ウィジェット (quiz.css)
   Namespaced with "cq-" to avoid clashing with the main site styles.
   ========================================================================== */

.cq-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  cursor: pointer;
  background: none;
  padding: 0;
}

.cq-fab-label {
  background: var(--white, #fff);
  color: var(--teal-deep, #1c5956);
  font-family: var(--font-jp-serif, serif);
  font-size: 13.5px;
  letter-spacing: 0.05em;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line, #d8cdb4);
  box-shadow: 0 10px 24px -14px rgba(28, 89, 86, 0.35);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.cq-fab:hover .cq-fab-label,
.cq-fab:focus-visible .cq-fab-label {
  opacity: 1;
  transform: translateX(0);
}

.cq-fab-btn {
  position: relative;
  width: 62px;
  height: 62px;
  min-width: 62px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--teal, #2f6864), var(--teal-deep, #1c5956));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 30px -14px rgba(28, 89, 86, 0.55);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.cq-fab:hover .cq-fab-btn { transform: translateY(-3px) scale(1.04); }

.cq-fab-btn svg { width: 26px; height: 26px; color: #fff; }

.cq-fab-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid var(--gold, #cbaa6b);
  animation: cq-ring-pulse 2.6s ease-out 3;
}

@keyframes cq-ring-pulse {
  0% { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(1.35); opacity: 0; }
}

.cq-fab[hidden] { display: none; }

/* ---------- Panel ---------- */

.cq-panel {
  position: fixed;
  right: 24px;
  bottom: 100px;
  z-index: 320;
  width: 400px;
  max-width: 92vw;
  max-height: min(680px, 82vh);
  background: var(--cream, #faf6f0);
  border-radius: 20px;
  box-shadow: 0 30px 70px -20px rgba(28, 89, 86, 0.45);
  border: 1px solid var(--line, #d8cdb4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transform: scale(0.92) translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), opacity 0.3s ease;
}

.cq-panel.is-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.cq-panel-header {
  background: linear-gradient(135deg, var(--teal-deep, #1c5956), var(--teal, #2f6864));
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
}

.cq-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-jp-serif, serif);
  font-size: 15.5px;
  letter-spacing: 0.04em;
}
.cq-panel-title svg { width: 20px; height: 20px; color: var(--gold, #cbaa6b); }

.cq-panel-close {
  background: rgba(255,255,255,0.14);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
  font-size: 16px;
  line-height: 1;
}
.cq-panel-close:hover { background: rgba(255,255,255,0.28); }

.cq-panel-body {
  padding: 26px 24px 22px;
  overflow-y: auto;
  flex: 1;
}

.cq-screen { display: none; }
.cq-screen.is-active { display: block; animation: cq-fade-in 0.4s ease; }

@keyframes cq-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Intro screen */

.cq-intro-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(203,170,107,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.cq-intro-icon svg { width: 26px; height: 26px; color: var(--teal-deep, #1c5956); }

.cq-intro h3 {
  font-family: var(--font-jp-serif, serif);
  color: var(--teal-deep, #1c5956);
  font-size: 20px;
  letter-spacing: 0.03em;
  margin: 0 0 12px;
  line-height: 1.6;
}

.cq-intro p {
  color: var(--ink-soft, #6b675d);
  font-size: 13.8px;
  line-height: 1.9;
  margin: 0 0 14px;
}

.cq-intro-meta {
  display: flex;
  gap: 16px;
  margin: 18px 0 22px;
  font-size: 12.5px;
  color: var(--ink-soft, #6b675d);
}
.cq-intro-meta span { display: flex; align-items: center; gap: 6px; }
.cq-intro-meta svg { width: 15px; height: 15px; color: var(--gold-deep, #b8934f); }

.cq-types-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}
.cq-type-chip {
  font-size: 11.5px;
  color: var(--teal-deep, #1c5956);
  background: rgba(47,104,100,0.08);
  border: 1px solid rgba(47,104,100,0.18);
  border-radius: 999px;
  padding: 4px 11px;
}

.cq-disclaimer {
  font-size: 11px;
  color: var(--ink-soft, #6b675d);
  opacity: 0.8;
  line-height: 1.7;
  margin-top: 18px;
}

/* Buttons (namespaced, echo the site's .btn but self-contained) */

.cq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border-radius: 999px;
  font-family: var(--font-jp-sans, sans-serif);
  font-size: 14px;
  letter-spacing: 0.06em;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}
.cq-btn-primary {
  background: var(--teal-deep, #1c5956);
  color: #fff;
}
.cq-btn-primary:hover { background: var(--teal, #2f6864); transform: translateY(-1px); }

.cq-btn-outline {
  background: transparent;
  color: var(--teal-deep, #1c5956);
  border-color: var(--teal-deep, #1c5956);
  margin-top: 10px;
}
.cq-btn-outline:hover { background: var(--teal-deep, #1c5956); color: #fff; }

.cq-btn-text {
  background: none;
  border: none;
  color: var(--ink-soft, #6b675d);
  font-size: 12.5px;
  text-decoration: underline;
  cursor: pointer;
  padding: 8px 0;
  width: 100%;
  text-align: center;
}
.cq-btn-text:hover { color: var(--teal-deep, #1c5956); }

/* Question screen */

.cq-progress-track {
  height: 4px;
  border-radius: 999px;
  background: var(--line, #d8cdb4);
  overflow: hidden;
  margin-bottom: 8px;
}
.cq-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold, #cbaa6b), var(--teal, #2f6864));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.cq-progress-label {
  font-family: var(--font-en, serif);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--gold-deep, #b8934f);
  margin-bottom: 22px;
  display: block;
}

.cq-question-text {
  font-family: var(--font-jp-serif, serif);
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink, #2b2b26);
  margin: 0 0 22px;
  min-height: 78px;
}

.cq-answers {
  display: grid;
  gap: 10px;
}

.cq-answer-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  padding: 13px 18px;
  border-radius: 12px;
  border: 1px solid var(--line, #d8cdb4);
  background: var(--white, #fff);
  color: var(--ink, #2b2b26);
  font-size: 13.8px;
  font-family: var(--font-jp-sans, sans-serif);
  cursor: pointer;
  transition: all 0.22s ease;
}
.cq-answer-btn:hover {
  border-color: var(--teal, #2f6864);
  background: rgba(47,104,100,0.06);
  transform: translateX(2px);
}
.cq-answer-btn span.cq-answer-dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--gold-deep, #b8934f);
  flex: none;
}

.cq-question-back {
  margin-top: 18px;
  background: none;
  border: none;
  color: var(--ink-soft, #6b675d);
  font-size: 12.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cq-question-back:hover { color: var(--teal-deep, #1c5956); }

/* Result screen */

.cq-result-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.cq-result-icon {
  width: 54px; height: 54px; min-width: 54px;
  border-radius: 50%;
  background: rgba(28,89,86,0.08);
  display: flex; align-items: center; justify-content: center;
}
.cq-result-icon svg { width: 26px; height: 26px; color: var(--teal-deep, #1c5956); }

.cq-result-name {
  font-family: var(--font-jp-serif, serif);
  font-size: 21px;
  color: var(--teal-deep, #1c5956);
  letter-spacing: 0.03em;
  margin: 0;
}
.cq-result-kana {
  font-size: 12px;
  color: var(--ink-soft, #6b675d);
  margin: 2px 0 0;
}
.cq-result-tagline {
  display: inline-block;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--gold-deep, #b8934f);
  background: rgba(203,170,107,0.15);
  border-radius: 999px;
  padding: 3px 12px;
}

.cq-result-desc {
  font-size: 13.8px;
  color: var(--ink-soft, #6b675d);
  line-height: 1.9;
  margin: 0 0 18px;
}

.cq-result-section-title {
  font-family: var(--font-jp-serif, serif);
  font-size: 13.5px;
  color: var(--teal-deep, #1c5956);
  letter-spacing: 0.05em;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line, #d8cdb4);
}

.cq-result-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  gap: 9px;
}
.cq-result-list li {
  font-size: 13.3px;
  color: var(--ink, #2b2b26);
  padding-left: 18px;
  position: relative;
  line-height: 1.75;
}
.cq-result-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 8px; height: 1px;
  background: var(--gold-deep, #b8934f);
}

.cq-result-secondary {
  font-size: 12.5px;
  color: var(--ink-soft, #6b675d);
  background: rgba(47,104,100,0.06);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 20px;
  line-height: 1.8;
}
.cq-result-secondary strong { color: var(--teal-deep, #1c5956); }

.cq-menu-hint {
  background: var(--white, #fff);
  border: 1px solid var(--line, #d8cdb4);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 22px;
  font-size: 13px;
  color: var(--ink-soft, #6b675d);
  line-height: 1.8;
}
.cq-menu-hint strong { color: var(--teal-deep, #1c5956); font-family: var(--font-jp-serif, serif); font-weight: 500; }

.cq-result-actions { display: grid; gap: 8px; margin-top: 4px; }

/* Mobile: full-screen panel */

@media (max-width: 640px) {
  .cq-panel {
    right: 0;
    bottom: 0;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    transform: translateY(16px);
  }
  .cq-panel.is-open { transform: translateY(0); }
  .cq-fab-label { display: none; }
  .cq-fab { right: 18px; bottom: 18px; }
}
