/* =========================
   Reset & Base
   ========================= */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 "Helvetica Neue", Arial, "ヒラギノ角ゴ ProN W3",
                 "Hiragino Kaku Gothic ProN", "メイリオ", Meiryo, sans-serif;
    background-color: #f7f7f7;
    color: #222;
    margin: 0;
}

a {
    color: #1B3A57;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}


/* =========================
   Header
   ========================= */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: #1B3A57;
    color: #f7f7f7;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header a {
    color: #f7f7f7;
    font-weight: bold;
    font-size: 1.1rem;
}

.header-left {
    display: flex;
    flex-direction: column;
}

.header-corp-name {
    font-size: 0.8rem;
    margin-top: 4px;
    opacity: 0.9;
}

.header-right .header-divider {
    margin: 0 6px;
    opacity: 0.7;
}


/* =========================
   Notice
   ========================= */

.notice {
    background-color: #DDE6ED;
    color: #1B3A57;
    padding: 10px 30px;
    text-align: center;
    font-style: italic;
}


/* =========================
   Button（共通）
   ========================= */

.button {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 20px;
    font-size: 0.95rem;
    border: 1px solid #1B3A57;
    background-color: #1B3A57;
    color: white;
    transition: background-color 0.2s, color 0.2s, opacity 0.2s;
}

.button-primary {
    background-color: #1B3A57;
    color: #ffffff;
}

.button-outline {
    background-color: #ffffff;
    color: #1B3A57;
}

.button:hover {
    opacity: 0.9;
    text-decoration: none;
}

.button.disabled {
    background: #aaa;
    border-color: #aaa;
    pointer-events: none;
}

/* 退会ボタン（危険操作用） */
.button-danger {
    background-color: #c62828;  /* 落ち着いた赤 */
    border-color: #c62828;
    color: #ffffff;
}

/* マイページ下部の退会ボタンエリア（PCデフォルト：右寄せ） */
.mypage-delete-area {
    margin-top: 24px;
    text-align: right;
}


/* =========================
   トップページ専用デザイン
   ========================= */

/* メインコンテナ */
.top-main {
    max-width: 1000px;
    margin: 40px auto 60px;
    padding: 0 20px;
    text-align: left;
}

/* ヒーローエリア */
.hero {
    background: #ffffff;
    padding: 30px 28px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    margin-bottom: 30px;
}

.hero-tagline {
    font-size: 0.9rem;
    color: #555;
    margin: 0 0 8px 0;
}

.hero h1 {
    font-size: 1.8rem;
    margin: 0 0 16px 0;
    line-height: 1.4;
    color: #1B3A57;
}

.hero-lead {
    font-size: 1rem;
    margin: 0 0 20px 0;
    color: #333;
    max-width: 720px; /* 読みやすい行長に制限 */
}

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

.hero-note {
    font-size: 0.85rem;
    color: #666;
    margin-top: 8px;
}

/* 特徴・おすすめ・下部CTAカード */
.features,
.for-whom,
.bottom-cta {
    background: #ffffff;
    padding: 24px 24px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    text-align: left;
}

.features h2,
.for-whom h2,
.bottom-cta h2 {
    margin-top: 0;
    margin-bottom: 14px;
    font-size: 1.3rem;
    color: #1B3A57;
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.feature-item h3 {
    margin: 0 0 6px 0;
    font-size: 1.05rem;
    color: #1B3A57;
}

.feature-item p {
    margin: 0;
    font-size: 0.95rem;
    color: #333;
}

/* 想定ユーザー */
.for-whom-list {
    margin: 8px 0 0;
    padding-left: 18px;
    font-size: 0.95rem;
}

/* 下部CTAだけ中央揃え */
.bottom-cta {
    text-align: center;
}

.bottom-cta-button {
    margin-top: 10px;
}


/* =========================
   共通レイアウト（記事一覧など）
   ========================= */

.main-layout {
    display: flex;
    margin: 20px 30px;
}

/* Sidebar */
.sidebar {
    width: 220px;
    margin-right: 30px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    border-right: 2px solid #ccc;
}

.sidebar li {
    margin: 8px 0;
}

.sidebar li.active a {
    font-weight: bold;
    color: #1B3A57;
}

/* Article list */
.article-list {
    flex: 1;
}

.article {
    background: #ffffff;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-left: 4px solid #1B3A57;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
}

.article h2 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    font-weight: bold;
}

.article h2 a {
    color: #1B3A57;
}

.article p {
    margin: 5px 0;
    line-height: 1.3em;
    color: #333;
}

.article .meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #555;
    margin-top: 4px;
}

.meta-left {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
}

.meta-right {
    flex-shrink: 0;
    margin-left: 8px;
}

.corp-admin-box {
    margin-top: 20px;
    padding: 14px;
    border-radius: 8px;
    background: #f5f8ff;
    border: 1px solid #d0dcff;
}

.corp-admin-box h4 {
    margin: 0 0 8px;
    font-size: 16px;
    color: #1B3A57;
}

.corp-admin-box p {
    margin: 0 0 12px;
    font-size: 14px;
}

.corp-admin-box .button {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

/* =========================
   Footer
   ========================= */

footer {
    text-align: center;
    padding: 15px 0;
    margin-top: 40px;
    border-top: 1px solid #ccc;
    color: #555;
    font-size: 0.8rem;
}


/* =========================
   Plan Page
   ========================= */

.plan-main {
    max-width: 1000px;
    margin: 50px auto;
    text-align: center;
    padding: 0 20px;
}

.plan-main h1 {
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.plan-lead {
    font-size: 1.05rem;
    margin-bottom: 40px;
    color: #444;
}

.plan-cards {
    display: flex;
    justify-content: center;
    gap: 25px;
}

.plan-card {
    background: #ffffff;
    border: 1px solid #ccc;
    padding: 25px;
    width: 270px;
    border-radius: 10px;
    transition: 0.25s ease;
    position: relative;
}

.plan-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.plan-card h2 {
    margin: 0 0 15px 0;
    font-size: 1.4rem;
    color: #1B3A57;
}

.plan-price {
    font-size: 2.3rem;
    font-weight: bold;
    color: #1B3A57;
}

.plan-price span {
    font-size: 1rem;
    font-weight: normal;
    margin-left: 5px;
}

.plan-features {
    text-align: left;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 20px 0;
    padding-left: 18px;
}

.plan-footer {
    margin-top: 20px;
}

.plan-card.recommended {
    border: 2px solid #1B3A57;
    background: #F8FAFF;
}

.recommended-label {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #1B3A57;
    color: white;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: bold;
}

/* =========================
   Plan Page - 注意・免責
   ========================= */

.plan-notice {
    max-width: 1000px;
    margin: 40px auto 0;
    padding: 20px 24px;
    text-align: left;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #dde3ea;
    font-size: 0.9rem;
    color: #333;
}

.plan-notice h2 {
    margin: 0 0 12px;
    font-size: 1.2rem;
    color: #1B3A57;
}

.plan-notice p {
    margin: 6px 0;
    line-height: 1.6;
}

.plan-notice a {
    color: #1B3A57;
    text-decoration: underline;
}

.plan-agree-label {
    display: flex;
    align-items: center;
    margin-top: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1B3A57;
}

.plan-agree-label input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

/* =========================
   AI要約ボタン
   ========================= */

.summary-toggle-btn {
    /* 目立ちすぎない、控えめなボタンデザイン */
    background: #f0f4f7; /* 薄い背景色 */
    color: #1B3A57;      /* メインカラー */
    border: 1px solid #c9d6e4;
    padding: 4px 10px;
    margin-top: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    align-self: flex-start; /* article内（flex-direction: column）で左寄せに */
}

.summary-toggle-btn:hover {
    background-color: #e3ebf0;
}

/* AI要約のラベル（無料プランの一部表示など） */
.ai-summary-label {
    font-weight: bold;
    color: #1B3A57; /* メインカラーで強調 */
    display: inline-block;
    margin-right: 5px;
}

/* AI要約ボックス */
.article-summary {
    margin-top: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    border-left: 3px solid #c9d6e4;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.article-summary .ai-summary-label {
    font-weight: bold;
    color: #1B3A57;
    margin-right: 4px;
}

.ai-summary-text {
    margin: 4px 0 0;
}

.summary-upgrade {
    margin: 6px 0 0;
    font-size: 0.85rem;
    color: #b33;
}

.summary-notice {
    margin: 0;
    font-size: 0.9rem;
    color: #b33;
}

.article-info {
    margin: 4px 0 6px;
    font-size: 0.85rem;
    color: #555;
}

.article-category {
    display: inline-block;
    margin-right: 6px;
    padding: 2px 6px;
    border-radius: 3px;
    background: #eef3f8;
    color: #1B3A57;
}

.article-location {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    background: #f5f5f5;
    color: #444;
    font-size: 0.85rem;
}

/* PCなど共通：カテゴリハンバーガーボタンは基本非表示 */
.category-toggle-btn {
    display: none;
}

/* 契約ボタンの並び（PC） */
.contract-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

/* a.button と form 内の button を揃える */
.contract-actions .button,
.contract-actions button {
    min-width: 160px;
    text-align: center;
}

/* =========================
   Responsive (スマホ向け)
   ========================= */

@media (max-width: 600px) {

    body {
        font-size: 14px;
    }

    /* ヘッダーを縦並びにして2行構成にする */
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-left a {
        font-size: 1rem;          /* サイト名は少しだけ小さく */
        line-height: 1.3;
    }

    .header-right {
        margin-top: 4px;
        width: 100%;
        text-align: right;        /* マイページ / ログアウト を右寄せで2行目に */
        font-size: 0.9rem;
    }

    .header-right .header-divider {
        margin: 0 4px;
    }

    /* メンテナンスの注意文も少しだけコンパクトに */
    .notice {
        padding: 8px 10px;
        font-size: 0.8rem;
        line-height: 1.4;
    }

    /* 共通ボタンを少し大きく＆押しやすく */
    .button {
        padding: 11px 18px;
        font-size: 0.95rem;
    }

    /* AI要約ボタン：横いっぱい＆指で押しやすく */
    .summary-toggle-btn {
        width: 100%;
        text-align: center;
        padding: 8px 10px;
        font-size: 0.85rem;
        margin-top: 6px;
    }

    /* ヘッダー */
    header {
        padding: 10px 12px;
    }

    header a {
        font-size: 0.95rem;
    }

    /* トップページ */
    .top-main {
        max-width: 100%;
        margin: 24px auto 40px;
        padding: 0 12px;
    }

    .hero {
        padding: 20px 16px;
    }

    .hero h1 {
        font-size: 1.4rem;
        line-height: 1.4;
    }

    .hero-lead {
        font-size: 0.95rem;
    }

    .hero-actions {
        flex-direction: column;
        gap: 8px;
    }

    .hero-actions .button,
    .bottom-cta-button {
        display: block;
        width: 100%;
        box-sizing: border-box;  /* ← これがポイント */
        text-align: center;
        margin: 0;
    }

    .features,
    .for-whom,
    .bottom-cta {
        padding: 18px 16px;
    }

    /* 記事リスト レイアウト */
    .main-layout {
        flex-direction: column;
        margin: 16px 10px 30px;
    }

    /* スマホ用カテゴリ開閉ボタン */
    .category-toggle-btn {
        display: block;
        width: 100%;
        margin: 0 0 8px;
        padding: 10px 12px;
        border-radius: 6px;
        border: 1px solid #1B3A57;
        background: #1B3A57;
        color: #fff;
        font-size: 0.9rem;
        font-weight: 600;
    }

    /* サイドバー：通常は隠す、openクラスで表示 */
    .sidebar {
        display: none;
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .sidebar.open {
        display: block;
        background: #ffffff;
        padding: 8px 10px;
        border-radius: 6px;
        border: 1px solid #ddd;
    }

    .sidebar ul {
        list-style: none;
        padding: 0;
        margin: 0;
        border-right: none;
    }

    .sidebar li {
        margin: 4px 0;
    }

    .sidebar a {
        font-size: 0.9rem;
    }

    /* 記事カード */
    .article {
        padding: 10px 10px;
        font-size: 0.85rem;
    }

    .article h2 {
        font-size: 0.95rem;
    }

    .article .meta {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        font-size: 0.75rem;
        color: #666;
        margin-top: 4px;
    }

    .meta-left {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        margin-right: 0;
    }

    .meta-right {
        margin-left: 0;
        margin-top: 2px;
        flex-shrink: 0;
    }

    /* プラン・ログイン系 */
    .plan-main,
    .auth-main {
        margin: 40px auto 60px;
        padding: 0 16px;
    }

    .plan-cards {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .auth-card {
        padding: 20px 18px;
    }

    /* Plan Notice（スマホ） */
    .plan-notice {
        margin: 24px auto 0;
        padding: 16px 14px;
        font-size: 0.85rem;
        box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    }

    .plan-notice h2 {
        font-size: 1.05rem;
        margin-bottom: 8px;
    }

    .plan-agree-label {
        align-items: flex-start;
        line-height: 1.4;
    }

    /* ─────────────
       マイページ（スマホ）
       ───────────── */

    /* 上部ボタン「要約記事一覧を見る」 */
    .mypage-top-actions {
        margin: 16px 0 20px;
        text-align: center;
    }

    .mypage-top-actions a.button {
        display: block;
        width: 100%;
        max-width: 260px;
        margin: 0 auto;
        box-sizing: border-box;
        text-align: center;
    }

    /* 無料プランの「有料プランへアップグレード」ボタン */
    .action-area {
        margin-top: 15px;   /* 既存と同等の余白 */
        text-align: center;
    }

    .action-area a.button {
        display: block;
        width: 100%;
        max-width: 260px;
        margin: 0 auto;
        box-sizing: border-box;
        text-align: center;
    }

    /* 退会ボタン：中央寄せ＋少し小さめ（スマホだけ） */
    .mypage-delete-area {
        text-align: center;
        margin-top: 20px;
    }

    .mypage-delete-area .button {
        display: inline-block;
        width: auto;
        padding: 8px 18px;
        font-size: 0.85rem;
        border-radius: 18px;
        box-sizing: border-box;
    }

    .contract-actions {
        display: flex;
        flex-direction: column;   /* 縦並び */
        align-items: stretch;     /* 子要素を親幅いっぱいに */
        gap: 8px;
        width: 100%;              /* 親もカード幅いっぱい */
    }

    /* 直下の子（a と form）を全部同じ幅に */
    .contract-actions > * {
        width: 100%;
        margin: 0;
    }

    /* 中のボタンも幅100%＆中央寄せ */
    .contract-actions a.button,
    .contract-actions button {
        display: block;
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    /* form の中にあるボタンも 100% 幅に乗るように */
    .contract-actions form {
        width: 100%;
        margin: 0;
    }

    /* ─────────────
       フッター（スマホ）
       ───────────── */

    /* フッター全体を少しコンパクトに、行間広めに */
    footer,
    .site-footer {
        font-size: 0.75rem;
        line-height: 1.6;
    }

    /* 中身を少し余白をとって中央寄せ */
    .footer-inner {
        padding: 10px 10px 14px;
        text-align: center;
    }

    /* リンクは2〜3行に自然に折り返しさせる */
    .footer-links {
        display: block;          /* flex でもOKだが、blockの方が素直に折り返す */
        margin-bottom: 6px;
    }

    .footer-links a {
        display: inline-block;   /* 単語ごとに改行しやすくする */
        margin: 2px 6px;
        font-size: 0.8rem;
    }

    /* 「｜」がある場合はスマホでは非表示にしてスッキリさせる */
    .footer-divider {
        display: none;
    }

    .footer-copy {
        font-size: 0.75rem;
    }
}

/* PC 用ヘッダレイアウト調整 */
@media (min-width: 768px) {
    header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .header-left {
        display: flex;
        flex-direction: row;   /* ★ ここを追加して column を上書き */
        align-items: center;
        gap: 16px;              /* タイトルと法人名の間隔 */
    }

    /* タイトルリンクが横幅いっぱいを占有しないようにする */
    .header-left a {
        display: inline-block;
        white-space: nowrap;    /* タイトル自体も折り返しにくくする */
    }

    .header-corp-name {
        margin-top: 0;
        font-size: 1rem;        /* タイトル(1.1rem)より ほんの少し小さく */
        font-weight: 500;       /* 中太字で存在感アップ */
        color: #d9e4ff;         /* 今の色のまま */
        white-space: nowrap;
    }
}

/* =========================
   ログイン / 会員登録 / お問い合わせページ
   ========================= */

.auth-main {
    max-width: 480px;
    margin: 60px auto 80px;
    padding: 0 20px;
    text-align: center;
}

.auth-title {
    font-size: 1.8rem;
    margin-bottom: 24px;
    color: #1B3A57;
}

.auth-card {
    background: #ffffff;
    padding: 24px 26px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    text-align: left;
}

.auth-card form {
    margin: 0;
}

.auth-card label {
    display: block;
    font-size: 0.9rem;
    margin-top: 10px;
    margin-bottom: 4px;
}

/* ★ここを拡張：text と textarea も同じ見た目にする */
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"],
.auth-card textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font: inherit;
}

.auth-card textarea {
    resize: vertical;
    min-height: 120px;
}

/* フォーム内の送信ボタンは幅100% */
.auth-card form .button {
    width: 100%;
    margin-top: 16px;
}

/* 完了画面など、リンクボタンは自動幅＋中央寄せ */
.auth-card .auth-register-link .button {
    display: inline-block;
    width: auto;
    min-width: 220px;      /* 好みで 180〜240px くらいに調整 */
    padding: 10px 32px;    /* ここで横のボリュームも微調整可能 */
}

.auth-register-link {
    margin-top: 18px;
    text-align: center;
    font-size: 0.9rem;
}

.auth-error {
    color: red;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.auth-success {
    color: green;
    margin-bottom: 12px;
    font-size: 0.95rem;
}


/* =========================
   テーブル（利用規約・特商法など）
   ========================= */

.top-main table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.top-main th,
.top-main td {
    border: 1px solid #ddd;
    padding: 8px 10px;
    vertical-align: top;
}

.top-main th {
    width: 25%;
    background: #f0f4f7;
    font-weight: 600;
}

