/* ==========================================================
   モーダル共通（唯一）
========================================================== */

.fg-modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.fg-modal.open {
    display: flex;
}

.fg-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}

.fg-modal-content {
    position: relative;
    width: 360px;
    max-width: 92vw;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
}

.fg-modal-content form {
    flex: 1;
    overflow-y: auto;
}



/* ==========================================================
   ▼ 1) モーダル本体（白い箱）
   ========================================================== */

.fg-modal-content {
    position: relative;
    z-index: 2001;

    width: 520px;
    max-width: 92vw;
    max-height: calc(100vh - 40px);

    display: flex;
    flex-direction: column;

    background: #fff;
    border-radius: 14px;
    padding: 28px 32px 24px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    box-sizing: border-box;
}

/* フォーム部分だけスクロール */
.fg-modal-content form {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px; /* スクロールバー逃げ */
}


/* ==========================================================
   ▼ 2) タイトル
   ========================================================== */

.fg-modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 22px;
    text-align: center;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 12px;
}


/* ==========================================================
   ▼ 3) ラベル・入力欄（共通）
   ========================================================== */

.fg-modal-content label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #444;
    text-align: left;
}

.fg-modal-content input,
.fg-modal-content select,
.fg-modal-content textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.95rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fafafa;
    box-sizing: border-box;
}

.fg-modal-content input:focus,
.fg-modal-content select:focus,
.fg-modal-content textarea:focus {
    background: #fff;
    border-color: #4a90e2;
}

.fg-modal-content textarea {
    resize: vertical;
    min-height: 80px;
}


/* 読み取り専用 */
.fg-modal-content input[readonly],
.fg-modal-content textarea[readonly] {
    background: #f1f1f1;
    color: #666;
}


/* ==========================================================
   ▼ 4) ボタンエリア
   ========================================================== */

.fg-modal-buttons,
.fg-modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 26px;
}

/* 共通ボタン */
.fg-btn-save,
.fg-btn-copy,
.fg-btn-delete,
.fg-btn-cancel,
.fg-btn-primary {
    padding: 10px 22px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: 0.2s;
}

/* 色分け */
.fg-btn-save,
.fg-btn-primary {
    background: #3a7bd5;
    color: #fff;
}
.fg-btn-save:hover,
.fg-btn-primary:hover {
    background: #326fc1;
}

.fg-btn-copy {
    background: #555;
    color: #fff;
}
.fg-btn-copy:hover {
    background: #444;
}

.fg-btn-delete {
    background: #e65959;
    color: #fff;
}
.fg-btn-delete:hover {
    background: #d94c4c;
}

.fg-btn-cancel {
    background: #bbb;
    color: #fff;
}
.fg-btn-cancel:hover {
    background: #a5a5a5;
}


/* ==========================================================
   ▼ 5) 編集リンク（テーブル内）
   ========================================================== */

.fg-edit-link {
    color: #0078ff;
    cursor: pointer;
    text-decoration: underline;
}

.fg-edit-link:hover {
    opacity: 0.75;
}


/* ==========================================================
   ▼ 6) 管理者専用 非表示
   ========================================================== */

.fg-hide {
    display: none !important;
}


/* ==========================================================
   ▼ 7) 求人モーダル（jobModal）専用
   ・縦積み
   ・ラベル左揃え
   ========================================================== */

#jobModal .fg-modal-content {
    text-align: left;
}

#jobModal .fg-modal-row {
    width: 100%;
    margin-bottom: 16px;
}

#jobModal .fg-modal-row label {
    margin-bottom: 6px;
}

#jobModal .fg-modal-row input,
#jobModal .fg-modal-row select,
#jobModal .fg-modal-row textarea {
    width: 100%;
}
/* ==========================================================
   ▼ 管理者ログイン / ログアウト モーダル専用
   ========================================================== */

#loginModal .fg-modal-content,
#logoutModal .fg-modal-content {
    width: 360px;
    text-align: center;
}

/* ログイン入力欄 */
#loginModal .fg-input {
    width: 100%;
    padding: 10px 12px;
    margin: 16px 0;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
}

/* ボタン並び */
.fg-login-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

/* ログインボタン */
.fg-login-btn {
    padding: 8px 20px;
    font-size: 0.95rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: #3a7bd5;
    color: #fff;
}

.fg-login-btn:hover {
    background: #326fc1;
}

/* キャンセル */
.fg-login-btn-cancel {
    background: #bbb;
}

.fg-login-btn-cancel:hover {
    background: #a5a5a5;
}

/* 求人編集モーダルの操作ボタンを必ず表示 */
.fg-modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}
body.admin-mode .fg-modal-actions {
    display: flex !important;
}
.fg-btn-save,
.fg-btn-copy,
.fg-btn-delete,
.fg-btn-cancel {
    background: #e6e6e6;
    color: #333;
    border: 1px solid #ccc;
}

.fg-btn-save:hover,
.fg-btn-copy:hover,
.fg-btn-delete:hover,
.fg-btn-cancel:hover {
    background: #ddd;
}


.fg-modal-overlay {
    pointer-events: none !important;
}
