/* 診断ページ（/） */

.quiz {
  position: relative;
}

.screen {
  position: relative;
}

.screen.is-entering {
  animation: screen-in 0.32s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- はじめの画面 ---------- */

.intro {
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--grad-sky);
}

.intro-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}

.blob-1 {
  width: 260px;
  height: 260px;
  left: -90px;
  top: -70px;
  background: radial-gradient(circle, rgba(253, 222, 233, 0.9) 0%, rgba(253, 222, 233, 0) 70%);
}

.blob-2 {
  width: 320px;
  height: 320px;
  right: -140px;
  top: 120px;
  background: radial-gradient(circle, rgba(178, 232, 248, 0.85) 0%, rgba(178, 232, 248, 0) 70%);
}

.blob-3 {
  width: 280px;
  height: 280px;
  left: -120px;
  bottom: 40px;
  background: radial-gradient(circle, rgba(204, 238, 250, 0.8) 0%, rgba(204, 238, 250, 0) 70%);
}

.intro-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 30px var(--gutter) calc(34px + env(safe-area-inset-bottom));
}

.intro-title {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 8px;
  font-weight: 600;
}

.intro-logo {
  width: 172px;
}

.intro-title-ja {
  margin-top: 2px;
  font-family: var(--ff-head);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.3;
  letter-spacing: 0.12em;
  color: var(--c-navy);
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
}


.intro-visual {
  position: relative;
  width: 280px;
  height: 236px;
  margin-top: 18px;
}

.intro-circle {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 212px;
  height: 212px;
  margin-left: -106px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.65), 0 0 0 8px rgba(169, 214, 236, 0.55), 0 14px 34px rgba(24, 92, 134, 0.12);
}

.intro-woman {
  position: absolute;
  left: 50%;
  top: 16px;
  width: 156px;
  margin-left: -80px;
  mix-blend-mode: multiply;
}

.intro-animal {
  position: absolute;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px #fff, 0 6px 16px rgba(24, 92, 134, 0.14);
  animation: bob 4.8s ease-in-out infinite;
}

.ia-1 {
  left: 0;
  top: 8px;
}

.ia-2 {
  right: 0;
  top: 20px;
  animation-delay: -1.2s;
}

.ia-3 {
  left: 14px;
  bottom: 4px;
  width: 54px;
  height: 54px;
  animation-delay: -2.4s;
}

.ia-4 {
  right: 10px;
  bottom: 0;
  width: 56px;
  height: 56px;
  animation-delay: -3.6s;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.intro-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin-top: 22px;
  padding: 20px 18px 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--c-line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.intro-lead {
  font-feature-settings: "palt";
  letter-spacing: 0.06em;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.85;
  color: var(--c-navy);
}

.intro-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--c-line-2);
  font-family: var(--ff-hand);
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--c-pink-ink);
}

.intro-note span {
  text-wrap: balance;
}

.intro-note svg {
  flex: none;
}

.btn-start {
  width: 100%;
  max-width: 340px;
  min-height: 62px;
  margin-top: 26px;
  font-size: 18px;
}

/* ---------- 設問の画面 ---------- */

.qs {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--c-pale) 0, var(--c-page) 180px, var(--c-page) 100%);
}

.qs-head {
  padding: 14px var(--gutter) 0;
}

.qs-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--ff-head);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--c-navy);
}

.qs-brand img {
  width: 76px;
}

.progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.progress-bar {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}

.progress-bar li {
  height: 7px;
  border-radius: 99px;
  background: #d5e7f1;
  transition: background-color 0.3s ease;
}

.progress-bar li.is-done {
  background: var(--c-aqua);
}

.progress-bar li.is-now {
  background: var(--c-blue);
}

.progress-num {
  flex: none;
  min-width: 3.2em;
  font-family: var(--ff-head);
  font-weight: 600;
  line-height: 1;
  color: var(--c-blue-ink);
  text-align: right;
}

.progress-num b {
  font-size: 24px;
  font-weight: 600;
}

.progress-num span {
  font-size: 15px;
  margin-left: 2px;
  color: var(--c-muted);
}

.qs-heading {
  margin: 16px var(--gutter) 0;
  font-family: var(--ff-hand);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.6;
  color: var(--c-blue-ink);
  text-align: center;
}

.qs-heading:focus {
  outline: none;
}

.qs-heading.is-aux {
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.02em;
  color: var(--c-navy);
  text-align: left;
  text-wrap: pretty;
}

.aux-label {
  display: block;
  width: fit-content;
  margin: 0 auto 10px;
  padding: 3px 14px;
  border-radius: 99px;
  background: var(--grad-band);
  font-family: var(--ff-hand);
  font-weight: 600;
  font-size: 14px;
  color: var(--c-navy);
  text-align: center;
}

.qs-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px var(--gutter) 28px;
}

/* 1問のカード */
.q {
  position: relative;
  padding: 16px 16px 16px;
  background: #fff;
  border: 1.5px solid var(--c-line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.q.is-answered {
  border-color: var(--c-line-2);
  box-shadow: 0 2px 8px rgba(24, 92, 134, 0.05);
}

.q-text {
  display: flex;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.7;
  color: var(--c-navy);
}

.q-num {
  flex: none;
  min-width: 1.85em;
  font-family: var(--ff-head);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.6;
  color: var(--c-blue);
  letter-spacing: 0.02em;
}

.yn {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.opt {
  position: relative;
  display: block;
}

.opt input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.yn-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 52px;
  padding: 8px 12px;
  border: 1.5px solid var(--c-line-2);
  border-radius: 999px;
  background: #fff;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
  color: var(--c-blue-ink);
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.opt-check {
  display: none;
  width: 18px;
  height: 18px;
  flex: none;
}

.opt input:checked + .yn-box {
  background: var(--c-blue);
  border-color: var(--c-blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(11, 127, 181, 0.25);
}

.opt input:checked + .yn-box .opt-check,
.opt input:checked + .aux-box .opt-check {
  display: block;
}

.opt input:focus-visible + .yn-box,
.opt input:focus-visible + .aux-box {
  outline: 3px solid var(--c-aqua);
  outline-offset: 3px;
}

@media (hover: hover) {
  .opt input:not(:checked):hover + .yn-box {
    background: var(--c-pale);
  }

  .opt input:not(:checked):hover + .aux-box {
    border-color: var(--c-line-2);
    background: #fafdff;
  }
}

/* 補助質問のカード */
.aux-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aux-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 14px 16px;
  border: 1.5px solid var(--c-line);
  border-radius: var(--r-card);
  background: #fff;
  box-shadow: var(--shadow-soft);
  font-weight: 700;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--c-navy);
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.aux-letter {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--c-pale);
  font-family: var(--ff-head);
  font-weight: 600;
  font-size: 18px;
  line-height: 1;
  color: var(--c-blue-ink);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.aux-text {
  flex: 1;
}

.aux-box .opt-check {
  position: absolute;
  top: -9px;
  right: -7px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  color: var(--c-blue);
  box-shadow: 0 2px 6px rgba(11, 127, 181, 0.25);
}

.opt input:checked + .aux-box {
  border-color: var(--c-blue);
  background: #f2fafe;
  box-shadow: 0 0 0 1px var(--c-blue), 0 6px 16px rgba(11, 127, 181, 0.14);
}

.opt input:checked + .aux-box .aux-letter {
  background: var(--c-blue);
  color: #fff;
}

/* 下に固定する操作バー */
.qs-foot {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 8px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: rgba(246, 251, 254, 0.97);
  box-shadow: 0 -1px 0 rgba(169, 214, 236, 0.45), 0 -8px 18px rgba(24, 92, 134, 0.06);
}

.qs-remain {
  min-height: 1.6em;
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--c-muted);
  text-align: center;
}

.qs-remain b {
  color: var(--c-pink-ink);
  font-size: 15px;
  margin: 0 2px;
}

.qs-nav {
  display: grid;
  grid-template-columns: 7.2em 1fr;
  gap: 10px;
}

.btn-back,
.btn-next {
  min-height: 56px;
  padding: 10px 14px;
  gap: 6px;
}

.btn-back {
  font-size: 15px;
}

.btn-next {
  font-size: 17px;
}

.btn-next.is-ready {
  animation: ready 0.5s ease-out 1;
}

@keyframes ready {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

/* ---------- 送信中 ---------- */

.sending {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px var(--gutter);
  background: var(--grad-sky);
  text-align: center;
}

.sending-animals {
  display: flex;
  gap: 10px;
}

.sending-animals img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px #fff, 0 6px 14px rgba(24, 92, 134, 0.14);
  animation: hop 1.4s ease-in-out infinite;
}

.sending-animals img:nth-child(2) {
  animation-delay: 0.15s;
}

.sending-animals img:nth-child(3) {
  animation-delay: 0.3s;
}

.sending-animals img:nth-child(4) {
  animation-delay: 0.45s;
}

@keyframes hop {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

.sending-title {
  margin-top: 28px;
  font-family: var(--ff-head);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.1em;
  color: var(--c-navy);
}

.sending-title:focus {
  outline: none;
}

.sending-sub {
  margin-top: 6px;
  font-family: var(--ff-hand);
  font-weight: 600;
  font-size: 15px;
  color: var(--c-blue-ink);
}

.noscript {
  margin: 20px var(--gutter);
  padding: 16px;
  border-radius: 14px;
  background: var(--c-pink-soft);
  color: var(--c-navy);
}

@media (max-width: 359px) {
  :root {
    --gutter: 14px;
  }

  .intro-title-ja {
    font-size: 26px;
  }

  .qs-nav {
    grid-template-columns: 6.2em 1fr;
  }
}
