/* ============================================================
   eDriver Diagnosis Widget — v4 (業種分岐対応版)
   ・デザイン・CSS・SVGアイコン・トンマナは v3 から変更なし
   ・Q0（業種選択）追加 → Q1〜Q3 を業種別に分岐
   ============================================================ */

.edw-wrap {
  font-family: "Noto Sans JP", sans-serif;
  width: 340px;
  max-width: 340px;
  color: #1a2a3a;
  position: relative;
}
@media (max-width: 767px) {
  .p-hero__diagnosis {
    width: 90%;
  }
  .edw-wrap {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }
}

.edw-card {
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 8px 32px rgba(30, 77, 201, 0.14),
    0 2px 8px rgba(30, 77, 201, 0.06);
  border: 1px solid #c5ddf2;
  position: relative;
}

/* ── ヘッダー ── */
.edw-header {
  background: linear-gradient(135deg, #236cbe 0%, #1b95cc 60%, #03b3d4 100%);
  padding: 20px 18px 18px;
  position: relative;
}
.edw-header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}
.edw-header-num {
  flex-shrink: 0;
  line-height: 1;
  white-space: nowrap;
  display: flex;
  align-items: baseline;
  position: relative;
}
.edw-header-num::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 6%;
  bottom: 6%;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(255, 255, 255, 0.5),
    transparent
  );
}
.edw-num-30 {
  font-size: 42px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(10, 30, 80, 0.18);
}
.edw-num-de {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0;
  line-height: 1;
  margin-left: 2px;
}
.edw-header-text {
  flex: 1;
  min-width: 0;
  padding-left: 6px;
}
.edw-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.5;
  letter-spacing: 0.01em;
}
.edw-title b {
  background: none;
  padding: 0;
}
.edw-subtitle {
  display: none;
}

.edw-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s;
}
.edw-close:hover {
  background: rgba(255, 255, 255, 0.38);
}

@media (max-width: 480px) {
  .edw-num-30 {
    font-size: 40px;
  }
  .edw-num-de {
    font-size: 19px;
  }
  .edw-title {
    font-size: 13px;
  }
}

/* ── プログレス ── */
.edw-progress {
  background: #fff;
  border-bottom: 1px solid #d8edf8;
}
.edw-step-labels {
  display: flex;
}
.edw-step-labels span {
  flex: 1;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #aac8e0;
  letter-spacing: 0.02em;
  padding: 9px 4px;
  border-bottom: 2.5px solid transparent;
  transition:
    color 0.2s,
    border-color 0.2s;
  cursor: default;
}
.edw-step-labels span.edw-active {
  color: #1e4dc9;
  border-bottom-color: #1e4dc9;
}
.edw-step-labels span.edw-done {
  color: #18a8dc;
  border-bottom-color: #18a8dc;
}
.edw-bar-track,
.edw-bar-fill {
  display: none;
}

/* ── ボディ ── */
.edw-body {
  padding: 16px 18px 18px;
}
.edw-screen {
  display: none;
}
.edw-screen.edw-visible {
  display: block;
}

.edw-q-label {
  font-size: 10px;
  font-weight: 700;
  color: #18a8dc;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.edw-q-text {
  font-size: 14px;
  font-weight: 700;
  color: #0e2f60;
  line-height: 1.55;
  margin-bottom: 12px;
}

/* ── 選択肢 ── */
.edw-options {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.edw-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  background: #f5faff;
  border: 1.5px solid #c5ddf2;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s;
  position: relative;
  width: 100%;
  font-family: inherit;
}
.edw-opt:hover {
  border-color: #18a8dc;
  background: #ebf4fb;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(24, 168, 220, 0.12);
}
.edw-opt.edw-selected {
  border-color: #1e4dc9;
  background: #ebf4fb;
}
.edw-opt.edw-selected::after {
  content: "✓";
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #236cbe, #03b3d4);
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── アイコン枠（フラット＋2色アクセント） ── */
.edw-opt-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #ffffff;
  border: 1.5px solid #d6eafa;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(30, 77, 201, 0.04);
}
.edw-opt-icon svg {
  display: block;
}

.edw-opt-text .edw-opt-main {
  font-size: 12.5px;
  font-weight: 700;
  color: #0e2f60;
  display: block;
  line-height: 1.4;
}
.edw-opt-text .edw-opt-sub {
  font-size: 10.5px;
  color: #5a90bc;
  display: block;
  margin-top: 2px;
}

/* ── ボタン ── */
.edw-btn-next {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #236cbe, #03b3d4);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition:
    opacity 0.18s,
    transform 0.15s;
}
.edw-btn-next:hover:not(:disabled) {
  opacity: 0.88;
  transform: translateY(-1px);
}
.edw-btn-next:disabled {
  background: #c0d8ee;
  cursor: not-allowed;
  transform: none;
}

.edw-back-row {
  display: flex;
  justify-content: center;
  margin-top: 9px;
}
.edw-btn-back {
  background: none;
  border: none;
  font-size: 11px;
  color: #8bbad8;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
  transition: color 0.15s;
}
.edw-btn-back:hover {
  color: #1e4dc9;
}

/* ── 結果画面 ── */
.edw-result-header {
  background: linear-gradient(140deg, #1a4f8c 0%, #236cbe 50%, #03b3d4 100%);
  padding: 22px 20px 20px;
  text-align: center;
  position: relative;
}
.edw-result-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.edw-result-icon-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}
.edw-result-name {
  font-size: 17px;
  font-weight: 900;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 4px;
}
.edw-result-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.6;
}

.edw-result-body {
  padding: 16px 20px 20px;
}
.edw-reason-box {
  background: linear-gradient(135deg, #ebf4fb, #e0f2fc);
  border-left: 3px solid #18a8dc;
  border-radius: 0 9px 9px 0;
  padding: 11px 13px;
  margin-bottom: 13px;
}
.edw-reason-label {
  font-size: 9.5px;
  font-weight: 700;
  color: #18a8dc;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.edw-reason-text {
  font-size: 12px;
  color: #0e2f60;
  line-height: 1.75;
}

.edw-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
}
.edw-feature {
  background: #f5faff;
  border: 1px solid #c5ddf2;
  border-radius: 9px;
  padding: 9px 10px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.edw-feature-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #236cbe, #03b3d4);
  flex-shrink: 0;
  margin-top: 4px;
}
.edw-feature-text {
  font-size: 11px;
  font-weight: 700;
  color: #0e2f60;
  line-height: 1.4;
}

.edw-cta-btn {
  display: block;
  width: 100%;
  padding: 13px;
  background: #ffd84d;
  border: none;
  border-radius: 10px;
  color: #1a2a3a;
  font-size: 14px;
  font-weight: 900;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition:
    background 0.18s,
    transform 0.15s,
    box-shadow 0.15s;
  box-shadow: 0 4px 12px rgba(245, 196, 0, 0.35);
  margin-bottom: 8px;
}
.edw-cta-btn:hover {
  background: #f5c400;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 196, 0, 0.45);
}

.edw-retry-row {
  display: flex;
  justify-content: center;
}
.edw-btn-retry {
  background: none;
  border: none;
  font-size: 11px;
  color: #8bbad8;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
  transition: color 0.15s;
}
.edw-btn-retry:hover {
  color: #1e4dc9;
}

@keyframes edw-fadein {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.edw-screen.edw-visible {
  animation: edw-fadein 0.25s ease forwards;
}
