/*
 * fx-tools-common.css
 * Shared styles for all FX tools (bonus-calculator, diagnosis, leverage-simulator, spread-simulator)
 * ALL selectors scoped under .fx-tool-wrap to prevent WordPress theme conflicts.
 */

/* ── CSS Variable Defaults ── */
.fx-tool-wrap {
  --primary: #d05a1b;
  --primary-dark: #b84a15;
  --primary-bg: rgba(208,90,27,0.06);
  --text: #333;
  --text-sub: #555;
  --text-light: #767676;
  --white: #fff;
  --bg: #fdfdfd;
  --bg-alt: #f5f5f5;
  --border: #ccc;
  --border-light: #e0e0e0;
  --link: #1176d4;
  --shadow: 0 2px 8px rgba(0,0,0,.08),0 1px 2px rgba(0,0,0,.04);
  --shadow-hover: 0 4px 16px rgba(0,0,0,.1),0 2px 4px rgba(0,0,0,.06);
}

/* ── Scoped Reset ── */
.fx-tool-wrap *,
.fx-tool-wrap *::before,
.fx-tool-wrap *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.fx-tool-wrap * {
  -webkit-tap-highlight-color: transparent;
}

/* ── Typography (body-level applied to wrapper) ── */
.fx-tool-wrap {
  font-family: "游ゴシック体", "Yu Gothic", YuGothic, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background: transparent;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

/* ── Links ── */
.fx-tool-wrap a {
  color: var(--link);
  text-decoration: none;
}
.fx-tool-wrap a:hover {
  text-decoration: underline;
}

/* ── Images ── */
.fx-tool-wrap img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* ── Focus ── */
.fx-tool-wrap :focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── .tool (main container) ── */
.fx-tool-wrap .tool {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  max-width: 800px;
  margin: 0 auto;
}

/* ── Header ── */
.fx-tool-wrap .tool-hd {
  background: var(--primary);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.fx-tool-wrap .tool-hd-left {
  color: var(--white);
}
.fx-tool-wrap .tool-hd-title {
  font-size: 16px;
  font-weight: bold;
  line-height: 1.4;
}
.fx-tool-wrap .tool-hd-sub {
  font-size: 11px;
  opacity: 0.8;
  margin-top: 1px;
}
.fx-tool-wrap .tool-hd-badge {
  background: rgba(255,255,255,.18);
  color: var(--white);
  font-size: 10px;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 3px;
  white-space: nowrap;
  letter-spacing: .5px;
}

/* ── Body ── */
.fx-tool-wrap .tool-bd {
  padding: 24px 20px;
  flex: 1;
  min-height: 360px;
}

/* ── Steps (progress dots) ── */
.fx-tool-wrap .steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 16px;
}
.fx-tool-wrap .steps .d {
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--border-light);
  transition: background .2s ease;
}
.fx-tool-wrap .steps .d.done {
  background: var(--text-light);
}
.fx-tool-wrap .steps .d.now {
  background: var(--primary);
}

/* ── Progress counter ── */
.fx-tool-wrap .prog {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  font-size: 12px;
  color: var(--text-light);
}
.fx-tool-wrap .prog-num {
  font-weight: bold;
  color: var(--text-sub);
}
.fx-tool-wrap .prog-num em {
  font-style: normal;
  color: var(--primary);
  font-size: 15px;
}

/* ── Question / Answer animation ── */
.fx-tool-wrap .qa {
  animation: fx-tool-up .2s ease;
}

@keyframes fx-tool-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Question text ── */
.fx-tool-wrap .q-text {
  font-size: 15px;
  font-weight: bold;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.6;
  padding-left: 14px;
  border-left: 3px solid var(--primary);
}

/* ── Options list ── */
.fx-tool-wrap .opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Option button ── */
.fx-tool-wrap .opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.fx-tool-wrap .opt:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.fx-tool-wrap .opt:active,
.fx-tool-wrap .opt.tapped {
  border-color: var(--primary);
}
.fx-tool-wrap .opt .ix {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-alt);
  color: var(--text-sub);
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s ease, color .15s ease;
}
.fx-tool-wrap .opt:hover .ix {
  background: var(--primary);
  color: var(--white);
}
.fx-tool-wrap .opt .lb {
  flex: 1;
  line-height: 1.4;
}
.fx-tool-wrap .opt .mn {
  display: block;
  font-weight: bold;
}
.fx-tool-wrap .opt .sn {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 1px;
}
.fx-tool-wrap .opt .chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: .3;
  transition: opacity .15s ease;
}
.fx-tool-wrap .opt:hover .chevron {
  opacity: .6;
}

/* ── Go-back button ── */
.fx-tool-wrap .goback {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-light);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 2px 0;
}
.fx-tool-wrap .goback:hover {
  color: var(--text-sub);
}

/* ── Result wrapper ── */
.fx-tool-wrap .res {
  animation: fx-tool-up .3s ease;
}

/* ── Result hero ── */
.fx-tool-wrap .res-hero {
  text-align: center;
  padding: 0;
  margin-bottom: 24px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
}
.fx-tool-wrap .res-kicker {
  font-size: 13px;
  color: var(--white);
  background: var(--primary);
  display: block;
  padding: 10px 20px;
  font-weight: bold;
  letter-spacing: .5px;
}
.fx-tool-wrap .res-hero-body {
  padding: 24px 20px 20px;
}

/* ── Retry (top) ── */
.fx-tool-wrap .retry-top {
  text-align: right;
  margin: 8px 0 0;
}
.fx-tool-wrap .retry-top-btn {
  font-size: 12px;
  color: var(--text-light);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color .15s ease;
}
.fx-tool-wrap .retry-top-btn:hover {
  color: var(--primary);
}

/* ── Action row ── */
.fx-tool-wrap .act-row {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.fx-tool-wrap .act-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 80px;
  background: var(--white);
  font-size: 13px;
  color: var(--text-sub);
  cursor: pointer;
  font-family: inherit;
  font-weight: bold;
  transition: border-color .15s ease, color .15s ease;
}
.fx-tool-wrap .act-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ── CTA button ── */
.fx-tool-wrap .btn-cta {
  display: block;
  width: 100%;
  padding: 15px;
  background: var(--primary);
  color: var(--white);
  font-family: inherit;
  font-size: 15px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 80px;
  cursor: pointer;
  transition: background .15s ease;
  box-shadow: 0 2px 8px rgba(208,90,27,.2);
}
.fx-tool-wrap .btn-cta:hover {
  background: var(--primary-dark);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(208,90,27,.3);
}

/* ── Disclaimer ── */
.fx-tool-wrap .disc {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.7;
  padding: 10px 12px;
  background: var(--bg-alt);
  border-radius: 6px;
}

/* ── Standalone mode ── */
.fx-tool-wrap.fx-tool-standalone {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .fx-tool-wrap .tool-hd {
    padding: 14px 16px;
  }
  .fx-tool-wrap .tool-hd-title {
    font-size: 15px;
  }
  .fx-tool-wrap .tool-hd-badge {
    display: none;
  }
  .fx-tool-wrap .tool-bd {
    padding: 18px 16px;
  }
  .fx-tool-wrap .q-text {
    font-size: 14px;
  }
  .fx-tool-wrap .opt {
    padding: 12px 14px;
  }
}
