/* ==========================================================
   JOL 日本語かんたんチェック — Design tokens from Figma (JOL UI)
   ========================================================== */
:root {
  /* colors */
  --bg: #f4f4f6;
  --surface: #ffffff;
  --border: #e8e8f0;
  --primary: #ff6b1a;
  --primary-btn: #ff7020;
  --primary-soft: #ffece2;
  --primary-soft-border: rgba(255, 107, 26, 0.22);
  --correct: #00db6b;
  --correct-soft: #e5f9ed;
  --wrong: #f6182f;
  --wrong-border: #ff3a43;
  --wrong-soft: #ffe9e9;
  --text: #1b1b1b;
  --text-dark: #1a1a2e;
  --text-muted: #bcbcbc;
  --track: rgba(0, 0, 0, 0.07);
  --orange-shadow: 0 6px 20px 0 rgba(255, 107, 26, 0.3);

  /* type */
  --font-ja: "Noto Sans JP", sans-serif;
  --font-en: "DM Sans", "Noto Sans JP", sans-serif;

  /* radii */
  --r-card: 16px;
  --r-option: 12px;
  --r-badge: 8px;
  --r-button: 9px;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ja);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 24px 24px calc(24px + env(safe-area-inset-bottom));
  background: var(--bg);
  position: relative;
  z-index: 1;
}

/* ---------- PC: 左右をブランド背景で埋める (Figma 890:5501) ---------- */
@media (min-width: 900px) {
  body {
    background: url("assets/bg-desktop.jpg") center top / cover no-repeat fixed #ff6b1a;
  }
  .app {
    box-shadow: 0 0 48px rgba(0, 0, 0, 0.18);
  }
  /* 左右の巨大JOLウォーターマーク(SVG自体が白24%不透明) */
  body::before,
  body::after {
    content: "";
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(220px, 44vw - 240px, 620px);
    aspect-ratio: 599 / 220;
    background: url("assets/watermark.svg") center / contain no-repeat;
    z-index: 0;
    pointer-events: none;
  }
  body::before { left: 2vw; }
  body::after { right: 2vw; }
}

button { font-family: inherit; cursor: pointer; }

/* ---------- shared ---------- */
.screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  animation: fadeIn 0.35s ease both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.logo-footer {
  margin-top: auto;
  padding-top: 32px;
  display: flex;
  justify-content: center;
}
.logo-footer img { height: 28px; width: auto; }

.en {
  font-family: var(--font-en);
}

.btn-primary {
  display: block;
  width: 100%;
  min-height: 56px;
  border: none;
  border-radius: var(--r-button);
  background: var(--primary-btn);
  color: #fff;
  font-family: var(--font-ja);
  font-weight: 500;
  font-size: 16px;
  box-shadow: var(--orange-shadow);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn-primary:active { transform: scale(0.98); filter: brightness(0.95); }
.btn-primary:disabled { opacity: 0.5; box-shadow: none; cursor: default; }
.btn-primary .btn-sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.9;
  font-family: var(--font-en);
}

.btn-secondary {
  display: block;
  width: 100%;
  min-height: 52px;
  border: 1.5px solid var(--primary);
  border-radius: var(--r-button);
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.15s ease;
}
.btn-secondary:active { transform: scale(0.98); }

ruby rt { font-size: 8px; color: inherit; opacity: 0.85; font-weight: 500; }

/* ---------- S1 intro (Figma 826:2948) ---------- */
.intro2 { padding-top: 0; }

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  margin: -6px 0 26px;
  position: relative;
}
.header-logo { height: 23px; width: auto; }

.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 4px solid var(--primary-btn);
  border-radius: 28px;
  padding: 4px 16px 4px 12px;
  color: var(--primary-btn);
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 16px;
  line-height: 20px;
}
.lang-chevron { width: 8px; height: 13px; transform: rotate(-90deg); }

.lang-menu {
  position: absolute;
  top: 48px;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  z-index: 30;
  min-width: 200px;
}
.lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-ja);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.lang-item:active, .lang-item:hover { background: var(--primary-soft); }
.lang-item.active { color: var(--primary-btn); font-weight: 700; background: var(--primary-soft); }
.lang-flag { font-size: 17px; }

.intro2-title {
  color: var(--primary-btn);
  font-size: 27px;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
}
.intro2-subtitle {
  margin-top: 8px;
  color: #222;
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
}

.hero { position: relative; height: 292px; margin: 20px 0 16px; }
.phone-tilt {
  position: absolute;
  width: 127px;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.08));
}
.phone-left {
  left: calc(50% - 122px);
  top: 0;
  transform: rotate(-3.43deg);
  z-index: 2;
}
.phone-right {
  left: calc(50% - 19px);
  top: 14px;
  transform: rotate(7.81deg);
  z-index: 1;
}
.phone-frame { display: block; width: 100%; height: auto; position: relative; z-index: 1; }
.phone-screen {
  position: absolute;
  inset: 2.2% 5.2%;
  width: 89.6%;
  height: 95.6%;
  object-fit: cover;
  border-radius: 9px;
  z-index: 0;
}
.hero-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.hero-badge {
  flex: 0 0 89px;
  width: 89px;
  aspect-ratio: 1;
  background: #fff;
  border: 4.3px solid var(--primary-btn);
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(255, 107, 26, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--primary-btn);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  padding: 8px;
  word-break: break-word;
}

.intro2-helper {
  margin: 24px 0;
  color: var(--primary-btn);
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  line-height: 1.7;
}

.start-btn {
  width: 256px;
  min-height: 64px;
  margin: 0 auto;
  border-radius: 12px;
  font-weight: 700;
}

.intro2-note {
  margin-top: auto;
  padding-top: 28px;
  font-size: 10px;
  color: #9799a2;
  text-align: center;
  line-height: 2;
}

/* ---------- S2 quiz ---------- */
.progress-row { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.progress-track {
  flex: 1;
  background: var(--track);
  border-radius: 100px;
  padding: 2px;
  overflow: clip;
}
.progress-fill {
  height: 8px;
  border-radius: 4px;
  background: var(--primary);
  transition: width 0.4s ease;
  min-width: 8px;
}
.progress-count {
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 40px;
  text-align: right;
}

.question-card {
  background: var(--primary-soft);
  border: 1px solid var(--primary-soft-border);
  border-radius: var(--r-card);
  padding: 24px 16px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
  word-break: break-word;
}
.question-card .prompt {
  color: var(--primary);
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}
.question-card .question-text {
  color: var(--text);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.5;
}
.question-card .prompt-ja {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.2;
}

.reading-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-option);
  padding: 14px;
  font-size: 14px;
  line-height: 1.7;
}
.reading-block table { width: 100%; border-collapse: collapse; font-size: 13px; }
.reading-block th, .reading-block td {
  border: 1px solid var(--border);
  padding: 8px 4px;
  text-align: center;
}
.reading-block th { background: var(--primary-soft); color: var(--text); font-weight: 700; }

.options { display: flex; flex-direction: column; gap: 16px; }
.option {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border-radius: var(--r-option);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.option:active { transform: scale(0.99); }
.option .badge {
  flex: 0 0 48px;
  height: 48px;
  border-radius: var(--r-badge);
  background: var(--primary);
  color: #fff;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.option .option-label {
  flex: 1;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}

.option.is-correct {
  background: var(--correct-soft);
  border: 2px solid var(--correct);
  padding: 11px;
}
.option.is-correct .badge { background: var(--correct); }

.option.is-wrong {
  background: var(--wrong-soft);
  border: 2px solid var(--wrong-border);
  padding: 11px;
}
.option.is-wrong .badge { background: var(--wrong); }

.option.is-dimmed { opacity: 0.55; }
.options.locked .option { pointer-events: none; }

/* feedback banner */
.feedback {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  animation: slideUp 0.25s ease both;
  z-index: 10;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: none; }
}
.feedback-inner {
  width: 100%;
  max-width: 430px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px calc(20px + env(safe-area-inset-bottom));
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
}
.feedback-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.feedback-en {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 8px;
}
body.feedback-open .app { padding-bottom: 300px; }
.feedback.correct .feedback-inner { background: var(--correct-soft); }
.feedback.wrong .feedback-inner { background: var(--primary-soft); }
.feedback .mark {
  flex: 0 0 48px;
  height: 48px;
  border-radius: 28px;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feedback.correct .mark { background: var(--correct); }
.feedback.wrong .mark { background: var(--wrong); }
.feedback .feedback-title { font-weight: 700; font-size: 16px; line-height: 1.2; }
.feedback.correct .feedback-title { color: var(--correct); }
.feedback.wrong .feedback-title { color: var(--wrong); }
.feedback .feedback-sub {
  margin-top: 6px;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dark);
}
.feedback .feedback-sub-native {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(0, 0, 0, 0.12);
  font-size: 12px;
  line-height: 1.6;
  color: #5c5e6b;
}

/* ---------- S3 lead form ---------- */
.lead-head { text-align: center; margin: 8px 0 24px; }
.lead-head .done-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--correct);
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lead-head h2 { font-size: 21px; font-weight: 700; margin-bottom: 8px; }
.lead-head p { font-size: 13px; color: var(--text-dark); line-height: 1.7; }
.lead-head .en-sub { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

.lead-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.field .label-en {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 1px;
}
.field .req {
  color: var(--wrong);
  font-size: 11px;
  margin-left: 4px;
}
.field .opt {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 4px;
  font-weight: 400;
}
.field input[type="text"],
.field input[type="email"],
.field select {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-option);
  background: var(--bg);
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  appearance: none;
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  background: #fff;
}
.field .error-msg {
  display: none;
  color: var(--wrong);
  font-size: 12px;
  margin-top: 4px;
}
.field.has-error input { border-color: var(--wrong-border); background: var(--wrong-soft); }
.field.has-error .error-msg { display: block; }

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dark);
}
.consent input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--primary); flex-shrink: 0; }
.consent a { color: var(--primary); }
.consent .en { display: block; margin-top: 4px; font-size: 11px; color: var(--text-muted); }

.lead-note { font-size: 11px; color: var(--text-muted); line-height: 1.6; }

/* ---------- S4 result ---------- */
.result-badge-card {
  background: var(--primary-soft);
  border: 1px solid var(--primary-soft-border);
  border-radius: var(--r-card);
  text-align: center;
  padding: 28px 20px;
  margin-bottom: 16px;
}
.result-badge-card .caption {
  color: var(--primary);
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.result-badge-card .level {
  font-size: 40px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.result-badge-card .level-sub { font-size: 14px; font-weight: 700; color: var(--primary); margin-top: 2px; }
.result-badge-card .score {
  margin-top: 10px;
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
}
.result-badge-card .score span { color: var(--text-muted); font-weight: 400; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 20px 16px;
  margin-bottom: 16px;
}
.card h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h3::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--primary);
}

.cat-row { margin-bottom: 14px; }
.cat-row:last-child { margin-bottom: 0; }
.cat-row .cat-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.cat-row .cat-name { font-size: 13px; font-weight: 700; }
.cat-row .cat-name .cat-en { font-family: var(--font-en); font-weight: 400; font-size: 11px; color: var(--text-muted); margin-left: 6px; }
.cat-row .cat-pct { font-family: var(--font-en); font-size: 13px; font-weight: 700; color: var(--primary); }
.cat-row .cat-track {
  background: var(--track);
  border-radius: 100px;
  padding: 2px;
  overflow: clip;
}
.cat-row .cat-fill {
  height: 8px;
  border-radius: 4px;
  background: var(--primary);
  min-width: 8px;
  transition: width 0.8s ease;
}

.advice-text { font-size: 14px; line-height: 1.8; color: var(--text-dark); }

.disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.7;
  text-align: center;
  margin: 4px 0 20px;
}

.cta-card {
  background: var(--primary-soft);
  border: 1px solid var(--primary-soft-border);
  border-radius: var(--r-card);
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 16px;
}
.cta-card h3 { font-size: 16px; font-weight: 700; line-height: 1.6; margin-bottom: 6px; }
.cta-card p { font-size: 12px; color: var(--text-dark); line-height: 1.7; margin-bottom: 16px; }
.cta-card .cta-buttons { display: flex; flex-direction: column; gap: 10px; }

.share-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 20px 16px;
  text-align: center;
}
.share-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.share-card p { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-dark);
  color: #fff;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 100px;
  z-index: 20;
  animation: fadeIn 0.2s ease both;
}
