:root {
    --green-main: #567257;
    --green-light: #E6EDE7;
    --accent-pink: #D9B8B5;
    --brown: #896A58;
    --text-main: #2A2420;
    --bg-main: #F7F7F5;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "M PLUS Rounded 1c", "Nunito", sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
}

/* ========== ヘッダー ========== */
.site-header {
    background: var(--green-main);
    color: #fff;
    padding: 12px 0;
}

.site-header-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-logo-link {
    display: flex;
    align-items: center;
}
.site-logo-link img{
    padding: -1rem;  
}

.site-logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #F0EAE6;
    color: var(--green-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.12em;
}

.site-logo-texts {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.site-logo-main {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.site-logo-sub {
    font-size: 0.78rem;
    opacity: 0.9;
}

.site-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-nav {
    display: flex;
    gap: 12px;
    font-size: 0.9rem;
}

.site-nav a {
    color: #fff;
    text-decoration: none;
    opacity: 0.9;
}

.site-nav a:hover {
    opacity: 1;
    text-decoration: underline;
}

.site-user-area {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.site-username {
    opacity: 0.95;
}

/* ヘッダー用ボタン */
.btn-header-ghost,
.btn-header-outline {
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.8rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-header-ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #fff;
}

.btn-header-outline {
    background: #fff;
    border: none;
    color: var(--green-main);
    font-weight: 600;
}

.btn-header-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-header-outline:hover {
    filter: brightness(0.95);
}

/* ========== ファーストビュー ========== */
.hero {
    background: var(--green-main);
    color: #fff;
    padding: 52px 0 72px;
}

.hero-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
}

.hero-label {
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 10px;
}

.hero-title {
    font-size: 2.2rem;
    line-height: 1.3;
    margin: 0 0 16px;
}

.hero-desc {
    font-size: 0.98rem;
    line-height: 1.8;
    margin: 0 0 20px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.hero-form {
    margin: 0;
}

.btn-primary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent-pink);
    color: var(--text-main);
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-ghost {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hero-note {
    font-size: 0.8rem;
    opacity: 0.95;
}

.hero-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.hero-illustration {
    width: 22rem;               /* 画像より少し大きく */
    aspect-ratio: 1 / 1;        /* 完全な円の比率 */
    border-radius: 50%;         /* 円にする */
    background: #a4c48a;        /* 背景の丸の色 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;              
    box-shadow: 2px 2px 4px rgb(67, 67, 67) ;/* 画像との余白（円の“縁”になる部分） */
}

.hero-illustration img {
    width: 100%;
    height: auto;
    border-radius: 50%;         /* 画像も円形にする */
}

/* ========== セクション共通 ========== */
.section-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px 20px 70px;
}

.section-head {
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.6rem;
    margin: 0 0 6px;
    color: var(--green-main);
}

.section-desc {
    margin: 0;
    font-size: 0.95rem;
    color: #555;
}

/* ========== クイズ種類スライダー ========== */
.quiz-types-section {
    background: var(--bg-main);
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-slider {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 16px;
    padding: 10px 4px 18px;
}

.quiz-slider::-webkit-scrollbar {
    display: none;
}

.quiz-card {
    min-width: 240px;
    max-width: 260px;
    background: #fff;
    border-radius: 18px;
    padding: 16px 18px 18px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-card-title {
    margin: 0;
    font-size: 1.1rem;
    color: var(--green-main);
}

.quiz-card-tag {
    margin: 0;
    font-size: 0.8rem;
    color: var(--brown);
}

.quiz-card-desc {
    margin: 6px 0 10px;
    font-size: 0.88rem;
    line-height: 1.6;
}

.quiz-card-link {
    align-self: flex-start;
    font-size: 0.85rem;
    color: var(--green-main);
    text-decoration: none;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--green-light);
}

.quiz-card-link:hover {
    background: #d8e5dd;
}

.slider-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--green-main);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.slider-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ========== フッター ========== */
.site-footer {
    background: var(--green-main);
    padding: 18px 0 20px;
    color: #fff;
}

.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-logo {
    font-size: 0.9rem;
    letter-spacing: 0.14em;
    display: block;
    margin-bottom: 4px;
}

.footer-copy {
    font-size: 0.75rem;
    opacity: 0.9;
    margin: 0;
}

.site-header-inner .site-logo-link img {
    height: 10rem ;
    width: auto !;
}

/* ===========================
   テスト画面専用デザイン
   =========================== */

/* 背景（ヘッダーと同じ緑） */
.test-page {
    min-height: 100vh;
    background: var(--green-main);
    padding-top: 40px;
    padding-bottom: 60px;
}

/* カード */
.quiz-box {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 24px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.15);
}

/* 問題文 */
.quiz-box .question {
    margin: 0 0 24px;
    padding: 16px 18px;
    background: var(--green-light);
    border-radius: 16px;
    line-height: 1.7;
}

/* 選択肢 */
.choice-item {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #f9faf9;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.04);
    cursor: pointer;
    transition: .15s;
}
.choice-item:hover {
    background: #eef4ef;
}

/* ボタン */
.nav-buttons .btn {
    min-width: 140px;
    border-radius: 999px;
    background: var(--green-light) !important;
    color: var(--green-main) !important;
    border: 1px solid var(--green-main);
}
.nav-buttons .btn:hover {
    background: #dce8e1 !important;
    transform: translateY(-1px);
}


/* ===========================
   マイページ専用デザイン
   =========================== */

/* マイページ全体の背景（ヘッダーと同じ緑） */
.mypage-page {
    min-height: 100vh;
    background: var(--green-main);
    padding-top: 40px;
    padding-bottom: 60px;
}

/* 中央のコンテンツ幅 */
.mypage-page .main-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 上部ヘッダー部分（ユーザー名＋ボタン）をカード(カード)化 */
.mypage-header {
    background: #ffffff;
    border-radius: 24px;
    padding: 24px 24px 20px;
    margin-bottom: 24px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.15);
}

.mypage-header .page-title {
    margin: 0 0 8px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--green-main);
}

.mypage-greeting {
    margin: 0 0 16px;
    font-size: 0.95rem;
}

/* マイページ内のナビボタン */
.mypage-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mypage-nav .btn {
    border-radius: 999px;
    border: 1px solid var(--green-main);
    background: var(--green-light);
    color: var(--green-main);
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.mypage-nav .btn:hover {
    background: #dce8e1;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
    transform: translateY(-1px);
}

/* セクション（最近のテスト結果など） */
.mypage-section {
    margin-bottom: 24px;
}

/* セクションタイトル */
.mypage-section-title {
    margin: 0 0 12px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

/* 結果一覧のカード(カード) */
.mypage-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 20px 20px 16px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.15);
}

/* テーブル */
.mypage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.mypage-table th,
.mypage-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #e5e5e5;
}

.mypage-table th {
    background: var(--green-light);
    font-weight: 700;
}

.mypage-table tbody tr:nth-child(even) {
    background: #fafafa;
}

/* 「もっと結果を見る」リンク */
.mypage-more-link {
    margin-top: 12px;
    text-align: right;
}

.mypage-more-link a {
    font-size: 0.9rem;
    text-decoration: underline;
    color: #f6f6f6;
}

/* 空メッセージ */
.mypage-empty {
    color: #f6f6f6;
    margin-bottom: 12px;
}

/* 「最初のテストを受ける」ボタン */
.mypage-section .btn.btn-primary {
    border-radius: 999px;
    border: 1px solid var(--green-main);
    background: var(--green-light);
    color: var(--green-main);
    font-weight: 600;
    padding: 8px 18px;
}

.mypage-section .btn.btn-primary:hover {
    background: #dce8e1;
}

/* スマホ対応 */
@media (max-width: 600px) {
    .mypage-header,
    .mypage-card {
        padding: 18px 14px;
        border-radius: 18px;
    }

    .mypage-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .mypage-nav .btn {
        text-align: center;
    }
}
/* ============================
   マイページ（共通レイアウト）
============================ */
.mypage-layout {
    min-height: calc(100vh - 64px); /* ヘッダーぶんをざっくり引く */
    padding: 32px 16px;
    background: var(--green-main); /* 濃い緑の背景 */
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

@media (min-width: 768px) {
    .mypage-layout {
        padding: 48px 16px;
        align-items: center;
    }
}

/* ============================
   中央カード
============================ */
.mypage-card {
    width: 100%;
    max-width: 960px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
    padding: 24px 20px;
}

@media (min-width: 768px) {
    .mypage-card {
        padding: 28px 28px 32px;
    }
}

.mypage-card-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .mypage-card-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 24px;
        margin-bottom: 24px;
    }
}

.mypage-card-title-wrap .page-title {
    margin: 0;
    font-size: 1.4rem;
}

.mypage-card-title-wrap .page-subtitle {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: #666;
}

.mypage-card-body {
    margin-top: 4px;
}

/* ============================
   マイページ内ナビ
============================ */
.mypage-nav {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
}

@media (min-width: 768px) {
    .mypage-nav {
        justify-content: flex-end;
    }
}

/* ============================
   空状態
============================ */
.mypage-empty {
    margin: 8px 0 12px;
}

.mypage-empty-action {
    margin-top: 8px;
}

/* ============================
   テーブル
============================ */
.mypage-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.mypage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.mypage-table thead {
    background: var(--green-light);
}

.mypage-table th,
.mypage-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

.mypage-table th {
    font-weight: 600;
}

.mypage-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.col-session-no {
    font-weight: 600;
}

/* ============================
   ボタン（LPQ用）
============================ */
.lpq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.07s ease-out, box-shadow 0.07s ease-out, background-color 0.15s ease-out;
}

.lpq-btn:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}

/* メイン（淡い緑ボタン） */
.lpq-btn-primary {
    background: var(--green-light);
    color: var(--text-main);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
}

.lpq-btn-primary:hover {
    background: #d7e4dc;
    transform: translateY(1px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

/* セカンダリ（白ベースボタン） */
.lpq-btn-secondary {
    background: #ffffff;
    color: #333;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
}

.lpq-btn-secondary:hover {
    background: #f7f7f7;
    transform: translateY(1px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}

/* ゴースト（テーブル内の小さいボタン） */
.lpq-btn-ghost {
    background: transparent;
    border: 1px solid var(--green-main);
    color: var(--green-main);
    min-width: 0;
    padding-inline: 12px;
    box-shadow: none;
}

.lpq-btn-ghost:hover {
    background: rgba(86, 114, 87, 0.05);
}

/* 小さめボタン */
.lpq-btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
    min-width: auto;
}

/* ============================
   詳細ページ：サマリー
============================ */
.detail-summary {
    margin-bottom: 24px;
}

.detail-title {
    font-size: 1.1rem;
    margin: 0 0 10px;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    background: #fafafa;
    border-radius: 12px;
    overflow: hidden;
}

.detail-table th,
.detail-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #e5e5e5;
}

.detail-table th {
    width: 30%;
    text-align: left;
    background: #f0f0f0;
    font-weight: 600;
}

.detail-table tr:last-child th,
.detail-table tr:last-child td {
    border-bottom: none;
}

/* ============================
   詳細ページ：問題ごとの結果
============================ */
.detail-questions {
    margin-top: 24px;
}

.detail-subtitle {
    font-size: 1.05rem;
    margin: 0 0 12px;
}

/* 問題リスト */
.question-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.question-item {
    background: #fafafa;
    border-radius: 12px;
    padding: 12px 14px;
    border-left: 4px solid transparent;
}

.question-item.is-correct {
    border-left-color: var(--green-main);
}

.question-item.is-wrong {
    border-left-color: var(--accent-pink);
}

/* ヘッダー＆バッジ */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.question-number {
    font-weight: 600;
    font-size: 0.9rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
}

.badge-correct {
    background: var(--green-main);
}

.badge-wrong {
    background: var(--accent-pink);
}

/* 問題文 */
.question-text {
    margin: 4px 0 8px;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* 回答情報 */
.answer-info {
    margin-top: 4px;
    font-size: 0.9rem;
}

.answer-row {
    margin: 2px 0;
}

.answer-label {
    display: inline-block;
    min-width: 90px;
    color: #555;
}

.answer-value {
    font-weight: 600;
}

.answer-value-correct {
    color: var(--green-main);
}

/* 解説 */
.explanation {
    margin-top: 8px;
    font-size: 0.9rem;
}

.explanation > summary {
    cursor: pointer;
    color: var(--green-main);
}

.explanation-body {
    margin-top: 6px;
    padding: 8px 10px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #eee;
    line-height: 1.6;
}

/* ============================
   リザルト専用
============================ */
.result-score {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 4px;
}

@media (min-width: 576px) {
    .result-score {
        flex-direction: row;
        align-items: baseline;
        gap: 16px;
    }
}

.result-score-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.result-score-label {
    font-size: 0.95rem;
    color: #555;
}

.result-score-value {
    font-size: 1.4rem;
    font-weight: 700;
}

.result-score-percent {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--green-main);
}

.result-actions {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

/* ============================
   認証ページ（ログイン / 登録）
============================ */
/* .auth-layout {
    mypage-layout と同じでOKなので、必要なら個別の調整だけここに
} */

.auth-card {
    max-width: 420px;
    margin: 0 auto;
}

.auth-card-header {
    margin-bottom: 18px;
}

.auth-card-header .page-title {
    margin: 0;
    font-size: 1.4rem;
}

.auth-card-header .page-subtitle {
    margin: 6px 0 0;
    font-size: 0.9rem;
    color: #666;
}

/* フォーム */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.auth-input {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out, background-color 0.15s ease-out;
    background: #fff;
}

.auth-input:focus {
    border-color: var(--green-main);
    box-shadow: 0 0 0 3px rgba(86, 114, 87, 0.18);
}

/* 送信ボタン */
.auth-form-actions {
    margin-top: 6px;
}

.auth-submit-btn {
    width: 100%;
    justify-content: center;
}

/* エラー表示 */
.error-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff3f3;
    color: #a40000;
    font-size: 0.9rem;
}

.error-list li + li {
    margin-top: 4px;
}

/* フッターリンク */
.auth-footer-links {
    margin-top: 18px;
    font-size: 0.9rem;
    text-align: center;
}

.auth-footer-links a {
    color: var(--green-main);
    text-decoration: none;
    border-bottom: 1px dashed rgba(86, 114, 87, 0.6);
}

.auth-footer-links a:hover {
    border-bottom-style: solid;
}

/* ============================
   メッセージ画面（登録完了 / ログアウト完了）
============================ */
.message-layout {
    min-height: calc(100vh - 64px); /* ヘッダーぶんざっくり */
    padding: 40px 16px;
    background: var(--green-main);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

@media (min-width: 768px) {
    .message-layout {
        padding: 60px 16px;
    }
}

.message-inner {
    max-width: 520px;
    color: #ffffff;
}

.message-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.message-title {
    margin: 0 0 10px;
    font-size: 1.6rem;
    font-weight: 700;
}

.message-lead {
    margin: 0 0 8px;
    font-size: 1rem;
}

.message-timer {
    margin: 4px 0 14px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.message-sub {
    margin: 0;
    font-size: 0.9rem;
}

.message-sub a {
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.message-sub a:hover {
    text-decoration-thickness: 2px;
}



/* ========== レスポンシブ ========== */
@media (max-width: 768px) {
    .site-header-inner {
        flex-wrap: wrap;
        justify-content: space-between;
        row-gap: 8px;
    }

    .site-nav {
        display: none;
        /* モバイルではいったん隠す */
    }

    .hero {
        padding: 36px 0 52px;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .section-inner {
        padding-inline: 16px;
    }

}