/* ====================================
   基本トークン・全体レイアウト
==================================== */

:root {
    --primary-color: #3498db;
    --dark-blue: #2c3e50;
    --success-green: #27ae60;
    --accent-orange: #e67e22;
    --bg-gray: #e5edf5;
    --border-color: #dcdde1;
}

html, body {
    background-color: #e6f3ff !important; /* または #f4f7f9 */
}

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-gray);
    color: #2f3640;
    margin: 0;
    padding: 20px;
    font-size: 18px;
    box-sizing: border-box;
}

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

/* ページ共通の外枠：ヘッダーもカードもこの幅に乗せる */
.page-shell {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.main-area {
    width: 100%;
    margin: 0;
}

.container-inner {
    width: 100%;
    padding: 24px 30px;
}

/* 各ページのメインカード（結果・料金・履歴など） */
.container {
    width: 100%;
    margin: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}

/* 共通ページタイトル（必要なページだけ .page-title を使う） */
.page-title {
    font-size: 25px;
    font-weight: 700;
    margin: 20px 30px 16px;
}

/* ====================================
   共通ヘッダー（header.jsp 用）
==================================== */

/* page-shell の中で 100% 幅で扱う。max-width は page-shell に集約 */
.site-header-wrap {
    width: 100%;
    margin: 0 0 20px;
}

/* 実際のヘッダーバー */
.site-header {
    background: #2c3e50;
    color: #fff;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    border-radius: 12px;
    font-size: 16px;
    flex-wrap: wrap;
    box-sizing: border-box;
}

/* 左側ブロック（タイトル・サブタイトル・残数バナー） */
.header-left {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.header-left h1.app-title,
.app-title {
    margin: 0;
    font-size: 24px !important;
    color: #ffffff;
}

.header-sub {
    font-size: 15px;
    margin-top: 4px;
    margin-bottom: 8px;
    opacity: 0.9;
    white-space: normal;
    line-height: 1.5;
}

/* 残り PDF / プランバナー */
.usage-banner {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 16px;
    border-radius: 10px;
    background: #f8fbff;
    border: 1px solid #cfe0ff;
    color: #2c3e50;
    font-size: 16px; /* 16px に揃える */
    line-height: 1.5;
    font-weight: 600;
}

.usage-banner strong {
    font-size: 17px; /* 1段だけ大きく */
    font-weight: 700;
    color: #1f2d3d;
}

.usage-banner-plan {
    background: #f3f8ff;
    border: 1px solid #cfe0ff;
    color: #2c3e50;
}

.usage-sep {
    margin: 0 6px;
    color: #6b7c93;
    font-weight: 500;
}

/* 右側ブロック（ユーザー名 + ナビ） */
.header-right {
    min-width: 0;
    flex: 1 1 420px;
    text-align: right;
}

.header-user {
    text-align: right;
    font-size: 16px;
    font-weight: 500;
}

.header-right > div:first-child {
    text-align: right;
    font-size: 16px;
    font-weight: 500;
}

/* ナビゲーション */
.top-nav {
    margin-top: 6px;
}

.top-nav a {
    display: inline-block;
    padding: 8px 12px;
    margin-left: 4px;
    margin-top: 6px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffeb99;
}

.top-nav a.active {
    background: #ffeb99;
    color: #2c3e50;
    font-weight: 700;
}

.top-nav a:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* ログアウトだけ少し細く */
.logout {
    font-size: 15px;
}

/* トップ画面（page-home）だけ「トップへ戻る」を非表示にする */
.page-home .top-nav a:first-child {
    display: none;
}

/* モバイル向けヘッダー調整 */
@media (max-width: 768px) {
    .site-header {
        flex-direction: column;
        align-items: stretch;
        padding: 14px 16px;
    }

    .app-title {
        font-size: 22px !important;
    }

    .header-sub {
        font-size: 15px;
        margin-bottom: 12px;
        white-space: normal;
    }

    .header-right {
        min-width: auto;
        text-align: left;
    }

    .header-right > div:first-child,
    .header-user {
        text-align: left;
        margin-bottom: 8px;
    }

    .top-nav a {
        font-size: 14px;
        margin-left: 0;
        margin-right: 6px;
    }
}

/* ====================================
   共通ボタン・フォーム
==================================== */

.action-btn {
    display: inline-block;
    padding: 8px 14px;
    margin-right: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #f8fbff;
    color: var(--dark-blue);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.action-btn:hover {
    background: #eaf4fb;
    border-color: #b8d7ee;
}

.inline-form {
    display: inline-block;
    margin: 0;
}

/* 共通フッター */
.app-footer {
    font-size: 12px;
    color: #777;
    padding: 16px 0 24px;
    text-align: center;
}

.app-footer a {
    color: #3498db;
    text-decoration: none;
}

/* ====================================
   料金ページ共通（/pricing 等）
==================================== */

.page-pricing .container-inner {
    padding: 30px;
}

/* サブタイトル */
.page-pricing .subtitle {
    font-size: 15px;
    color: #666;
    margin: 0 30px 24px;
    line-height: 1.6;
}

/* 年払い / 月払いタブ */
.page-pricing .toggle-year {
    display: inline-flex;
    border-radius: 999px;
    background: #ecf0f1;
    padding: 3px;
    margin: 0 30px 24px;
    font-size: 12px;
}

.page-pricing .toggle-year span {
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    color: #555;
}

.page-pricing .toggle-year span.active {
    background: #3498db;
    color: #fff;
    font-weight: 700;
}

/* プランカードの並び */
.page-pricing .pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 0 30px 10px;
}

/* カード本体 */
.page-pricing .plan-card {
    border: 1px solid #e1e4e8;
    border-radius: 10px;
    padding: 18px 16px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* おすすめカードの強調 */
.page-pricing .plan-card.plan-highlight {
    border-width: 2px;
    border-color: #3498db;
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.18);
}

/* ヘッダー部分 */
.page-pricing .plan-header h2 {
    margin: 0;
    font-size: 16px;
    color: #2c3e50;
}

.page-pricing .plan-tagline {
    margin: 4px 0 0;
    font-size: 12px;
    color: #7f8c8d;
}

/* おすすめバッジ */
.page-pricing .plan-badge {
    display: inline-block;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f1c40f;
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 6px;
}

/* 料金表示 */
.page-pricing .plan-price {
    margin: 12px 0 10px;
}

.page-pricing .plan-price .price-main {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
}

.page-pricing .plan-price .price-unit {
    font-size: 12px;
    margin-left: 4px;
    color: #7f8c8d;
}

.page-pricing .plan-price .price-meta {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

/* 特徴リスト */
.page-pricing .plan-features {
    list-style: none;
    padding: 0;
    margin: 10px 0 14px;
}

.page-pricing .plan-features li {
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
}

/* ボタン */
.page-pricing .plan-actions {
    margin-top: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.page-pricing .plan-actions form {
    margin: 0;
}

.page-pricing .btn-plan {
    display: inline-block;
    width: 100%;
    padding: 10px 0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
}

.page-pricing .btn-plan.btn-primary {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.page-pricing .btn-plan.btn-outline {
    background: #fff;
    color: #3498db;
    border-color: #3498db;
}

.page-pricing .btn-plan:hover {
    opacity: 0.9;
}

/* 備考 */
.page-pricing .note {
    font-size: 11px;
    color: #777;
    margin: 16px 30px 0;
    line-height: 1.6;
}

.btn-current-plan {
    text-align: center;
    white-space: nowrap;
}

/* 追加コンテンツ（pricing-extra） */
.page-pricing .pricing-extra {
    max-width: 1100px;
    margin: 48px auto 24px;
    padding: 0 16px;
    clear: both;
}

.page-pricing .pricing-extra-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    line-height: 1.8;
}

.page-pricing .pricing-extra-title {
    margin: 0 0 10px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #222;
}

.page-pricing .pricing-extra-lead {
    margin: 0 auto 20px;
    max-width: 760px;
    text-align: center;
    line-height: 1.75;
    font-size: 0.95rem;
    font-weight: 400;
    color: #555;
}

.page-pricing .pricing-extra-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 8px;
    margin-bottom: 12px;
}

.page-pricing .pricing-extra-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 16px;
    height: 100%;
}

.page-pricing .pricing-extra-item h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #222;
}

.page-pricing .pricing-extra-list {
    margin: 0;
    padding-left: 1.2em;
    color: #444;
    line-height: 1.7;
    font-size: 0.95rem;
}

.page-pricing .pricing-extra-list li:not(:last-child) {
    margin-bottom: 6px;
}

.page-pricing .pricing-extra-note {
    margin: 36px 0 0;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.75;
    color: #666;
    clear: both;
}

.page-pricing .pricing-extra-actions {
    margin-top: 20px;
    text-align: center;
    clear: both;
}

.page-pricing .pricing-extra-actions .btn-plan {
    display: inline-block !important;
    width: auto !important;
    min-width: 220px;
    max-width: 260px;
    text-align: center;
}

@media (max-width: 900px) {
    .page-pricing .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-pricing .pricing-extra-grid {
        grid-template-columns: 1fr;
    }

    .page-pricing .pricing-extra-card {
        padding: 24px 18px;
    }

    .page-pricing .pricing-extra-title {
        font-size: 1.05rem;
    }

    .page-pricing .pricing-extra-actions .btn-plan {
        width: 100% !important;
        max-width: 260px;
    }
}

/* ====================================
   Trial バナー・フォーム共通
==================================== */

.form-container-narrow {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 24px;
}

.trial-banner {
    max-width: 560px;
    margin: 0 auto 16px;
    padding: 10px 14px;
    background: #fff3cd;
    border: 1px solid #ffe08a;
    border-radius: 6px;
    color: #8a6d3b;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.trial-banner::before {
    content: "⏰";
    font-size: 16px;
}

.trial-banner strong {
    font-size: 15px;
    margin: 0 2px;
}

/* ====================================
   履歴一覧ページ
==================================== */

.page-history-list .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 16px;
}

.page-history-list .header .page-title {
    font-size: 22px;
    margin: 0;
}

.page-history-list .header .btn-new {
    display: inline-block;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 6px;
    background: #3498db;
    color: #fff;
    text-decoration: none;
}

/* ヘッダーとタイトルの間隔 */
.page-history-list .main-area {
    margin-top: 16px;
}

/* テーブル */
.page-history-list .biz-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
}

.page-history-list .container-inner {
    padding-left: 24px;
    padding-right: 24px;
}

.page-history-list .biz-table th,
.page-history-list .biz-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e1e4e8;
}

.page-history-list .biz-table th {
    background: #f5f7fa;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    color: #555;
}

.page-history-list .biz-table td.worker-name {
    font-weight: 600;
}

.page-history-list .btn-view {
    display: inline-block;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 4px;
    background: #ecf0f1;
    color: #2c3e50;
    text-decoration: none;
}

/* ====================================
   結果画面の PDF パック購入エリア
==================================== */

.page-result .pdf-pack-section {
    padding: 16px 30px 24px;
    border-top: 1px solid #e1e4e8;
    margin-top: 8px;
}

.page-result .pdf-pack-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.page-result .pdf-pack-section-sub {
    font-size: 12px;
    color: #777;
    margin-bottom: 12px;
    line-height: 1.6;
}

.page-result .pdf-pack-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.page-result .pdf-pack-card {
    flex: 1 1 260px;
    border: 1px solid #e1e4e8;
    border-radius: 10px;
    padding: 14px 12px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
    font-size: 13px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.page-result .pdf-pack-title {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 6px;
}

.page-result .pdf-pack-desc {
    font-size: 12px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
}

.page-result .btn-pdf-pack {
    display: inline-block;
    width: 100%;
    padding: 10px 0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    color: #fff;
}

.page-result .btn-pdf-pack.btn-pdf10 {
    background: #8e44ad;
    border-color: #8e44ad;
}

.page-result .btn-pdf-pack.btn-pdf30 {
    background: #d35400;
    border-color: #d35400;
}

.page-result .btn-pdf-pack:hover {
    opacity: 0.92;
}

@media (max-width: 768px) {
    .page-result .pdf-pack-section {
        padding: 16px 20px 24px;
    }
}

/* ====================================
   Contact / 問い合わせページ
==================================== */

.page-contact .form-container-narrow {
    max-width: 720px;
    margin: 0 auto;
}

.page-contact .desc {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
    margin-bottom: 8px;
}

.page-contact .desc-note {
    font-size: 12px;
    color: #888;
    line-height: 1.7;
    margin-bottom: 24px;
}

.page-contact .form-group {
    margin-bottom: 16px;
    text-align: left;
}

.page-contact label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

.page-contact input[type="text"],
.page-contact input[type="email"],
.page-contact textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    background: #fff;
}

.page-contact textarea {
    resize: vertical;
    min-height: 120px;
}

.page-contact .hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    line-height: 1.6;
}

.page-contact .form-actions {
    margin-top: 24px;
}

.page-contact .btn-primary {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    background: #3498db;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
}

.page-contact .btn-primary:hover {
    background: #2980b9;
}

/* 一般的な問い合わせフォーム（page-contact-general） */
.page-contact-general .desc {
    font-size: 13px;
    color: #666;
    line-height: 1.8;
    margin-bottom: 20px;
}

.page-contact-general .form-group {
    margin-bottom: 16px;
}

.page-contact-general label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 6px;
}

.page-contact-general input[type="text"],
.page-contact-general input[type="email"],
.page-contact-general select,
.page-contact-general textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #dcdde1;
    border-radius: 6px;
    background: #fff;
}

.page-contact-general textarea {
    min-height: 160px;
    resize: vertical;
}

.page-contact-general .btn-primary {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.page-contact-general .btn-primary:hover {
    background: #2c3e50;
}

.page-contact-general .note {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    line-height: 1.6;
}

.page-contact-general .form-actions {
    margin-top: 20px;
}