/* フォーム全体のスタイル */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
}

h1 {
    text-align: center;
    color: #333;
    font-size: 2em;
    margin-top: 20px;
}

form {
    background-color: #fff;
    padding: 20px;
    margin: 30px auto;
    border-radius: 8px;
    max-width: 600px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

label {
    display: block;
    font-weight: bold;
    margin-top: 10px;
    color: #333;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"] {
    width: calc(100% - 20px);
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
}

input[type="radio"],
input[type="checkbox"] {
    margin-right: 10px;
}

button[type="submit"] {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
    display: block;
    width: 100%;
    font-size: 1.1em;
}

button[type="submit"]:hover {
    background-color: #45a049;
}

/* ラジオボタンのグループ */
.radio-group {
    margin-top: 10px;
}

.radio-group label {
    font-weight: normal;
    margin-right: 15px;
}

/* メディアクエリ：モバイル端末向けのレイアウト */
@media (max-width: 600px) {
    form {
        padding: 15px;
    }

    h1 {
        font-size: 1.5em;
    }
}

/* タイトル部分を固定 */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #4A90E2;
    color: white;
    text-align: center;
    padding: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    font-size: 24px;
    font-weight: bold;
}

/* 本人情報の入力を固定 */
.fixed-section {
    position: fixed;
    top: 70px; /* ヘッダーの下に配置 */
    left: 0;
    width: 100%;
    background-color: #f1f1f1; /* 背景色を淡いグレーに */
    color: #333;
    text-align: center;
    padding: 10px 0; /* 高さを低くするためにパディングを減らす */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 999;
    font-size: 16px; /* フォントサイズを少し小さくする */
    font-weight: bold;
}

/* フォーム部分に余白を追加（固定した要素の分だけ上部に余白を追加） */
body {
    margin-top: 160px; /* 固定された要素の高さ分を余白として確保 */
}

/* ボタンのスタイル */
button[type="submit"] {
    background-color: #4A90E2;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
    display: block;
    width: 100%;
    font-size: 1.1em;
}

/* ボタンのスタイル */
button[type="button"] {
    background-color: #4A90E2;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
    display: block;
    width: 100%;
    font-size: 1.1em;
}

button[type="submit"]:hover {
    background-color: #2a517e;
}

/* ラジオボタンの選択肢を左右に並べる */
.radio-group {
    display: inline-flex;
    gap: 10px; /* ラジオボタン間のスペースを調整 */
    align-items: center;
}

/* ラベルのスタイルを一貫させる */
label {
    display: inline-block;
    margin-bottom: 10px;
    font-weight: bold;
}

#main_company_section {
    transition: all 0.3s ease;
}

/* スタイリッシュなセレクトボックス */
select {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #f8f8f8;
    font-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 12px;
}

/* セレクトボックスのホバー効果 */
select:hover {
    border-color: #888;
}

/* セレクトボックスのフォーカス効果 */
select:focus {
    border-color: #4A90E2;
    outline: none;
}

/* シンプルでスタイリッシュな区切り線 */
hr.stylish-hr {
    border: none;
    height: 2px;
    background-color: #4A90E2; /* シンプルな青色の線 */
    margin: 20px 0;
}

/* 既存のスタイルに追加 */
.required::after {
    content: "※";
    color: red;
    margin-left: 5px;
}

.info-text {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}


/* サムネイル画像のスタイル */
.thumbnail-img {
    max-width: 150px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 10px;
}

/* スマートフォン向けのスタイル */
@media (max-width: 600px) {
    .item {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 10px;
    }

    .thumbnail-img {
        max-width: 100px;
        max-height: 100px;
    }

    .confirmation-container {
        padding: 10px;
    }

    .section-title {
        font-size: 16px;
        margin-top: 20px;
        text-align: left;
    }

    h1 {
        font-size: 1.8em;
        margin-top: 10px;
    }

    button[type="submit"] {
        font-size: 1em;
        padding: 8px 16px;
    }
}

/* 質問と回答のデザイン調整 */
.question {
    font-weight: bold;
    display: inline-block;
    width: 150px; /* 質問の幅を固定して見やすく */
    text-align: left;
    padding-right: 10px;
}

.answer {
    display: inline-block;
    padding-left: 20px;
    max-width: 70%;
}

/* item クラスの調整 */
.item {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin: 10px 0;
}

/* 全体の中央寄せ */
.confirmation-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

/* ボタンを中央に配置する */
.button-group {
    display: flex;
    justify-content: center; /* 横方向に中央揃え */
    align-items: center;     /* 縦方向に中央揃え */
    gap: 20px;               /* ボタン間のスペース */
    width: 100%;             /* 親要素の幅を100%に設定 */
    margin: 0 auto;          /* 画面の中央に配置 */
}

/* ボタンの基本スタイル */
.custom-button {
    width: 150px;
    height: 50px;
    padding: 0;
    font-size: 1em;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

/* 保存ボタンのスタイル */
.custom-button.save {
    background-color: #4A90E2;
    color: #fff;
    width: 150px;
}

/* 戻るボタンのスタイル */
.custom-button.back {
    background-color: #999;
    color: #fff;
    width: 150px;
}

/* ボタンのホバー効果 */
.custom-button.save:hover {
    background-color: #2a517e;
}

.custom-button.back:hover {
    background-color: #666;
}

/* ボタンフォームのリセット */
.button-form {
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
    border: none;
    display: inline-flex;
    align-items: center;
}

/* 設問行：左=設問、右=選択肢 */
.qrow {
  display: grid;
  grid-template-columns: 280px 1fr; /* 左カラム幅はお好みで */
  gap: 12px 20px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e6e6e6; /* 画像の青線代わりならここを調整 */
}

/* 設問テキスト（左） */
.qrow .q-label {
  font-weight: 600;
  line-height: 1.6;
}

/* 選択肢（右） */
.qrow .q-controls {
  display: flex;
  gap: 18px;
  flex-wrap: wrap; /* はみ出す場合は折り返し */
}

/* ラジオの見た目と余白微調整 */
.q-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.6;
}

/* スマホで縦積み */
@media (max-width: 640px) {
  .qrow {
    grid-template-columns: 1fr;
  }
  .qrow .q-label {
    padding-bottom: 4px;
  }
}

/* ラベル文字は黒に統一（過去の .required を打ち消す） */
label, .form-label { color: #000 !important; }

/* ※ だけ赤に */
.required-mark { color:#e60000; font-weight:700; margin-left:.25em; }


/* ===== 確認画面の上書き（末尾に追加） ===== */
.confirmation-container .item{
  display: grid;                 /* flexを上書き */
  grid-template-columns: 26rem 1fr;  /* 左26remに拡張。お好みで調整 */
  align-items: start;
}

.confirmation-container .item .question{
  width: auto;                   /* 150px固定を解除 */
  white-space: normal;           /* 折り返し可 */
  overflow: visible;
  text-overflow: clip;           /* 省略記号をやめる */
}

.confirmation-container .item .answer{
  max-width: none;               /* 70%制限を解除 */
  padding-left: 0;
}



/* ログインエリアの横並びレイアウト */
.login-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
}

.login-field {
    display: flex;
    flex-direction: column;
}

.login-field label {
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.login-field input {
    width: 150px;          /* ★ 横幅を細めに */
    padding: 4px 6px;
    box-sizing: border-box;
}

.login-actions button {
    white-space: nowrap;   /* ボタンの文字を折り返さない */
    margin-top: 18px;      /* ラベル＋入力と下端を揃えるための調整 */
}

/* 画面がかなり狭いときは縦並びに戻す */
@media (max-width: 600px) {
    .login-inline {
        flex-direction: column;
        align-items: flex-start;
    }
    .login-actions button {
        margin-top: 0;
    }
}


/* 例：styles.css に追加 */
.error-message {
    max-width: 600px;
    margin: 8px auto;
    padding: 8px 12px;
    color: #b71c1c;
    background-color: #ffebee;
    border-radius: 4px;
    font-size: 0.9rem;
}


/* 管理ヘッダー */
.admin-header {
    max-width: 900px;
    margin: 0 auto 8px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.logout-link {
    font-size: 0.9rem;
    text-decoration: none;
}

.logout-link:hover {
    text-decoration: underline;
}

/* 一覧テーブル */
.admin-table-section {
    max-width: 900px;
    margin: 0 auto 24px auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.admin-table thead {
    background-color: #f5f5f5;
}

.admin-table th,
.admin-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9rem;
}

.admin-table th {
    text-align: left;
    white-space: nowrap;
}

.admin-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.admin-table tbody tr:hover {
    background-color: #eef3ff;
}

.cell-center {
    text-align: center;
}

.cell-mono {
    font-family: Consolas, Menlo, monospace;
}

.cell-datetime {
    font-size: 0.85rem;
    color: #555;
    white-space: nowrap;
}

.admin-table a {
    color: #3f51b5;
    text-decoration: none;
}

.admin-table a:hover {
    text-decoration: underline;
}


.logout-bar {
    max-width: 900px;
    margin: 8px auto 0 auto;
    text-align: right;
}

.logout-link {
    font-size: 0.9rem;
    text-decoration: none;
    color: #3f51b5;
}

.logout-link:hover {
    text-decoration: underline;
}



.logout-bar {
    max-width: 900px;
    margin: 8px auto 0 auto;
    text-align: right;
}

.logout-link {
    font-size: 0.9rem;
    text-decoration: none;
    color: #3f51b5;
}

.logout-link:hover {
    text-decoration: underline;
}

/* 一覧テーブル用（まだなら） */
.admin-table-section {
    max-width: 900px;
    margin: 16px auto 24px auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.admin-table thead {
    background-color: #f5f5f5;
}

.admin-table th,
.admin-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9rem;
}

.admin-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.admin-table tbody tr:hover {
    background-color: #eef3ff;
}

.cell-center { text-align: center; }
.cell-mono   { font-family: Consolas, Menlo, monospace; }
.cell-datetime {
    font-size: 0.85rem;
    color: #555;
    white-space: nowrap;
}
