* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Noto Sans JP", "Hiragino Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.8;
    color: #2a2a2a;
    background-color: #f2f3f5;
}

a {
    color: #c02933;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* レイアウト */
.page-wrap {
    max-width: 820px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ヘッダー */
.site-header {
    background-color: #fff;
    color: #333;
    padding: 20px 24px;
    border-bottom: 3px solid #ec323d;
}

.header-inner {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.site-header h1 {
    margin: 4px 0 0;
    font-size: 20px;
    font-weight: 700;
    color: #ec323d;
    letter-spacing: 0.02em;
}

.header-sub {
    margin: 4px 0 0;
    font-size: 13px;
    color: #666;
}

.header-user {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

/* メインコンテンツ */
.main-content {
    flex: 1;
    background-color: #fcfcfc;
    padding: 32px 24px;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #555;
}

/* セクション */
.section {
    margin-bottom: 28px;
}

.section-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #333;
}

.section-body {
    padding-left: 20px;
}

.subsection-title {
    font-size: 15px;
    font-weight: 700;
    margin: 16px 0 8px;
    color: #444;
}

.subsection-body {
    padding-left: 16px;
}

.info-list {
    margin: 0;
    padding-left: 20px;
}

.info-list li {
    margin-bottom: 6px;
}

/* アクションエリア */
.action-area {
    text-align: center;
    padding: 28px 0;
}

.sub-action {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.sub-action p {
    margin: 0 0 12px;
    color: #666;
    font-size: 14px;
}

/* ボタン */
.btn {
    display: inline-block;
    padding: 10px 28px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border-radius: 2px;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
    border: 2px solid transparent;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background-color: #ec323d;
    color: #fff;
    border-color: #ec323d;
}

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

.btn-outline {
    background-color: #fff;
    color: #c02933;
    border-color: #c02933;
}

.btn-outline:hover {
    background-color: #fdf0f0;
}

.btn-lg {
    padding: 14px 36px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

.btn-xs {
    padding: 3px 10px;
    font-size: 12px;
}

.btn-danger {
    background-color: #c0392b;
    color: #fff;
    border-color: #c0392b;
}

.btn-danger:hover {
    background-color: #a93226;
    border-color: #a93226;
}

.btn-block {
    display: block;
    width: 100%;
}

/* キャンセルセクション */
.cancel-section {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #ddd;
    text-align: center;
}

.cancel-warning {
    margin: 0 0 16px;
    font-size: 13px;
    color: #888;
}

/* フォーム */
.form {
    margin: 0;
}

.fieldset {
    border: 1px solid #d5d8dc;
    border-radius: 2px;
    padding: 24px 20px;
    margin: 0 0 28px;
    background-color: #f8f9fa;
}

.download-area {
    margin-top: 14px;
    text-align: center;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
}

.download-area .btn {
    background-color: #ec323d;
    color: #fff;
    border-color: #ec323d;
}

.download-area .btn:hover {
    background-color: #d42a34;
    border-color: #d42a34;
}

.download-area + .info-list {
    margin-top: 16px;
}

.fieldset legend {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    padding: 0 8px;
}

.fieldset > p:first-of-type {
    margin-top: 0;
}

.field {
    margin-bottom: 20px;
}

.field:last-child {
    margin-bottom: 0;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
}

.field label.required::before {
    content: "必須";
    display: inline-block;
    background-color: #c0392b;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 2px;
    margin-right: 6px;
    vertical-align: middle;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field input[type="password"],
.field textarea,
.field select {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #b5b8bc;
    border-radius: 2px;
    transition: border-color 0.15s, box-shadow 0.15s;
    background-color: #fff;
}

.field input[type="email"] {
    max-width: 360px;
}

.field input[type="tel"] {
    max-width: 200px;
}

.field input#facility_name,
.field input#corporation_name {
    max-width: 400px;
}

.field input#facility_name_kana,
.field input#corporation_name_kana {
    max-width: 400px;
}

.field input#representative_position,
.field input#representative_name,
.field input#representative_name_kana,
.field input#office_contact_name,
.field input#account_holder,
.field input#account_holder_kana {
    max-width: 240px;
}

.field input#account_number {
    max-width: 200px;
}

.field select#account_type {
    max-width: 200px;
}

.field input#bank_name,
.field input#branch_name {
    max-width: 280px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: #5a9;
    box-shadow: 0 0 0 2px rgba(85, 170, 153, 0.15);
}

.field input#medical_code,
.field input#medical_institution_code {
    max-width: 180px;
}

.field input#bed_count {
    max-width: 120px;
}

.field input#bank_code,
.field input#branch_code {
    max-width: 160px;
}

/* 金融機関検索 */
.bank-search-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bank-search-row input[type="text"] {
    max-width: 240px;
}

/* チェックボックスラベル */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* 2カラムレイアウト */
.field-pair {
    display: flex;
    gap: 20px;
}

.field-pair .field {
    flex: 1;
}

@media (max-width: 600px) {
    .field-pair {
        flex-direction: column;
        gap: 0;
    }
}

.field input[type="file"] {
    padding: 8px;
    background-color: #fafafa;
    border: 1px solid #b5b8bc;
    border-radius: 2px;
    width: 100%;
}

.hint {
    margin: 6px 0 0;
    font-size: 13px;
    color: #666;
}

.attachment-notice {
    background-color: #fef9e7;
    border: 2px solid #e8a820;
    border-radius: 4px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.attachment-notice p {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #8a5d00;
    line-height: 1.7;
}

/* 郵便番号 + 住所検索 */
.postal-code-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.postal-code-row input {
    max-width: 160px;
}

/* ファイル添付済み */
.file-attached {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background-color: #eef1f5;
    border: 1px solid #bcc3cc;
    border-radius: 2px;
}

.file-attached .file-name {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.file-delete-label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #c0392b;
}

.file-delete-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
}

/* アクション */
.actions {
    margin-top: 28px;
    text-align: center;
}

.actions-row {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* メッセージ */
.msg {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 2px;
    font-size: 14px;
}

.msg ul {
    margin: 0;
    padding-left: 20px;
}

.msg-error {
    background-color: #fdf0f0;
    border: 1px solid #e8c4c4;
    color: #8b1a1a;
}

.msg-success {
    background-color: #eef5ee;
    border: 1px solid #b8d4c2;
    color: #2a6e3f;
}

.msg-warn {
    background-color: #fef9e7;
    border: 1px solid #e8d88c;
    color: #6b5900;
}

.msg-info {
    background-color: #eef1f5;
    border: 1px solid #bcc3cc;
    color: #333;
}

.msg-muted {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    color: #666;
    text-align: center;
    margin-top: 28px;
}

/* 確認画面 */
.confirm-block {
    margin-bottom: 28px;
    background-color: #f8f9fa;
    border: 1px solid #e0e3e6;
    border-radius: 2px;
    padding: 20px;
}

.confirm-heading {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 12px;
    padding: 8px 12px;
    background-color: #f0f1f3;
    color: #333;
    border-left: 3px solid #ec323d;
}

.data-grid {
    margin: 0;
    display: grid;
    grid-template-columns: 160px 1fr;
}

.data-grid dt {
    padding: 10px 12px;
    background-color: #eef0f2;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid #dde0e3;
}

.data-grid dd {
    padding: 10px 12px;
    margin: 0;
    background-color: #fff;
    border-bottom: 1px solid #dde0e3;
}

/* 完了画面 */
.complete-area {
    text-align: center;
    padding: 36px 20px;
}

.complete-check {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background-color: #ec323d;
    color: #fff;
    font-size: 36px;
    line-height: 72px;
    border-radius: 50%;
}

.complete-area h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 16px;
    color: #333;
}

.complete-text {
    margin-bottom: 28px;
    line-height: 1.9;
}

.notice {
    text-align: left;
    padding: 16px 20px;
    margin-bottom: 28px;
    background-color: #f8f9fa;
    border-radius: 2px;
    border-left: 3px solid #ec323d;
}

.notice h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 8px;
}

.notice ul {
    margin: 0;
    padding-left: 20px;
}

.notice li {
    margin-bottom: 4px;
}

/* 詳細画面 */
.detail-block {
    margin-bottom: 28px;
    background-color: #f8f9fa;
    border: 1px solid #e0e3e6;
    border-radius: 2px;
    padding: 20px;
}

.detail-heading {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 12px;
    padding: 8px 12px;
    background-color: #f0f1f3;
    color: #333;
    border-left: 3px solid #ec323d;
}

.file-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #c02933;
}



/* ログイン画面 */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f2f3f5;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 36px 28px;
    background-color: #fff;
    border: 1px solid #d5d8dc;
    border-radius: 2px;
}

.login-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    color: #ec323d;
}

.login-desc {
    margin: 8px 0 28px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* 戻るリンク */
.back-nav {
    margin-top: 28px;
    text-align: center;
}

/* フッター */
.site-footer {
    padding: 16px 24px;
    text-align: center;
    color: #666;
    font-size: 12px;
    background-color: #e8e9eb;
}

.site-footer p {
    margin: 0;
}

/* レスポンシブ */
@media (max-width: 600px) {
    .site-header {
        padding: 20px 16px;
    }

    .site-header h1 {
        font-size: 18px;
    }

    .main-content {
        padding: 24px 16px;
    }

    .fieldset {
        padding: 20px 16px;
    }

    .data-grid {
        grid-template-columns: 1fr;
    }

    .data-grid dt {
        border-bottom: none;
        padding-bottom: 4px;
    }

    .data-grid dd {
        padding-top: 4px;
    }

    .actions-row {
        flex-direction: column;
    }


    .header-user {
        flex-direction: column;
        gap: 8px;
    }
}
