/* 基本設定とリセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* スムーススクロール */
}

body {
    font-family: 'Hiragino Sans', 'ヒラギノ角ゴ ProN W3', 'Yu Gothic', 'メイリオ', Meiryo, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8; /* 全体の背景色 */
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
}

/* ヘッダー */
header {
    background-color: #004d9c; /* ダークブルー */
    color: #fff;
    padding: 15px 0;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

.site-logo {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.site-logo a {
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* メインナビゲーション (PC版) */
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 25px; /* メニュー間のスペース */
}

.main-nav ul li a {
    color: #fff;
    font-weight: 500;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}

.main-nav ul li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: #fff352; /* 黄色 */
    transition: width 0.3s ease;
}

.main-nav ul li a:hover::after {
    width: 100%;
}

/* ハンバーガーメニュー (モバイル版) */
.drawer__button {
    display: none; /* PCでは非表示 */
    background: none;
    border: none;
    width: 30px;
    height: 25px;
    position: relative;
    cursor: pointer;
    z-index: 1100;
}

.drawer__button span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #fff;
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
}

.drawer__button span:nth-child(1) { top: 0; }
.drawer__button span:nth-child(2) { top: 11px; }
.drawer__button span:nth-child(3) { top: 22px; }

.drawer__button.active span:nth-child(1) {
    top: 11px;
    transform: rotate(45deg);
}
.drawer__button.active span:nth-child(2) {
    opacity: 0;
}
.drawer__button.active span:nth-child(3) {
    top: 11px;
    transform: rotate(-45deg);
}

/* モバイルナビゲーション */
.main-nav.drawer__nav { /* .drawer__nav を .main-nav に統合 */
    position: fixed;
    top: 0;
    right: -100%; /* 初期状態では画面外 */
    width: 250px;
    height: 100%;
    background-color: #004d9c;
    padding-top: 80px;
    transition: right 0.3s ease;
    z-index: 1050;
    box-shadow: -2px 0 5px rgba(0,0,0,0.2);
}

.main-nav.drawer__nav.active {
    right: 0;
}

.main-nav.drawer__nav ul {
    flex-direction: column;
    gap: 0;
}

.main-nav.drawer__nav ul li {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.main-nav.drawer__nav ul li:last-child {
    border-bottom: none;
}

.main-nav.drawer__nav ul li a {
    display: block;
    padding: 15px 20px;
    color: #fff;
}

.main-nav.drawer__nav ul li a:hover {
    background-color: rgba(255,255,255,0.1);
}

/* ボタン */
.btn-primary-header { /* ヘッダー用ボタン */
    background-color: #fff352; /* 黄色 */
    color: #004d9c; /* ダークブルー */
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
    white-space: nowrap; /* テキストの折り返し防止 */
}

.btn-primary-header:hover {
    background-color: #e6e64c;
    color: #003366;
}

.btn-cta { /* 主要CTAボタン */
    display: inline-block;
    background-color: #ff6f61; /* 赤オレンジ系 */
    color: #fff;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-cta:hover {
    background-color: #e55a4c;
    transform: translateY(-2px);
}

.btn-large { /* CTAボタンの大型版 */
    font-size: 1.3em;
    padding: 18px 40px;
}

.btn-secondary { /* 二次的なボタン */
    display: inline-block;
    background-color: #f0f0f0;
    color: #333;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.3s ease;
    border: 1px solid #ccc;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

.btn-primary { /* 基本的なフォーム・管理画面用ボタン */
    background-color: #007bff;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 0.9em;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-small { /* テーブル内のボタンなど */
    background-color: #007bff;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.8em;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.btn-small:hover {
    background-color: #0056b3;
}

.btn-secondary-small { /* ファイル選択ボタンなど */
    background-color: #6c757d;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.8em;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.btn-secondary-small:hover {
    background-color: #5a6268;
}

/* メインコンテンツの共通スタイル */
main {
    padding: 40px 0;
}

.container {
    max-width: 1000px; /* コンテンツの最大幅 */
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    font-size: 32px;
    font-weight: bold;
    color: #004d9c;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 60px;
    height: 3px;
    background-color: #ff6f61;
    border-radius: 2px;
}

.section-description {
    font-size: 1.1em;
    color: #555;
    text-align: center;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-bg-light {
    background-color: #f0f4f8; /* 薄い背景色 */
    padding: 60px 0; /* セクションの上下パディング */
}

/* コンテンツボックス */
.content-box { /* 旧 box2, box11 に相当 */
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    padding: 30px;
    margin-bottom: 30px;
}

/* フォーム共通スタイル */
.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="password"],
.contact-form input[type="tel"],
.contact-form textarea,
.contact-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form input[type="password"]:focus,
.contact-form input[type="tel"]:focus,
.contact-form textarea:focus,
.contact-form select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

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

.contact-form .required {
    color: #ff6f61;
    font-size: 0.9em;
    margin-left: 5px;
}

.contact-form .form-actions {
    text-align: center;
    margin-top: 30px;
}

/* ログインセクション固有の調整 */
.login-section .login-form-container {
    max-width: 500px; /* ログインフォームの幅を制限 */
    margin: 0 auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    padding: 40px;
    text-align: center; /* フォーム内のテキストを中央寄せ */
}

.login-section .login-form-container .form-group {
    text-align: left; /* ラベルと入力欄を左寄せに戻す */
}

.login-section .login-links {
    margin-top: 20px;
    font-size: 0.9em;
}

.login-section .login-links a {
    color: #007bff;
    margin: 0 10px;
}

/* テーブルスタイル */
.lemon1-table,
.lemon2-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.95em;
}

.lemon1-table th,
.lemon1-table td,
.lemon2-table th,
.lemon2-table td {
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.lemon1-table th,
.lemon2-table thead th {
    background-color: #f5f5f5;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
}

.lemon2-table thead th {
    background-color: #eaf0f6; /* テーブルヘッダーの背景色を少し変える */
    color: #004d9c;
}

.lemon1-table tbody tr:nth-child(even),
.lemon2-table tbody tr:nth-child(even) {
    background-color: #fcfcfc; /* 交互の行の背景色 */
}

.lemon1-table tbody tr:hover,
.lemon2-table tbody tr:hover {
    background-color: #eef7ff; /* ホバー時の背景色 */
}

.lemon1-table .table-label {
    width: 200px; /* 登録者情報の左列の幅を固定 */
    background-color: #f9f9f9;
    font-weight: 500;
}

.lemon1-table .table-value {
    word-break: break-all; /* 長い文字列の折り返し */
}

.lemon1-table .table-action,
.lemon2-table .table-action {
    text-align: center;
    padding-top: 20px;
}

.lemon2-table th[rowspan="2"] {
    vertical-align: middle;
}

.wide-table {
    width: 100%; /* フル幅に */
    table-layout: fixed; /* レイアウトを固定し、列幅を制御しやすくする */
}

/* ファイルアップロードテーブルの調整 */
.file-upload-table td {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap; /* スマホでボタンとファイル名が改行されるように */
}

.file-upload-table .file-name {
    flex-grow: 1;
    min-width: 150px;
    padding: 8px 0;
    font-size: 0.9em;
    color: #666;
    border-bottom: 1px dashed #ddd; /* ファイル名の表示に下線 */
}


/* フッター */
footer {
    background-color: #333;
    color: #eee;
    padding: 30px 0;
    text-align: center;
    margin-top: 50px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-nav ul li a {
    color: #eee;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.footer-nav ul li a:hover {
    color: #fff352;
}

.copyright {
    font-size: 0.8em;
    color: #bbb;
}

/* その他の共通スタイル */
.text-center {
    text-align: center;
}

.mt-5 {
    margin-top: 50px;
}

.small-text {
    font-size: 0.85em;
    color: #777;
    text-align: center;
    margin-top: 10px;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .header-inner {
        padding: 0 15px;
    }

    .site-logo {
        font-size: 20px;
    }

    .main-nav ul {
        display: none; /* スマホでは通常ナビを非表示 */
    }

    .drawer__button {
        display: block; /* スマホでハンバーガーボタンを表示 */
    }

    .main-nav.drawer__nav {
        width: 100%; /* スマホでは全幅 */
    }

    .btn-primary-header {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-subheading, .hero-text {
        font-size: 1em;
    }

    .btn-cta {
        padding: 12px 25px;
        font-size: 1em;
    }

    .btn-large {
        font-size: 1.1em;
        padding: 15px 30px;
    }

    .section-title {
        font-size: 26px;
    }

    .section-description {
        font-size: 1em;
        margin-bottom: 20px;
    }

    /* 各グリッドレイアウトの調整 */
    .problem-list,
    .solution-grid,
    .feature-grid,
    .voice-grid {
        grid-template-columns: 1fr; /* 1列にする */
        gap: 30px;
    }

    .problem-item,
    .solution-item,
    .feature-item,
    .voice-item {
        margin-bottom: 0; /* ギャップで調整するため */
    }

    .flow-steps {
        flex-direction: column; /* 縦並びにする */
        gap: 30px;
    }

    .flow-step {
        width: 100%;
    }

    .lemon1-table th,
    .lemon1-table td,
    .lemon2-table th,
    .lemon2-table td {
        padding: 8px 10px;
        font-size: 0.85em;
        word-break: break-word; /* セル内のテキスト折り返し */
    }

    .lemon2-table th,
    .lemon2-table td {
        white-space: normal; /* ヘッダーの折り返しを許可 */
    }

    .lemon1-table .table-label {
        min-width: 100px;
        width: auto; /* スマホでは自動調整 */
    }

    /* ファイルアップロードテーブルの調整 */
    .file-upload-table td {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .file-upload-table .file-name {
        width: 100%;
        text-align: left;
    }
}

.tab-pane {
    display: none; /* デフォルトでは非表示にする */
}

.tab-pane.active {
    display: block; /* activeクラスが付いているものだけ表示する */
}

/* フォーム共通スタイル (追加・確認) */
.form-group {
    margin-bottom: 20px; /* 各入力グループの下に余白 */
}

.form-group label {
    display: block; /* ラベルをブロック要素にして、その下にインプットが来るように */
    margin-bottom: 8px; /* ラベルと入力欄の間に少し余白 */
    font-weight: bold;
    color: #333;
}

/* input[type="text"] などの既存スタイルに加えて、form-control クラスも指定 */
.form-control { /* 新たに追加したクラス */
    width: 100%; /* 親要素の幅いっぱいに広げる */
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

/* Readonlyな入力欄のスタイル（必要であれば） */
.form-control[readonly] {
    background-color: #e9ecef; /* 少しグレーアウト */
    opacity: 1; /* 不透明度を元に戻す（ブラウザによっては薄くなるため） */
}

/* ボタンの配置を中央寄せにするためのラッパー */
.form-actions {
    text-align: center;
    margin-top: 30px;
}

/* 登録番号 (T以降) の入力グループ */
.input-group {
    display: flex; /* 横並びにする */
    align-items: center; /* 垂直方向中央揃え */
    gap: 5px; /* 要素間の隙間 */
}

.input-group .input-group-text {
    font-weight: bold;
    color: #555;
    white-space: nowrap; /* テキストの折り返し防止 */
    padding-right: 5px;
}

/* 電話番号の入力グループ */
.input-group-tel {
    display: flex; /* 横並びにする */
    align-items: center; /* 垂直方向中央揃え */
    gap: 5px; /* 要素間の隙間 */
    flex-wrap: wrap; /* スマホで折り返す可能性を考慮 */
}

.input-group-tel input.form-control {
    flex: 1; /* 各入力欄が均等にスペースを埋めるように */
    min-width: 80px; /* 小さくなりすぎないように最小幅を設定 */
}

.input-group-tel span {
    font-weight: bold;
    color: #555;
    white-space: nowrap;
}

/* レスポンシブ対応 (電話番号) */
@media (max-width: 768px) {
    .input-group-tel {
        justify-content: center; /* スマホでは中央寄せ */
    }
    .input-group-tel input.form-control {
        min-width: unset; /* 最小幅を解除 */
        width: calc(33% - 10px); /* 3つで等幅に近くなるように調整 */
    }
    .input-group-tel span {
        margin: 0 2px;
    }
}

/* サイトマップリストのスタイル */
.sitemap-list {
    padding: 20px 0;
}

.sitemap-list h3 {
    font-size: 1.5em;
    color: #007bff; /* メインカラーに合わせる */
    margin-bottom: 15px;
    border-bottom: 2px solid #eee; /* 下線でセクションを区切る */
    padding-bottom: 5px;
}

.sitemap-list ul {
    list-style: none; /* デフォルトのリストスタイルを解除 */
    padding: 0;
    margin-bottom: 30px; /* 各セクションの下に余白 */
}

.sitemap-list ul li {
    margin-bottom: 10px;
}

.sitemap-list ul li a {
    color: #333;
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.3s ease;
}

.sitemap-list ul li a:hover {
    color: #007bff;
    text-decoration: underline;
}

/* タブボタン全体のコンテナ (必要に応じて) */
.tab-buttons {
    display: flex; /* ボタンを横並びにする */
    justify-content: center; /* 中央寄せ */
    margin-bottom: 30px; /* タブとコンテンツの間に余白 */
    border-bottom: 2px solid #eee; /* 下線で区切る */
}

/* 各タブボタンの基本スタイル */
.tab-button {
    background-color: #f8f9fa; /* 薄いグレーの背景 */
    color: #495057; /* 濃い目の文字色 */
    padding: 12px 25px; /* 上下左右のパディング */
    border: 1px solid #dee2e6; /* 薄いボーダー */
    border-bottom: none; /* アクティブ時に下に線が出ないように */
    cursor: pointer; /* カーソルをポインターに */
    font-size: 1.1em; /* 少し大きめの文字 */
    font-weight: 600; /* 少し太い文字 */
    border-radius: 8px 8px 0 0; /* 上部に丸み */
    transition: all 0.3s ease; /* ホバーやアクティブ時の変化を滑らかに */
    margin-right: 5px; /* ボタン間の隙間 */
    text-align: center;
    white-space: nowrap; /* ボタン内のテキストが改行されないように */
}

/* タブボタンのホバー効果 */
.tab-button:hover {
    background-color: #e2e6ea; /* ホバー時に少し濃いグレー */
    color: #212529; /* 文字色も少し濃く */
    border-color: #c5cbd0;
}

/* アクティブなタブボタンのスタイル */
.tab-button.active {
    background-color: #007bff; /* メインカラーの背景 */
    color: #ffffff; /* 白い文字 */
    border-color: #007bff; /* ボーダーもメインカラーに */
    border-bottom: none; /* アクティブなタブの下線は消す */
    position: relative; /* z-indexのために必要 */
    z-index: 1; /* 他のタブの上に表示 */
    padding-bottom: 14px; /* 下ボーダーが消えた分少し広げる */
    margin-bottom: -2px; /* 下のボーダーに重なるように調整 */
}

/* タブコンテンツのスタイル (念のため確認) */
.tab-pane {
    display: none; /* デフォルトでは非表示 */
    padding: 25px;
    border: 1px solid #dee2e6;
    border-radius: 0 0 8px 8px; /* 下部に丸み */
    background-color: #ffffff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.tab-pane.active {
    display: block; /* アクティブなタブだけ表示 */
}

/* スマホ対応 */
@media (max-width: 768px) {
    .tab-buttons {
        flex-wrap: wrap; /* ボタンが多ければ折り返す */
        justify-content: flex-start; /* 左寄せ */
    }
    .tab-button {
        flex-grow: 1; /* 各ボタンが均等に幅を広げる */
        margin-right: 2px;
        margin-left: 2px;
        margin-bottom: 5px; /* 折り返した時の隙間 */
        font-size: 1em;
        padding: 10px 15px;
    }
    .tab-button.active {
        margin-bottom: -2px;
    }
}

/* 基本のボタン共通スタイル */
.btn-base {
    display: inline-flex; /* テキストとアイコンを横並びにするため */
    align-items: center; /* 垂直方向中央揃え */
    justify-content: center; /* 水平方向中央揃え */
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    text-decoration: none; /* リンクとして使う場合の下線を消す */
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    white-space: nowrap; /* ボタン内のテキストが改行されないように */
}

/* メインカラーのボタン (例: ログイン、変更、追加など) */
.btn-primary {
    background-color: #007bff; /* 青系 */
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #0056b3; /* 濃い青 */
    transform: translateY(-1px); /* 少し浮き上がる効果 */
}

/* 小さいボタン (例: ダウンロードボタン) */
.btn-small {
    @extend .btn-base; /* btn-baseのスタイルを継承 (Sass/Lessの場合) */
    /* CSSの場合、btn-baseのプロパティをここにコピーするか、
       btn-smallにbtn-baseとbtn-smallの両方のクラスをHTMLで指定する */
    padding: 8px 15px; /* 小さめのパディング */
    font-size: 0.9em; /* 小さめのフォントサイズ */
    background-color: #6c757d; /* グレー系 */
    color: #ffffff;
}

.btn-small:hover {
    background-color: #5a6268; /* 濃いグレー */
    transform: translateY(-1px);
}

/* CTA (Call To Action) ボタン (例: ログイン、保存など、特に目立たせたいボタン) */
.btn-cta {
    @extend .btn-base; /* btn-baseのスタイルを継承 */
    padding: 15px 30px;
    font-size: 1.1em;
    background-color: #28a745; /* 緑系 */
    color: #ffffff;
    border-radius: 8px; /* 少し大きめの角丸 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-cta:hover {
    background-color: #218838; /* 濃い緑 */
    transform: translateY(-2px); /* より大きく浮き上がる効果 */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* テーブル内のボタンの調整（特に「過去の請求書」ページ） */
/* td要素内のボタンに対して、flexboxを使って中央寄せや間隔調整を行う */
.lemon1-table td input[type="submit"] {
    /* btn-small クラスが適用されていることを前提 */
    margin: 5px; /* ボタン間の余白 */
}

/* もしボタンが横並びにならない場合は、tdにdisplay:flexなどを適用する */
.lemon1-table td {
    text-align: center; /* ボタンをセル内で中央寄せ */
    vertical-align: middle; /* 垂直方向中央寄せ */
    white-space: nowrap; /* ボタンが改行されないように */
}

/* 必要であれば、ボタンにアイコンを追加する例（HTMLも変更が必要） */
/*
.btn-small.pdf::before {
    content: '\f1c1'; /* Font AwesomeのPDFアイコンのUnicode */
    font-family: 'Font Awesome 5 Free'; /* Font Awesomeのフォントファミリー */
    font-weight: 900; /* Solidアイコンの場合 */
    margin-right: 8px;
}
.btn-small.csv::before {
    content: '\f6dd'; /* Font AwesomeのCSVアイコンのUnicode */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 8px;
}
*/

