/* 共通スタイルシート - 産業保健フォーム */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'メイリオ', Meiryo, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #2c5aa0;
}

.header h1 {
    color: #2c5aa0;
    font-size: 24px;
    margin-bottom: 10px;
}

.header p {
    color: #666;
    font-size: 14px;
}

.section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fafafa;
}

.section.no-title {
    padding: 10px 20px;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #2c5aa0;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #2c5aa0;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    flex: 1;
    min-width: 300px;
}

.form-group label {
    font-weight: bold;
    min-width: 120px;
    margin-bottom: 5px;
    margin-right: 15px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    flex: 1;
    min-width: 200px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 5px rgba(44, 90, 160, 0.3);
}

.inline-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.inline-group .form-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 労働者数・人数入力の単位表示 */
.employee-count {
    display: flex;
    align-items: center;
    gap: 5px;
}

.employee-count span {
    font-weight: normal;
    color: #666;
}

/* 日付入力フィールドのスタイル */
input[type="date"],
input[type="month"] {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
    max-width: 200px;
    background-color: white;
}

input[type="date"]:focus,
input[type="month"]:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 5px rgba(44, 90, 160, 0.3);
}

/* 数値入力フィールド（従業員数など）のスタイル */
input[type="number"] {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    width: 100px;
    text-align: center;
}

input[type="number"]:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 5px rgba(44, 90, 160, 0.3);
}

/* 人数入力専用のスタイル */
.employee-count input[type="number"],
.participant-count input[type="number"],
input[name*="人数"],
input[name*="従業員数"],
input[name*="参加予定人数"],
input[name="employee_count"] {
    width: 85px;
    min-width: 85px;
    text-align: center;
}

/* 郵便番号入力フィールド */
input.postal-code,
input[name="postal_code"],
input[id="postal_code"] {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    text-align: center;
}

.postal-code-group {
    flex: none !important;
    min-width: auto !important;
}

/* メルマガオプションのスタイル */
.newsletter-option {
    flex-direction: column !important;
    align-items: flex-start !important;
    width: 100% !important;
}

.newsletter-option .checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.newsletter-option .checkbox-item input[type="checkbox"] {
    margin: 0;
}

.newsletter-note {
    font-size: 12px;
    color: #666;
    margin-left: 20px;
    line-height: 1.4;
}

/* 訪問希望日のスタイル */
.visit-date-group {
    flex-direction: column !important;
    align-items: flex-start !important;
    width: 100% !important;
    margin-bottom: 20px;
}

.visit-date-inputs {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.visit-date-inputs input[type="date"] {
    min-width: 150px;
}

.visit-date-inputs select {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.visit-date-inputs input[type="text"] {
    width: 150px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/* 詳細入力エリアのスタイル */
.detail-input-area {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-input-area label {
    font-size: 14px;
    font-weight: normal;
    margin-right: 0;
}

.detail-input-area textarea {
    width: 100%;
    min-height: 60px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

/* その他オプションのスタイル */
.other-option {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.other-detail-input {
    margin-left: 20px;
}

.other-detail-input textarea {
    width: 100%;
    max-width: 400px;
    min-height: 50px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

/* ご要望・ご質問セクションのスタイル */
.request-section {
    display: flex;
    flex-direction: column !important;
    gap: 8px;
}

.request-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.request-section textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

/* 労働者数グループのスタイル（健康相談用） */
.employee-count-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 8px;
}

.employee-count-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.count-label {
    font-size: 14px;
    color: #333;
    min-width: 50px;
}

.count-unit {
    font-size: 14px;
    color: #666;
}

.employee-count-item input.employee-count {
    width: 85px;
    min-width: 85px;
    text-align: center;
}

/* 健康診断・ストレスチェック用スタイル */
.checkup-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.checkup-option {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
}

.month-input {
    width: 40px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    margin: 0 2px;
}

.checkup-option span {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
}

.checkup-option label {
    margin-right: 8px;
    white-space: nowrap;
}

/* チェックボックス・ラジオボタングリッドのスタイル */
.checkbox-group,
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

/* デフォルトは簡単なスタイル */
.checkbox-item,
.radio-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.checkbox-item input[type="checkbox"],
.checkbox-item input[type="radio"],
.radio-item input[type="checkbox"],
.radio-item input[type="radio"] {
    margin: 0;
    margin-top: 2px;
    flex-shrink: 0;
}

.checkbox-item label,
.radio-item label {
    line-height: 1.4;
    cursor: pointer;
    min-width: auto;
    margin-bottom: 0;
    font-weight: normal;
    font-size: 14px;
    color: #333;
}

/* 両立支援フォーム用の複雑なチェックボックス項目 */
.checkbox-group.complex,
.radio-group.complex {
    gap: 20px;
}

.checkbox-group.complex .checkbox-item,
.radio-group.complex .radio-item {
    display: block;
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #fff;
}

.checkbox-group.complex .checkbox-item > input[type="checkbox"]:first-child,
.checkbox-group.complex .checkbox-item > input[type="radio"]:first-child,
.radio-group.complex .radio-item > input[type="checkbox"]:first-child,
.radio-group.complex .radio-item > input[type="radio"]:first-child {
    margin: 0 8px 0 0;
    vertical-align: baseline;
    margin-top: 2px;
}

.checkbox-group.complex .checkbox-item > label:nth-child(2),
.radio-group.complex .radio-item > label:nth-child(2) {
    font-weight: bold;
    font-size: 16px;
    color: #2c5aa0;
    cursor: pointer;
    display: inline;
    margin-bottom: 10px;
}

/* サブチェックボックスのスタイル */
.checkbox-subitems {
    margin: 10px 0 10px 30px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-subitems div {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.checkbox-subitems input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.checkbox-subitems input[type="text"] {
    margin-left: 10px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    max-width: 250px;
}

/* メインのチェックボックス項目内の説明文 */
.checkbox-item > div {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* 旧スタイルとの互換性 */
.form-row {
    display: flex;
    margin-bottom: 15px;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.form-row.column {
    flex-direction: column;
    align-items: flex-start;
}

.form-label {
    font-weight: bold;
    min-width: 120px;
    margin-right: 15px;
    margin-bottom: 5px;
}

.form-input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    flex: 1;
    min-width: 200px;
}

.form-input:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 5px rgba(44, 90, 160, 0.3);
}

.form-input.small {
    width: 80px;
    min-width: 80px;
}

.form-input.medium {
    width: 200px;
    min-width: 200px;
}

/* 日付入力の詳細スタイル */
.date-inputs {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 16px;
}

.date-inputs input[type="number"] {
    width: 60px;
    padding: 8px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 16px;
    box-sizing: border-box;
}

/* 必須マーク */
.required {
    color: #e74c3c;
    margin-left: 3px;
}

/* 相談内容テーブル（健康相談フォーム用） */
.consultation-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.consultation-table td {
    padding: 12px;
    border: 1px solid #ddd;
    vertical-align: middle;
}

.consultation-item {
    width: 65%;
    font-weight: bold;
    background-color: #f8f9fa;
}

.consultation-input {
    width: 35%;
    text-align: left;
}

.consultation-input input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    width: 80px;
    text-align: center;
}

.consultation-input input:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 5px rgba(44, 90, 160, 0.3);
}

.consultation-input label {
    margin-left: 8px;
    font-weight: bold;
}

/* 支援コンテンツセクション（メンタルヘルス用） */
.support-content-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.support-item {
    margin-bottom: 15px;
    padding: 15px;
    background-color: white;
    border-radius: 4px;
    border-left: 4px solid #2c5aa0;
}

.support-item h4 {
    margin-bottom: 10px;
    color: #2c5aa0;
}

.participant-count {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

/* 送信ボタン */
.submit-section {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #ddd;
}

.submit-btn {
    background: #2c5aa0;
    color: white;
    padding: 12px 40px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: #1e3f73;
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ローディング・結果表示 */
.loading {
    display: none;
    margin-left: 10px;
    color: #666;
}

.result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    display: none;
}

.result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* メッセージボックス */
.success-message,
.error-message {
    display: none;
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.error-message-box {
    display: none;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
}

/* 注意書き */
.note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.notice ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.notice li {
    margin-bottom: 5px;
    line-height: 1.4;
}

.note-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.info-box {
    background-color: #e8f4f8;
    border: 1px solid #b8d4da;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
}

/* フッター情報 */
.footer-info {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 5px;
    font-size: 12px;
    color: #555;
    text-align: center;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        margin: 0;
        padding: 15px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .form-group,
    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-group label,
    .form-label {
        min-width: auto;
        margin-bottom: 8px;
        margin-right: 0;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea,
    .form-input {
        min-width: auto;
        width: 100%;
    }
    
    .inline-group {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    .checkbox-group,
    .radio-group {
        grid-template-columns: 1fr;
    }
    
    input[type="date"],
    input[type="month"] {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
    
    input[type="number"] {
        width: 100%;
        max-width: 120px;
    }
    
    .employee-count input[type="number"],
    .participant-count input[type="number"] {
        width: 80px;
        min-width: 80px;
    }
    
    .consultation-table {
        font-size: 12px;
    }
    
    .consultation-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .section {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .section-title {
        font-size: 16px;
    }
}