:root{
  --bg:#0b1220;
  --card:#111a2e;
  --card2:#0f172a;
  --text:#e5e7eb;
  --muted:#a6adbb;
  --line:rgba(255,255,255,.10);

  --accent:#7c3aed;   /* 紫 */
  --accent2:#22c55e;  /* 緑 */
  --shadow: 0 18px 50px rgba(0,0,0,.35);

  --radius:18px;
  --radius2:14px;
  --pad:22px;
  --max:920px;
}

/* reset-ish */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
  color:var(--text);
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(124,58,237,.35), transparent 55%),
    radial-gradient(900px 600px at 80% 20%, rgba(34,197,94,.18), transparent 50%),
    radial-gradient(900px 600px at 60% 90%, rgba(56,189,248,.12), transparent 55%),
    var(--bg);
  line-height:1.7;
}

/* layout */
.container{
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 18px 70px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom: 22px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  color:var(--text);
}
.logo{
  width:38px; height:38px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124,58,237,1), rgba(34,197,94,.9));
  box-shadow: var(--shadow);
}
.brand-title{
  font-weight:800;
  letter-spacing:.2px;
  font-size: 18px;
}
.brand-sub{
  font-size: 12px;
  color: var(--muted);
  margin-top: -3px;
}

.card{
  background: linear-gradient(180deg, var(--card), var(--card2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--pad);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.card + .card{ margin-top:16px; }

.h1{
  font-size: 34px;
  line-height: 1.2;
  margin: 0 0 10px;
  letter-spacing: .2px;
}
.lead{
  color: var(--muted);
  margin: 0 0 18px;
}

.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 860px){
  .grid{ grid-template-columns: 1.2fr .8fr; align-items:start; }
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-size: 12px;
}

/* buttons */
.actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top: 16px; }
.btn{
  appearance:none;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 14px;
  text-decoration:none;
  cursor:pointer;
  font-weight:700;
  transition: transform .08s ease, background .18s ease, border-color .18s ease;
}
.btn:hover{ background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.22); }
.btn:active{ transform: translateY(1px); }
.btn-primary{
  border: none;
  background: linear-gradient(135deg, rgba(124,58,237,1), rgba(34,197,94,.9));
  box-shadow: 0 14px 34px rgba(124,58,237,.25);
}
.btn-primary:hover{ filter: brightness(1.05); }
.btn-ghost{ background: transparent; }

/* form */
fieldset{
  border: 1px solid var(--line);
  border-radius: var(--radius2);
  padding: 16px;
  margin: 0 0 12px;
  background: rgba(255,255,255,.03);
}
legend{
  padding: 0 8px;
  color: var(--muted);
  font-weight:700;
  font-size: 13px;
}
.choice{
  display:flex;
  gap:10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background .18s ease, border-color .18s ease;
}
.choice:hover{ background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.10); }
.choice input{ margin-top: 4px; }
.choice span{ color: var(--text); }
.small{ font-size: 12px; color: var(--muted); }

/* result */
.kpi{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top: 10px;
}
.kpi .pill{
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-size: 12px;
}
.hr{ height:1px; background: var(--line); margin: 16px 0; }
ul{ margin: 10px 0 0 20px; color: var(--muted); }

/* ===== Diagnosis: scroll-snap pages ===== */
.snapwrap{
  height: calc(100vh - 40px);
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  border-radius: var(--radius);
}

.snap{
  scroll-snap-align: start;
  min-height: calc(100vh - 40px);
  display:flex;
  align-items:center;
}

.snap-inner{
  width: 100%;
}

.qtitle{
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: .2px;
}

.qdesc{
  margin: 0 0 14px;
  color: var(--muted);
}

.choice-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 760px){
  .choice-grid{ grid-template-columns: 1fr 1fr; }
}

.illbtn{
  display:flex;
  gap: 12px;
  align-items:center;
  text-align:left;
  width:100%;
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor:pointer;
  transition: transform .08s ease, background .18s ease, border-color .18s ease;
}
.illbtn:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.22);
}
.illbtn:active{ transform: translateY(1px); }

.ill{
  width: 54px;
  height: 54px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  display:grid;
  place-items:center;
  flex: 0 0 54px;
}
.ill svg{
  width: 30px;
  height: 30px;
  opacity: .95;
}

.illtxt .t1{ font-weight: 800; margin: 0; }
.illtxt .t2{ margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.progress{
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 10px 0 14px;
  background: linear-gradient(180deg, rgba(11,18,32,.92), rgba(11,18,32,0));
}
.progressbar{
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.10);
}
.progressbar > div{
  height:100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(124,58,237,1), rgba(34,197,94,.9));
  transition: width .18s ease;
}


/* ===== Diagnosis: no-scroll pager ===== */
.pager{
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}
.page{
  display:none;
  min-height: 56vh;
}
.page.is-active{ display:block; }

.fade-in{
  animation: fadeIn .18s ease both;
}
@keyframes fadeIn{
  from{ opacity:0; transform: translateY(8px); }
  to{ opacity:1; transform: translateY(0); }
}

.stepper{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 14px;
}
.dots{ display:flex; gap:6px; }
.dot{
  width: 9px; height: 9px; border-radius: 99px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.10);
}
.dot.is-on{
  background: linear-gradient(135deg, rgba(124,58,237,1), rgba(34,197,94,.9));
  border-color: rgba(255,255,255,.20);
}

/* ===== Loading overlay (sparkle) ===== */
.loading{
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background:
    radial-gradient(800px 500px at 20% 20%, rgba(124,58,237,.30), transparent 60%),
    radial-gradient(900px 600px at 80% 30%, rgba(34,197,94,.18), transparent 55%),
    radial-gradient(900px 700px at 50% 90%, rgba(56,189,248,.12), transparent 60%),
    rgba(11,18,32,.88);
  backdrop-filter: blur(8px);
  z-index: 9999;
}
.loading.is-on{ display: grid; }

.loading-card{
  width: min(560px, 92vw);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(17,26,46,.72);
  box-shadow: 0 30px 90px rgba(0,0,0,.45);
  padding: 22px 18px 18px;
  position: relative;
  overflow: hidden;
}

.sweep{
  position:absolute;
  inset:-40% -60%;
  background: conic-gradient(from 90deg,
    transparent 0deg,
    rgba(255,255,255,.0) 30deg,
    rgba(255,255,255,.22) 55deg,
    rgba(124,58,237,.30) 75deg,
    rgba(34,197,94,.22) 95deg,
    rgba(255,255,255,.0) 120deg,
    transparent 180deg);
  animation: sweep 0.9s linear infinite;
  filter: blur(10px);
  opacity: .9;
}
@keyframes sweep{
  from{ transform: rotate(0deg); }
  to{ transform: rotate(360deg); }
}

.sparkles{
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(2px 2px at 12% 28%, rgba(255,255,255,.85), transparent 60%),
    radial-gradient(1px 1px at 26% 62%, rgba(255,255,255,.65), transparent 60%),
    radial-gradient(2px 2px at 43% 22%, rgba(34,197,94,.85), transparent 60%),
    radial-gradient(1px 1px at 58% 68%, rgba(124,58,237,.85), transparent 60%),
    radial-gradient(2px 2px at 74% 34%, rgba(56,189,248,.85), transparent 60%),
    radial-gradient(1px 1px at 86% 56%, rgba(255,255,255,.55), transparent 60%);
  animation: twinkle 0.35s ease-in-out infinite alternate;
  opacity: .9;
}
@keyframes twinkle{
  from{ transform: translateY(0px); opacity:.75; }
  to{ transform: translateY(-2px); opacity:1; }
}

.loading-title{
  position: relative;
  font-weight: 900;
  letter-spacing: .2px;
  margin: 0;
  font-size: 18px;
}
.loading-sub{
  position: relative;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.loading-bar{
  position: relative;
  margin-top: 14px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  overflow: hidden;
}
.loading-bar > div{
  height:100%;
  width: 35%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(124,58,237,1), rgba(34,197,94,.9), rgba(56,189,248,.8));
  animation: loadmove .35s ease-in-out infinite alternate;
}
@keyframes loadmove{
  from{ transform: translateX(-10%); width: 35%; opacity:.85; }
  to{ transform: translateX(180%); width: 55%; opacity:1; }
}
.auth-card {
  max-width: 420px;
  margin: 80px auto;
}

.label {
  display: block;
  font-weight: 600;
  margin: 14px 0 6px;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 15px;
}

.alert {
  background: #fff3f3;
  border: 1px solid #ffd6d6;
  color: #b40000;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  text-align: center;
}
/* トップのCTAを同じ幅で縦に並べる */
.cta-stack{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:22px;
}

.cta-box{
  width: 280px;            /* ←ここが2ボタンの共通幅 */
  text-align:center;
}

.cta-box .btn{
  display:block;           /* a を block にして width を効かせる */
  width:100%;
  text-align:center;
}
/* ===== Type image (result/me) ===== */
.type-hero{
  margin: 0 0 10px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
}

.type-hero__img{
  display:block;
  width: 100%;
  height: auto;
}

/* partner grid */
.partner-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}
@media (min-width: 760px){
  .partner-grid{ grid-template-columns: 1fr 1fr; }
}
.partner-item{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px;
  background: rgba(255,255,255,.03);
}
.partner-item__k{
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .2px;
}
.partner-item__v{
  margin-top: 6px;
  font-weight: 900;
}
/* ベストパートナー：画像＋タイトル（スマホで縦並び） */
@media (max-width: 600px) {
  .qtitle[style*="display:flex"] {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
  }

  .qtitle[style*="display:flex"] img {
    width: 140px !important;      /* 小さめサムネ */
    height: 140px !important;
  }
}

.lock-overlay {
  color: inherit;          /* 青文字を消す */
  text-decoration: none;   /* 下線を消す */
  display: block;          /* レイヤ全体をリンクに */
}

.lock-overlay:hover {
  color: inherit;
  text-decoration: none;
}
.lock-overlay {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  background: rgba(255,255,255,0);      /* 初期は透明 */
  transition: background .25s ease;     /* なめらか */
}

.lock-overlay:hover {
  background: rgba(0,0,0,0.04);          /* うっすら暗く */
}
@keyframes lockShake {
  0%   { transform: translateX(0) rotate(0deg); }
  20%  { transform: translateX(-2px) rotate(-5deg); }
  40%  { transform: translateX(2px)  rotate(5deg); }
  60%  { transform: translateX(-2px) rotate(-5deg); }
  80%  { transform: translateX(2px)  rotate(5deg); }
  100% { transform: translateX(0) rotate(0deg); }
}
.lock-overlay:hover .lock-icon {
  animation: lockShake .4s ease-in-out;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
}

.brand-logo{
  height:70px;     /* 好みで 36〜48 くらい */
  width:auto;
  display:block;
}

.brand-text .brand-sub{
  font-size:12px;
  opacity:.75;
  line-height:1;
}
/* ===== OSのテーマに追従（ライトモード時だけ上書き） ===== */
@media (prefers-color-scheme: light){
  :root{
    --bg:#f6f7fb;

    /* cards */
    --card: rgba(255,255,255,.92);
    --card2: rgba(248,250,252,.88);

    /* text */
    --text:#0f172a;
    --muted:#475569;

    /* borders / lines */
    --line: rgba(15,23,42,.10);

    /* ライト専用グラデーション色 */
    --accent:#8b8dfc;     /* ラベンダー */
    --accent2:#5eead4;    /* ミント */
    --accent3:#7dd3fc;    /* スカイ */

    /* softer shadow for light */
    --shadow: 0 14px 38px rgba(2, 6, 23, .10);

    /* light-mode button surfaces */
    --btn-bg: rgba(15,23,42,.04);
    --btn-bd: rgba(15,23,42,.12);
    --btn-bg-hover: rgba(15,23,42,.07);
    --btn-bd-hover: rgba(15,23,42,.18);

    /* keep your brand gradient but tune the glow for light */
    --btn-primary-shadow: 0 16px 42px rgba(124,58,237,.18);
  }

  /* body background: brighten the “aurora” */
  body{
    background:
      radial-gradient(900px 600px at 20% 10%, rgba(139,141,252,.22), transparent 60%),
      radial-gradient(900px 600px at 80% 20%, rgba(94,234,212,.18), transparent 55%),
      radial-gradient(900px 600px at 60% 90%, rgba(125,211,252,.18), transparent 60%),
      var(--bg);
  }

  /* ? card border: slight gradient border vibe */
  .card{
    background: linear-gradient(180deg, var(--card), var(--card2));
    border: 1px solid transparent;
    background-clip: padding-box;
    position: relative;
  }
  .card::before{
    content:"";
    position:absolute;
    inset:0;
    border-radius: var(--radius);
    padding: 1px; /* border thickness */
    background: linear-gradient(135deg,
      rgba(124,58,237,.22),
      rgba(34,197,94,.14),
      rgba(56,189,248,.16)
    );
    -webkit-mask:
      linear-gradient(#000 0 0) content-box,
      linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events:none;
  }

  /* ? pills/badges: lighter surfaces */
  .badge,
  fieldset,
  .kpi .pill{
    background: rgba(15,23,42,.03);
    border-color: rgba(15,23,42,.10);
    color: var(--muted);
  }

  /* ? buttons: light-mode surfaces */
  .btn{
    border: 1px solid var(--btn-bd);
    background: var(--btn-bg);
    color: var(--text);
  }
  .btn:hover{
    background: var(--btn-bg-hover);
    border-color: var(--btn-bd-hover);
  }

  /* ? primary button: keep gradient but make it “pop” cleanly on light */
  .btn-primary{
    border: none;
    background: linear-gradient(135deg, rgba(124,58,237,1), rgba(34,197,94,.95));
    box-shadow: var(--btn-primary-shadow);
    color: #fff;
  }
  .btn-primary:hover{ filter: brightness(1.03); }

  /* ? inputs: light-mode styling (あなたの .input が #ddd 固定なので上書き) */
  .input{
    border: 1px solid rgba(15,23,42,.14);
    background: rgba(255,255,255,.95);
    color: var(--text);
  }
  .input:focus{
    outline: none;
    border-color: rgba(124,58,237,.45);
    box-shadow: 0 0 0 4px rgba(124,58,237,.14);
  }

  /* alert: light mode */
  .alert{
    background: rgba(255, 239, 239, .85);
    border-color: rgba(255, 180, 180, .55);
  }

  /* ? Diagnosis choice buttons (illbtn) - light mode fix */
  .illbtn{
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(15,23,42,.14);
    color: var(--text);
    box-shadow: 0 10px 26px rgba(2, 6, 23, .08);
  }
  .illbtn:hover{
    background: rgba(255,255,255,.98);
    border-color: rgba(15,23,42,.22);
    box-shadow: 0 14px 32px rgba(2, 6, 23, .10);
  }

  /* 左のアイコン枠も明るく */
  .ill{
    background: rgba(15,23,42,.03);
    border-color: rgba(15,23,42,.12);
  }

  /* サブ文言が薄すぎるのを改善 */
  .illtxt .t2{
    color: rgba(15,23,42,.62);
  }

  /* ラジオボタンの視認性UP（ブラウザ対応範囲広め） */
  .choice input,
  .illbtn input{
    accent-color: var(--accent);
  }

  /* 選択中を “結果ページの主ボタン” っぽく見せる（対応ブラウザで効く） */
  .illbtn:has(input:checked){
    border-color: rgba(124,58,237,.45);
    box-shadow: 0 16px 38px rgba(124,58,237,.14);
    background:
      linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.92));
  }
  .illbtn:has(input:checked) .ill{
    background: rgba(124,58,237,.10);
    border-color: rgba(124,58,237,.25);
  }

  .logo,
  .btn-primary,
  .progressbar > div,
  .dot.is-on{
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    box-shadow: 0 10px 28px rgba(139,141,252,.25);
  }

  .loading{
    background:
      radial-gradient(800px 500px at 20% 20%, rgba(139,141,252,.25), transparent 60%),
      radial-gradient(900px 600px at 80% 30%, rgba(94,234,212,.18), transparent 55%),
      radial-gradient(900px 700px at 50% 90%, rgba(125,211,252,.18), transparent 60%),
      rgba(245,247,251,.92);
  }

  .loading-card{
    background: rgba(255,255,255,.82);
    box-shadow: 0 30px 70px rgba(15,23,42,.12);
  }

}

