/* フォーム用共通CSS */
/* ファイル: /B-management/CONFIG/css/form.css */

/* リセットCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基本スタイル */
body {
    font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", "Yu Gothic Medium", "游ゴシック Medium", "Yu Gothic", "游ゴシック", "Noto Sans CJK JP", "Takao Gothic", "IPAexGothic", "IPAPGothic", "VL PGothic", "Noto Sans CJK JP", "MS PGothic", "MS UI Gothic", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    font-size: 14px;
}

/* コンテナ */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}


.guest-form-container {
    width: 100%;
}

.guest-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.guest-form-title {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

.guest-form-subtitle {
    font-size: 18px;
    color: #666;
}

/* フォーム本体 */
.guest-form-main {
    width: 100%;
}

/* セクション区切り */
.guest-section-divider {
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 15px;
    padding-bottom: 8px;
}

/* 横並びレイアウト */
.guest-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.guest-form-col {
    flex: 1;
}

/* ラベル */
.guest-form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}

.guest-form-label-small {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 14px;
}

.guest-required {
    color: #e74c3c;
}

/* 入力フィールド */
input:not([type="image" i], [type="range" i], [type="checkbox" i], [type="radio" i]) {
    width: 100%;
    padding:  12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
    background-color: white;
    font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", "Yu Gothic Medium", "游ゴシック Medium", "Yu Gothic", "游ゴシック", "Noto Sans CJK JP", "Takao Gothic", "IPAexGothic", "IPAPGothic", "VL PGothic", "Noto Sans CJK JP", "MS PGothic", "MS UI Gothic", sans-serif;
}

input:not([type="image" i], [type="range" i], [type="checkbox" i], [type="radio" i]):focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
    background-color: white;
}

/* Safari対応: 日付と時間入力の背景色を強制的に白に */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    background-color: white !important;
    padding: 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    background-color: transparent;
}


/* select要素のスタイル */
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    background-color: white;
    transition: border-color 0.3s;
    box-sizing: border-box;
    font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", "Yu Gothic Medium", "游ゴシック Medium", "Yu Gothic", "游ゴシック", "Noto Sans CJK JP", "Takao Gothic", "IPAexGothic", "IPAPGothic", "VL PGothic", "Noto Sans CJK JP", "MS PGothic", "MS UI Gothic", sans-serif;
}

select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* textarea要素のスタイル */
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
    font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", "Yu Gothic Medium", "游ゴシック Medium", "Yu Gothic", "游ゴシック", "Noto Sans CJK JP", "Takao Gothic", "IPAexGothic", "IPAPGothic", "VL PGothic", "Noto Sans CJK JP", "MS PGothic", "MS UI Gothic", sans-serif;
    resize: vertical;
    min-height: 100px;
}

textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.guest-form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.guest-form-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.guest-form-input-small {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.guest-form-input-small:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.guest-form-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    background-color: white;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.guest-form-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* 住所セクション */
.guest-address-section {
    margin-bottom: 20px;
}

.guest-address-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

/* ボタンスタイルは下部で定義 */

/* 送信ボタン */
button[type="submit"] {
    background-color:var(--unit-color);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s;
}

button[type="submit"]:hover {
    background-color: #218838;
}

.guest-btn {
    display: inline-block;
    background-color: #f8f9fa;
    color: #333;
    padding: 8px 16px;
    border: 1px solid #ddd;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.guest-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

/* ログイン状態表示 */
.guest-login-status {
    margin-top: 15px;
    padding: 10px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
}

.guest-login-status-text {
    margin: 0;
    color: #155724;
    font-weight: bold;
}

.guest-login-status-subtext {
    margin: 5px 0 0 0;
    font-size: 14px;
    color: #155724;
}

/* デバッグ情報 */
.guest-debug-info {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    font-size: 12px;
}

/* メッセージ表示 */
.message-success {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-warning {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* 申し込み情報セクション - 最高優先度で適用 */
body .unit_main .guest-form-container .info-section {
    background-color: #e8f4fd !important;
    border: 1px solid #bee5eb !important;
    border-radius: 5px !important;
    padding: 15px !important;
    margin-bottom: 20px !important;
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    position: relative !important;
}

body .unit_main .guest-form-container .info-section h3 {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    color: #2c3e50 !important;
    line-height: 1.4 !important;
}

body .unit_main .guest-form-container .info-section p {
    margin: 0 0 10px 0 !important;
    font-size: 14px !important;
    color: #333 !important;
    line-height: 1.5 !important;
}

body .unit_main .guest-form-container .info-section p:last-child {
    margin-bottom: 0 !important;
}

.required-asterisk {
    color: #e74c3c;
}

/* ログイン状態表示 */
.login-status {
    margin-top: 15px;
    padding: 10px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
}

.login-status-text {
    margin: 0;
    color: #155724;
    font-weight: bold;
}

.login-status-subtext {
    margin: 5px 0 0 0;
    font-size: 14px;
    color: #155724;
}

.login-info {
    margin-top: 15px;
    text-align: center;
}

.login-info p {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
}

.user-id-info {
    font-size: 12px;
    color: #666;
    font-weight: normal;
}

/* フォームセクション */
.form-section {
    margin-bottom: 20px;
}

.form-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}

.form-section input[type="text"],
.form-section input[type="email"],
.form-section input[type="tel"],
.form-section input[type="url"],
.form-section input[type="file"],
.form-section textarea,
.form-section select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.form-section textarea {
    font-family: inherit;
    resize: vertical;
}

.form-section small {
    color: #666;
    font-size: 14px;
}

/* 警告メッセージ */
.warning-message {
    margin: 6px 0 10px;
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 13px;
}

/* 検索機能 */
.search-container {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 5px;
}

.search-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.search-button {
    padding: 12px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.search-results {
    display: none;
    border: 2px solid #ddd;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    position: relative;
    z-index: 1001;
}

.search-result-item {
    padding: 12px;
    border-bottom: 1px solid #f1f1f1;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item.search-result-selected {
    background-color: #e3f2fd;
    border-left: 3px solid #2196F3;
}

.search-result-name {
    font-weight: bold;
}

.search-result-info {
    color: #666;
    font-size: 12px;
}

.search-no-results {
    padding: 12px;
    color: #666;
    text-align: center;
}

.search-error {
    padding: 12px;
    color: #e74c3c;
    text-align: center;
}

/* フッター */
.form-footer {
    margin-top: 30px;
    text-align: center;
    color: #666;
    font-size: 14px;
    padding: 20px;
    border-top: 1px solid #e9ecef;
}

.form-footer a {
    color: #007bff;
    text-decoration: none;
}

.form-footer a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* その他の要素 */
textarea {
    font-family: inherit;
    resize: vertical;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .guest-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .guest-address-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    

    .container {
        padding: 10px;
    }
    
    .guest-form-container {
        padding: 10px;
    }
    
    .guest-form-main {
        padding: 20px;
    }

    input:not([type="image" i], [type="range" i], [type="checkbox" i], [type="radio" i]) {
        width: 100%;
        padding-bottom: 12px;
        border: 2px solid #ddd;
        border-radius: 5px;
        font-size: 16px;
        transition: border-color 0.3s;
        box-sizing: border-box;
        font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", "Yu Gothic Medium", "游ゴシック Medium", "Yu Gothic", "游ゴシック", "Noto Sans CJK JP", "Takao Gothic", "IPAexGothic", "IPAPGothic", "VL PGothic", "Noto Sans CJK JP", "MS PGothic", "MS UI Gothic", sans-serif;
        padding-top: 12px;
    }
    
}

/* ログインボタンのスタイル */
.login-info {
    text-align: center;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    margin: 15px 0;
}

/* ログインボタンのスタイルは下部で定義 */

.login-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}


/* ユーザー名不一致の警告スタイル */
.user-mismatch-warning {
    margin: 8px 0 0 0;
    padding: 12px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
    line-height: 1.4;
}

.user-mismatch-warning p {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #856404;
}

.logout-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.logout-button:hover {
    background-color: #c82333;
    color: white;
    text-decoration: none;
}

/* ボタン基本スタイル */
.btn {
    display: inline-block;
    padding: 7px 10px;
    background-color: var(--unit-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn:hover {
    background-color: #2980b9;
    color: white;
    text-decoration: none;
}

/* ログインボタン専用スタイル */
.login-info .btn {
    background-color: #3498db;
    padding: 12px 24px;
    border-radius: 5px;
    box-shadow: none;
    position: static;
    overflow: visible;
}

.login-info .btn:before {
    display: none;
}

.login-info .btn:hover {
    background-color: #2980b9;
    transform: none;
    box-shadow: none;
}

.login-info .btn:active {
    transform: none;
}

/* ボタンレイアウト用 */
.btn_center {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.btn_left {
    display: block;
    margin: 0;
    margin-top: 1rem;
}

.btn_short {
    display: inline-block;
}

/* イベントフォーム用スタイル */
.form-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.form-container-middle {
    max-width: 800px;
}
.form-container-small {
    max-width: 600px;
}

/* OCRセクション */
.ocr-section {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.loading {
    display: none;
    text-align: center;
    padding: 1.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-top: 1rem;
}

.spinner {
    width: 20px;
    height: 20px;
    margin: 0 auto;
    position: relative;
}

.spinner::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    border: 2px solid #e3e3e3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.result {
    display: none;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.error {
    display: none;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    color: #721c24;
}

/* マークリスト */
.marks-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.mark-item {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
}

.mark-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.guest-limit-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-top: 20px;
}

.current-image {
    text-align: center;
    margin-bottom: 10px;
}

.current-image img {
    display: block;
    margin: 0 auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* イベントフォームアクションボタン - form.css オリジナル */
.form-container .edit-form-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 15px !important;
    margin-top: 30px !important;
    padding-top: 20px !important;
    border-top: 1px solid #e9ecef !important;
}

.form-container .edit-form-actions .button-row {
    display: flex !important;
    gap: 15px !important;
    justify-content: center !important;
}

.form-container .edit-form-actions .button-row .btn.btn-cancel,
.form-container .edit-form-actions .button-row .btn.btn-save {
    flex: 1 1 0 !important;
    min-width: 300px !important;
}

.form-container .edit-form-actions .button-row .btn.btn-delete {
    max-width: 300px !important;
}

/* ボタン共通スタイル */
.form-container .edit-form-actions .btn {
    padding: 12px 24px !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: bold !important;
    text-decoration: none !important;
    display: inline-block !important;
    box-sizing: border-box !important;
    line-height: 1.5 !important;
    transition: background-color 0.2s !important;
}


.form-container .edit-form-actions .btn.btn-save {
    background-color: var(--unit-color) !important;
    color: white !important;
}

.form-container .edit-form-actions .btn.btn-save:hover {
    background-color: rgb(81, 123, 169) !important;
}

.form-container .edit-form-actions .btn.btn-cancel {
    background-color: #6c757d !important;
    color: white !important;
}

.form-container .edit-form-actions .btn.btn-cancel:hover {
    background-color: #545b62 !important;
}

.form-container .edit-form-actions .btn.btn-delete {
    background-color: #dc3545 !important;
    color: white !important;
}

.form-container .edit-form-actions .btn.btn-delete:hover {
    background-color: #c82333 !important;
}

@media screen and (max-width: 768px) {
    .form-container .form-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .form-container,
    .form-container-middle {
        padding: 20px !important;
    }
    
    .form-container .edit-form-actions {
        gap: 10px !important;
    }
    
    .form-container .edit-form-actions .button-row {
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* モバイル版: キャンセル｜保存を均等に */
    .form-container .edit-form-actions .button-row .btn.btn-cancel,
    .form-container .edit-form-actions .button-row .btn.btn-save {
        flex: 1 1 0 !important;
        min-width: 120px !important;
    }
    
    .form-container .edit-form-actions .button-row .btn.btn-delete {
        width: auto !important;
        max-width: 300px !important;
        min-width: 200px !important;
    }
}