/**
 * 熊本県診療所（医科）賃上げ・物価支援交付申請 スタイル
 */

/* リセット・ベース */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    background-color: #f5f7fa;
}

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* コンテナ */
.page-container {
    max-width: 860px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ヘッダー */
.page-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: #fff;
    padding: 30px 20px;
    text-align: center;
}

.page-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.page-header .subtitle {
    margin: 10px 0 0;
    font-size: 16px;
    opacity: 0.9;
}

.admin-page .page-header .subtitle {
    font-size: 18px;
    opacity: 0.95;
    background: #ffffff;
    color: black;
    border-radius: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 15px;
}

.user-email {
    font-size: 14px;
    opacity: 0.9;
}

.btn-link-small {
    color: #fff;
    padding: 5px 12px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 4px;
    font-size: 13px;
}

.btn-link-small:hover {
    background-color: rgba(255,255,255,0.1);
    text-decoration: none;
}

/* メインコンテンツ */
.content {
    flex: 1;
    background-color: #fff;
    padding: 30px 20px;
}

.page-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #2c3e50;
}

/* セクション */
.intro-section,
.info-section,
.cta-section,
.login-section {
    margin-bottom: 30px;
}

.intro-section h2,
.info-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px;
    color: #2c3e50;
}

.info-section ul {
    margin: 0;
    padding-left: 20px;
}

.info-section li {
    margin-bottom: 8px;
}

.cta-section {
    text-align: center;
    padding: 30px 0;
}

.login-section {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-section p {
    margin: 0 0 15px;
    color: #666;
    font-size: 14px;
}

/* ボタン */
.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background-color: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background-color: #2980b9;
    text-decoration: none;
}

.btn-secondary {
    background-color: #fff;
    color: #3498db;
    border: 2px solid #3498db;
}

.btn-secondary:hover {
    background-color: #f0f7fc;
    text-decoration: none;
}

.btn-large {
    padding: 15px 40px;
    font-size: 18px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* フォーム */
.apply-form,
.edit-form,
.login-form,
.confirm-form {
    margin: 0;
}

.form-section {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h2,
.form-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

/* 2カラムレイアウト */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group label.required::before {
    content: "必須";
    display: inline-block;
    background-color: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
}

label.required-after::after {
    content: "必須";
    display: inline-block;
    background-color: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    flex-shrink: 0;
    margin-top: 2px;
}

.required-badge {
    display: inline-block;
    background-color: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
}

.checkbox-label.required-after {
    align-items: center;
}

.checkbox-label.required-after input[type="checkbox"] {
    margin-top: 0;
}

.checkbox-label.required-after::after {
    margin-top: 0;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input[type="number"] {
    width: 100px;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.form-group input[type="file"] {
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 6px;
    width: 100%;
}

.existing-file {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    margin-bottom: 10px;
    background-color: #e8f4fd;
    border: 1px solid #b8daff;
    border-radius: 6px;
}

.existing-file .file-name {
    flex: 1;
    font-size: 14px;
    color: #004085;
}

.existing-file .delete-file-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 13px;
    color: #721c24;
}

.existing-file .delete-file-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.form-hint {
    margin: 8px 0 0;
    font-size: 13px;
    color: #666;
}

.form-hint.form-hint-important {
    font-size: 14.5px;
    color: #c0392b;
}

.form-hint-emphasis {
    font-size: 16px;
    font-weight: bold;
}

.form-hint-inline {
    font-size: 14.5px;
    font-weight: normal;
    color: #c0392b;
}

/* 郵便番号入力エリア */
.postal-code-input {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.postal-code-input input[type="text"] {
    flex: 1;
    max-width: 150px;
}

/* 日付入力欄の幅制限 */
.form-group input[type="date"] {
    max-width: 200px;
}

/* 電話番号入力欄の幅制限 */
.form-group input[type="tel"] {
    max-width: 200px;
}

/* 氏名・フリガナ・メールアドレス・勤務先などの幅制限 */
.form-group input[name="name"],
.form-group input[name="name_kana"],
.form-group input[name="email"],
.form-group input[name="commute_name"] {
    max-width: 300px;
}

/* 赤字スタイル */
.text-danger {
    /*color: #e74c3c;*/
    color: #ff0000;
}

.postal-code-input .btn-secondary {
    padding: 12px 20px;
    white-space: nowrap;
    font-size: 14px;
}

.postal-code-input .btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 15px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.2s;
}

.radio-label:hover {
    border-color: #3498db;
    background-color: #f0f7fc;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
}

/* 同意・誓約の制約事項 */
.agreement-terms {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.8;
    max-height: 400px;
    overflow-y: auto;
}

.agreement-terms p {
    margin: 0 0 12px;
    text-indent: -1.5em;
    padding-left: 1.5em;
}

.agreement-terms p:last-child {
    margin-bottom: 0;
}

.form-actions {
    margin-top: 30px;
    text-align: center;
}

.form-actions-confirm {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* エラー・メッセージ */
.error-box {
    padding: 15px 20px;
    margin-bottom: 25px;
    background-color: #fdf0f0;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #721c24;
}

.error-box ul {
    margin: 0;
    padding-left: 20px;
}

.error-box p {
    margin: 0;
}

.success-box {
    padding: 15px 20px;
    margin-bottom: 25px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    color: #155724;
}

.success-box p {
    margin: 0;
}

/* 確認画面 */
.confirm-notice {
    margin-bottom: 25px;
    padding: 15px 20px;
    background-color: #fff3cd;
    border-radius: 6px;
    color: #856404;
}

.confirm-section {
    margin-bottom: 30px;
}

.confirm-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    color: #2c3e50;
}

.confirm-list {
    margin: 0;
    display: grid;
    grid-template-columns: 150px 1fr;
}

.confirm-list dt {
    padding: 12px 15px;
    background-color: #f8f9fa;
    font-weight: 500;
    border-bottom: 1px solid #eee;
}

.confirm-list dd {
    padding: 12px 15px;
    margin: 0;
    border-bottom: 1px solid #eee;
}

/* 完了画面 */
.complete-section {
    text-align: center;
    padding: 40px 20px;
}

.complete-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background-color: #27ae60;
    color: #fff;
    font-size: 40px;
    line-height: 80px;
    border-radius: 50%;
}

.complete-section h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 20px;
    color: #2c3e50;
}

.complete-message {
    margin-bottom: 30px;
    line-height: 1.8;
}

.notice-box {
    text-align: left;
    padding: 20px;
    margin-bottom: 30px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.notice-box h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px;
}

.notice-box ul {
    margin: 0;
    padding-left: 20px;
}

.notice-box li {
    margin-bottom: 5px;
}

.action-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* ログイン画面 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: 40px 30px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.login-box h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 600;
    text-align: center;
    color: #2c3e50;
}

.login-subtitle {
    margin: 10px 0 30px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.login-links {
    margin-top: 25px;
    text-align: center;
}

.login-box .form-group input[name="email"] {
    max-width: none;
}

/* 閲覧モード */
.view-section {
    margin-bottom: 30px;
}

.view-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    color: #2c3e50;
}

.detail-list {
    margin: 0;
    display: grid;
    grid-template-columns: 150px 1fr;
}

.detail-list dt {
    padding: 12px 15px;
    background-color: #f8f9fa;
    font-weight: 500;
    border-bottom: 1px solid #eee;
}

.detail-list dd {
    padding: 12px 15px;
    margin: 0;
    border-bottom: 1px solid #eee;
}

.file-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.file-link::before {
    content: "📎";
}

.edit-notice {
    padding: 15px 20px;
    margin-bottom: 25px;
    background-color: #e8f4fd;
    border: 1px solid #b8daff;
    border-radius: 6px;
    color: #004085;
}

.edit-notice p {
    margin: 0;
}

.readonly-notice {
    padding: 15px 20px;
    margin-top: 30px;
    background-color: #f8f9fa;
    border-radius: 6px;
    text-align: center;
    color: #666;
}

.readonly-notice p {
    margin: 0;
}

/* 戻るリンク */
.back-link {
    margin-top: 30px;
    text-align: center;
}

/* フッター */
.page-footer {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 13px;
    background-color: #f8f9fa;
}

.page-footer p {
    margin: 0;
}

/* エラー状態の入力欄 */
.form-group input.is-invalid,
.form-group textarea.is-invalid,
.form-group select.is-invalid {
    background-color: #fff5f5;
    border-color: #e53e3e;
}

/* エラー状態のラジオボタン・チェックボックス */
.radio-label:has(input.is-invalid),
.checkbox-label:has(input.is-invalid) {
    background-color: #fff5f5;
    border-color: #e53e3e;
}

/* キャンセル関連 */
.cancelled-notice {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1em;
    border-radius: 4px;
    margin: 1em 0;
}

.cancelled-notice p {
    margin: 0;
}

.cancel-section {
    margin-top: 2em;
    padding: 1em;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    background-color: #fff5f5;
}

.cancel-warning {
    color: #721c24;
    margin-bottom: 1em;
}

.btn-danger {
    display: inline-block;
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 0.5em 1.5em;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.btn-danger:hover {
    background-color: #c82333;
}

.section-divider {
    margin: 2em 0;
    border: none;
    border-top: 1px solid #ddd;
}

/* 右寄せ数値フィールド */
.form-group input.number-right {
    text-align: right;
}

/* 金額フィールド */
.amount-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.amount-field input {
    width: 150px !important;
}

.amount-field .unit {
    font-size: 16px;
    font-weight: 500;
}

/* 修正ありバッジ */
.badge-correction {
    display: inline-block;
    background-color: #e67e22;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
}

/* 番号付きブロック（①②③等の区切り） */
.numbered-block {
    margin-top: 10px;
}

.numbered-block > label {
    font-weight: 700;
}

.numbered-block-sub {
    margin-left: 2em;
}

/* チェックリストテーブル */
.checklist-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
}

.checklist-table tr {
    border-bottom: 1px solid #e1e4e8;
}

.checklist-table tr:last-child {
    border-bottom: none;
}

.checklist-table tr:hover {
    background-color: #f0f7fc;
}

.checklist-check {
    width: 40px;
    text-align: center;
    vertical-align: top;
    padding: 10px;
    cursor: pointer;
}

.checklist-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
}

.checklist-label {
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.6;
    cursor: pointer;
}

.checklist-label label {
    display: block;
    cursor: pointer;
}

/* 項目詳細 */
.item-details {
    margin-top: 10px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    font-size: 14px;
    line-height: 2;
    color: #333;
}

/* 金融機関検索 */
.bank-search-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.bank-search-wrapper input[type="text"] {
    flex: 1;
    background-color: #f5f5f5;
}

.btn-bank-search {
    padding: 12px 15px;
    background-color: #0066cc;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background-color 0.2s;
}

.btn-bank-search:hover {
    background-color: #0052a3;
}

.btn-bank-search svg {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

/* 修正パターン */
.correctable-field {
    padding: 15px;
    margin-bottom: 20px;
    background-color: #fafbfc;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
}

.correctable-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.correctable-row input.readonly-field,
.correctable-row input[type="text"],
.correctable-row input[type="tel"] {
    flex: 1;
}

.correctable-row .correction-toggle {
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
}

.correctable-row .correction-toggle .checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.readonly-field {
    background-color: #f0f0f0 !important;
    cursor: not-allowed;
}

.correction-toggle .checkbox-label {
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 14px;
}

/* 郵便番号の幅制限 */
.correctable-field input#postal_code,
.correctable-field input#postal_code_corrected,
.correctable-field input#facility_postal_code,
.correctable-field input#facility_postal_code_corrected {
    max-width: 150px;
}

/* 電話番号の幅制限 */
.correctable-field input#facility_tel,
.correctable-field input#facility_tel_corrected {
    max-width: 200px;
}

input.correction-input {
    margin-top: 10px;
    border-color: #ffd54f;
    background-color: #fffde7;
}

/* 検索入力 */
.search-input {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.search-input input[type="text"] {
    flex: 1;
    max-width: 250px;
}

#search_result_message {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

#search_result_message.search-success {
    background-color: #d4edda;
    color: #155724;
}

#search_result_message.search-error {
    background-color: #f8d7da;
    color: #721c24;
}

/* チェックボックスグループ */
.checkbox-group {
    margin-bottom: 8px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.2s;
}

.checkbox-label:hover {
    border-color: #3498db;
    background-color: #f0f7fc;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.file-current {
    font-size: 13px;
    color: #155724;
    background-color: #d4edda;
    padding: 5px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* レスポンシブ */
@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 20px;
    }

    .page-header {
        padding: 20px 15px;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .content {
        padding: 20px 15px;
    }

    .confirm-list,
    .detail-list {
        grid-template-columns: 1fr;
    }

    .confirm-list dt,
    .detail-list dt {
        border-bottom: none;
        padding-bottom: 5px;
    }

    .confirm-list dd,
    .detail-list dd {
        padding-top: 5px;
    }

    .radio-group {
        flex-direction: column;
    }

    .form-actions-confirm {
        flex-direction: column;
    }

    .action-links {
        flex-direction: column;
    }

    .header-actions {
        flex-direction: column;
        gap: 10px;
    }
}

.apply-form.skip-required label.required::before,
.apply-form.skip-required label.required-after::after,
.apply-form.skip-required .required-badge {
    display: none;
}
