/*=====================================
  診断ツール全体
=====================================*/

#diagnosis {

    max-width: 720px;

    margin: 40px auto;

    font-size: 16px;

    line-height: 1.7;

}


/*=====================================
  コンテンツ
=====================================*/

.diagnosis-wrapper {

    background: #ffffff;

    border: 1px solid #e5e7eb;

    border-radius: 16px;

    padding: 32px;

    box-shadow: 0 8px 24px rgba(0,0,0,.06);

}


/*=====================================
  タイトル
=====================================*/

.diagnosis-title {

    margin: 0 0 24px;

    font-size: 28px;

    font-weight: 700;

    line-height: 1.4;

    text-align: center;

    color: #222;

}


/*=====================================
  共通
=====================================*/

#diagnosis * {

    box-sizing: border-box;

}

#diagnosis button,
#diagnosis a {

    transition: .25s;

}

/*=====================================
  共通ボタン
=====================================*/

.diagnosis-button,
.diagnosis-back,
.diagnosis-restart {

    display: block;

    width: 100%;

    padding: 16px 20px;

    margin-top: 16px;

    border: none;

    border-radius: 12px;

    font-size: 16px;

    font-weight: 600;

    line-height: 1.5;

    cursor: pointer;

    transition:
        background-color .2s,
        color .2s,
        transform .15s,
        box-shadow .2s;

}


/*=====================================
  選択肢ボタン
=====================================*/

.diagnosis-button {

    background: #f8fafc;

    color: #222;

    border: 2px solid #dbe3ea;

}

.diagnosis-button:hover {

    background: #eef6ff;

    border-color: #3b82f6;

    transform: translateY(-2px);

    box-shadow: 0 8px 18px rgba(59,130,246,.18);

}

.diagnosis-button:active {

    transform: translateY(0);

}


/*=====================================
  戻るボタン
=====================================*/

.diagnosis-back {

    margin-top: 28px;

    background: transparent;

    border: 2px solid #d1d5db;

    color: #555;

}

.diagnosis-back:hover {

    background: #f5f5f5;

    border-color: #9ca3af;

}


/*=====================================
  リスタートボタン
=====================================*/

.diagnosis-restart {

    margin-top: 32px;

    background: #2563eb;

    color: #fff;

}

.diagnosis-restart:hover {

    background: #1d4ed8;

    transform: translateY(-2px);

    box-shadow: 0 10px 20px rgba(37,99,235,.25);

}

.diagnosis-restart:active {

    transform: translateY(0);

}


/*=====================================
  キーボード操作
=====================================*/

.diagnosis-button:focus-visible,
.diagnosis-back:focus-visible,
.diagnosis-restart:focus-visible {

    outline: 3px solid rgba(37,99,235,.25);

    outline-offset: 3px;

}

/*=====================================
  診断結果
=====================================*/

.diagnosis-spec {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;

    margin-top: 16px;

    padding: 18px 20px;

    background: #ffffff;

    border: 1px solid #e5e7eb;

    border-radius: 12px;

}

.diagnosis-spec-label {

    font-size: 14px;

    font-weight: 700;

    color: #6b7280;

    white-space: nowrap;

}

.diagnosis-spec-value {

    flex: 1;

    text-align: right;

    font-size: 16px;

    font-weight: 700;

    color: #222;

}


/*=====================================
  詳細記事ボタン
=====================================*/

.diagnosis-link {

    display: block;

    width: 100%;

    margin-top: 28px;

    padding: 16px 20px;

    background: #16a34a;

    color: #ffffff;

    text-align: center;

    text-decoration: none;

    font-size: 16px;

    font-weight: 700;

    border-radius: 12px;

    transition:
        background-color .2s,
        transform .15s,
        box-shadow .2s;

}

.diagnosis-link:hover {

    background: #15803d;

    color: #ffffff;

    transform: translateY(-2px);

    box-shadow: 0 10px 20px rgba(22,163,74,.25);

}

.diagnosis-link:active {

    transform: translateY(0);

}


/*=====================================
  パソコンタイプだけ少し強調
=====================================*/

.diagnosis-spec:first-of-type {

    border: 2px solid #3b82f6;

    background: #eff6ff;

}

.diagnosis-spec:first-of-type .diagnosis-spec-label {

    color: #2563eb;

}

.diagnosis-spec:first-of-type .diagnosis-spec-value {

    color: #1d4ed8;

}

/*=====================================
  進捗バー
=====================================*/

.diagnosis-progress {

    width: 100%;

    height: 8px;

    margin-bottom: 24px;

    background: #e5e7eb;

    border-radius: 999px;

    overflow: hidden;

}

.diagnosis-progress-bar {

    height: 100%;

    background: linear-gradient(90deg, #3b82f6, #60a5fa);

    border-radius: inherit;

    transition: width .3s ease;

}


/*=====================================
  回答履歴
=====================================*/

.diagnosis-history {

    margin-bottom: 24px;

    padding: 16px 20px;

    background: #f8fafc;

    border: 1px solid #e5e7eb;

    border-radius: 12px;

}

.diagnosis-history-item {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 16px;

    padding: 8px 0;

}

.diagnosis-history-item:not(:last-child) {

    border-bottom: 1px solid #e5e7eb;

}

.history-label {

    font-size: 14px;

    font-weight: 600;

    color: #6b7280;

}

.history-answer {

    font-size: 15px;

    font-weight: 700;

    color: #222;

    text-align: right;

}


/*=====================================
  スマホ対応
=====================================*/

@media (max-width: 640px) {

    #diagnosis {

        margin: 24px auto;

        font-size: 15px;

    }

    .diagnosis-wrapper {

        padding: 24px 18px;

        border-radius: 12px;

    }

    .diagnosis-title {

        font-size: 24px;

        margin-bottom: 20px;

    }

    .diagnosis-button,
    .diagnosis-back,
    .diagnosis-restart,
    .diagnosis-link {

        padding: 15px 16px;

        font-size: 15px;

    }

    .diagnosis-spec {

        flex-direction: column;

        align-items: flex-start;

        gap: 8px;

    }

    .diagnosis-spec-value {

        width: 100%;

        text-align: left;

    }

    .diagnosis-history-item {

        flex-direction: column;

        align-items: flex-start;

        gap: 4px;

    }

    .history-answer {

        text-align: left;

    }

}


/*=====================================
  動きを抑えたい環境への配慮
=====================================*/

@media (prefers-reduced-motion: reduce) {

    * {

        animation: none !important;

        transition: none !important;

        scroll-behavior: auto !important;

    }

}

.diagnosis-wrapper {

    animation: diagnosisFade .25s ease;

}

@keyframes diagnosisFade {

    from {

        opacity: 0;

        transform: translateY(8px);

    }

    to {

        opacity: 1;

        transform: translateY(0);

    }

}