/* PHPログインページ用スタイルシート */

body {
    font-family: Arial, sans-serif;
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
    background-color: #9ACD32; /* 黄緑色の背景 */
}

.container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h2 {
    text-align: center;
    color: #006400; /* 濃い緑色 */
    margin-bottom: 30px;
    font-size: 40px;
}

/* メッセージ表示エリア */
.message {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}

.message.default {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.message.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.message.success {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

/* フォームスタイル */
form {
    margin-top: 20px;
}

ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

li {
    margin-bottom: 15px;
}

/* 入力フィールド */
input[type="text"], 
input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 3px solid #9ACD32; /* 黄緑色の枠線 */
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    background-color: white; /* 白い背景 */
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus, 
input[type="password"]:focus {
    outline: none;
    border-color: #9ACD32;
    box-shadow: 0 0 5px rgba(154, 205, 50, 0.8);
}

/* プレースホルダーのスタイル */
input[type="text"]::placeholder,
input[type="password"]::placeholder {
    color: #888;
    font-style: italic;
}

/* ログインボタン */
input[type="submit"] {
    width: 100%;
    padding: 12px;
    background-color: #0000FF; /* 青色 */
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

input[type="submit"]:hover {
    background-color: #0000CC; /* ホバー時は少し暗い青色 */
    transform: translateY(-1px);
}

input[type="submit"]:active {
    transform: translateY(0px);
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
    body {
        margin: 20px auto;
        padding: 15px;
    }
    
    .container {
        padding: 20px;
    }
    
    input[type="text"], 
    input[type="password"],
    input[type="submit"] {
        padding: 10px;
        font-size: 14px;
    }
}

/* アクセシビリティ対応 */
input:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* エラー状態の入力フィールド */
input.error {
    border-color: #c62828;
    background-color: #ffebee;
}

input.error:focus {
    border-color: #c62828;
    box-shadow: 0 0 5px rgba(198, 40, 40, 0.5);
}
/* ボタン風リンク＆ボタン用の共通クラス */
.btn {
    display: inline-block;
    padding: 12px 20px;
    background-color: #006400; /* 濃い緑色 */
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s, transform 0.1s;
    border: none;
    cursor: pointer;
    min-width: 200px;
}

.btn:hover {
    background-color: #004d00;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0px);
}
/* ボタンを中央寄せにするためのラッパー */
.button-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}
/* テーブル中央寄せ */
.table-container {
    display: flex;
    max-height: 300px;     /* ← 好きな高さに変更OK */
    overflow-y: auto;
    justify-content: center;
    margin-top: 20px;
    width: 100%;
    table-layout: fixed;
    justify-content: flex-start;
}
table {
  width: 100%; /* 親コンテナいっぱいに広げる */
  table-layout: fixed; /* 固定レイアウトで列幅を均等または指定通りにする */
}

/* 各列の幅を指定 */
table th:nth-child(1), /* 食材名 */
table td:nth-child(1) {
  width: 30%;  /* 食材名は幅広めに */
  word-wrap: break-word; /* 長いテキストを折り返す */
}

table th:nth-child(2), /* g/個 */
table td:nth-child(2) {
  width: 30%;
}

table th:nth-child(3), /* 賞味期限 */
table td:nth-child(3) {
  width: 30%;
}

table th:nth-child(4), /* 選択 */
table td:nth-child(4) {
  width: 10%;
  text-align: center;
}
