/* おうちの健康診断：見た目 */
:root {
  --green: #2f7d6d;
  --green-dark: #23604f;
  --green-soft: #e8f3ef;
  --cream: #faf8f3;
  --text: #2b2b2b;
  --muted: #5f6b66;
  --line: #dfe6e2;
  --error: #b3261e;
  --error-soft: #fdecea;
  --ok-soft: #e6f4ea;
  --radius: 16px;
  font-size: 18px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-text-size-adjust: 100%;
}

[hidden] { display: none !important; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { border-radius: 10px; }
.brand-name { font-weight: 700; font-size: 1.05rem; line-height: 1.3; }
.brand-sub { font-size: 0.78rem; color: var(--muted); line-height: 1.3; }

main {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 32px;
}

h1 { font-size: 1.5rem; margin: 0 0 12px; }
h2 { font-size: 1.15rem; margin: 0 0 10px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(47, 125, 109, 0.06);
}
.card.soft { background: #fff; }
.card.center { text-align: center; }

.lead { color: var(--muted); margin: 0 0 18px; }
.note, .small { color: var(--muted); font-size: 0.85rem; }
.note { text-align: center; padding: 0 8px; }

label { display: block; font-weight: 700; margin: 14px 0 6px; }

input[type="email"], input[type="password"], input[type="text"] {
  width: 100%;
  font-size: 1.1rem;           /* iPhoneで勝手に拡大されないよう16px以上 */
  padding: 14px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
}
input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 76px; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: none; background: var(--green-soft); color: var(--green-dark);
  font-size: 0.85rem; font-weight: 700; padding: 8px 10px; border-radius: 8px; cursor: pointer;
}

.btn-primary {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 16px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  background: var(--green);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  min-height: 56px;
}
.btn-primary:hover { background: var(--green-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }

.btn-link {
  display: block; width: 100%; margin-top: 16px; padding: 10px;
  background: none; border: none; color: var(--green-dark);
  font-size: 1rem; text-decoration: underline; cursor: pointer;
}
.btn-text {
  background: none; border: 2px solid var(--line); border-radius: 10px;
  color: var(--muted); font-size: 0.9rem; padding: 8px 12px; cursor: pointer;
}

.msg { margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--ok-soft); }
.msg-error { background: var(--error-soft); color: var(--error); font-weight: 700; }

.hello { color: var(--muted); margin: 0 0 4px; }

.list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.house {
  background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--green);
  border-radius: 12px; padding: 16px;
}
.house-name { font-weight: 700; font-size: 1.1rem; }
.house-sub { color: var(--muted); font-size: 0.9rem; }
.house.trash { border-left-color: #b9b9b9; opacity: 0.8; }
.empty { color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center; }

.coming { margin: 0 0 8px; padding-left: 1.2em; }
.coming li { margin: 4px 0; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 6px; text-align: center; }
.stat-num { font-size: 1.6rem; font-weight: 700; color: var(--green-dark); }
.stat-label { font-size: 0.8rem; color: var(--muted); }

.spinner {
  width: 40px; height: 40px; margin: 8px auto 12px;
  border: 4px solid var(--green-soft); border-top-color: var(--green);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.footer {
  text-align: center; color: var(--muted); font-size: 0.85rem;
  padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: #fff;
}
