/* 空き家管理システム 共通スタイル（外回り index.html / 管理 admin.html）
   UI設計ルール: 文字サイズは rem、ボタンは min-height 2.75rem(44px) + padding、横並びは flex-wrap、overflow-wrap 標準適用
   制作・運営: 旗二でじたる */
* { box-sizing: border-box; margin: 0; padding: 0; overflow-wrap: break-word; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'Segoe UI', 'Hiragino Sans', 'Meiryo', sans-serif; background: #eef1f5; color: #333; line-height: 1.5; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }
a { color: #1a5c9a; }

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .3em; min-height: 2.75rem; padding: .5rem 1rem; border: none; border-radius: .5rem; cursor: pointer; font-size: 1rem; font-weight: 600; background: #e8f0fe; color: #1a3a5c; text-decoration: none; }
.btn:hover { filter: brightness(.95); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: #1a3a5c; color: #fff; }
.btn-green { background: #2a7a3c; color: #fff; }
.btn-gray { background: #e9ecef; color: #555; }
.btn-danger { background: #ffeaea; color: #c0392b; }
.btn-back { background: transparent; color: #1a3a5c; padding-left: .5rem; padding-right: .75rem; }
.btn-sm { min-height: 2.75rem; padding: .4rem .7rem; font-size: .9rem; }

/* フォーム */
.fg { margin-bottom: .9rem; }
.fg > label { display: block; font-size: .9rem; font-weight: 600; color: #555; margin-bottom: .3rem; }
.fg input[type=text], .fg input[type=date], .fg input[type=tel], .fg input[type=password], .fg select, .fg textarea {
  width: 100%; min-height: 2.75rem; padding: .55rem .7rem; border: 1.5px solid #ccd; border-radius: .5rem; background: #fafafa; color: #333;
}
.fg input:focus, .fg select:focus, .fg textarea:focus { border-color: #4a90d9; background: #fff; outline: none; }
.fg textarea { min-height: 5rem; resize: vertical; }
.req { color: #e44; margin-left: .3em; font-size: .85em; }
.hint { font-size: .85rem; color: #888; margin-top: .25rem; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row > .grow { flex: 1 1 10rem; min-width: 0; }

/* トースト */
#toast { position: fixed; bottom: 5rem; left: 50%; transform: translateX(-50%) translateY(4rem); max-width: 90vw; background: rgba(0,0,0,.85); color: #fff; padding: .75rem 1.25rem; border-radius: 1.5rem; font-size: 1rem; z-index: 9000; transition: transform .25s; pointer-events: none; text-align: center; }
#toast.show { transform: translateX(-50%) translateY(0); }

/* ログインの門（暗証番号 / メンバー外） */
#gate { display: none; position: fixed; inset: 0; background: #1a3a5c; z-index: 8000; align-items: center; justify-content: center; padding: 1rem; }
#gate.open { display: flex; }
#gate .box { background: #fff; border-radius: .75rem; padding: 1.5rem; width: 100%; max-width: 24rem; }
#gate h2 { font-size: 1.15rem; color: #1a3a5c; margin-bottom: .75rem; }
#gate p { font-size: .95rem; color: #555; margin-bottom: .75rem; }
#gate input { width: 100%; min-height: 3rem; font-size: 1.5rem; letter-spacing: .3em; text-align: center; border: 1.5px solid #ccd; border-radius: .5rem; padding: .5rem; margin-bottom: .75rem; }
#gate .err { color: #c0392b; font-size: .9rem; min-height: 1.3rem; margin-bottom: .5rem; }

/* 確認用（?mock=1）のメンバー切り替えバー */
#devbar { background: #fff3cd; color: #856404; font-size: .85rem; padding: .4rem .75rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
#devbar select { min-height: 2.25rem; }

/* バッジ */
.badge { display: inline-block; padding: .15em .6em; border-radius: 1em; font-size: .8rem; font-weight: 600; }
.b-red { background: #ffeaea; color: #c0392b; }
.b-yellow { background: #fff3cd; color: #856404; }
.b-green { background: #d4edda; color: #155724; }
.b-gray { background: #e9ecef; color: #555; }
.b-blue { background: #e3f2fd; color: #0d47a1; }

/* 写真の拡大表示 */
#lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 9999; justify-content: center; align-items: center; cursor: zoom-out; }
#lightbox.open { display: flex; }
#lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: .25rem; }
#lightbox .close { position: absolute; top: .75rem; right: 1rem; color: #fff; font-size: 2rem; line-height: 1; min-width: 2.75rem; min-height: 2.75rem; display: flex; align-items: center; justify-content: center; }

/* フッター */
.footer { text-align: center; font-size: .8rem; color: #888; padding: 1.25rem 1rem 1.5rem; }
.footer a { color: #888; }
