/* CasaCeff — clean, quick-reading base styles. Light and dark aware. */
:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --text: #1f2421;
  --muted: #67706b;
  --line: #e3dfd6;
  --accent: #2f5d50;
  --accent-text: #ffffff;
  --danger: #a3392b;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141716;
    --surface: #1d2120;
    --text: #ecefed;
    --muted: #9aa39e;
    --line: #2d3331;
    --accent: #6fb59f;
    --accent-text: #0f1311;
    --danger: #e0806f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); }

/* ---- header ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) 20px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand { font-weight: 700; font-size: 1.25rem; text-decoration: none; color: var(--text); letter-spacing: -0.01em; }
.brand span { color: var(--accent); }
.usernav { display: flex; gap: 18px; }
.usernav a { text-decoration: none; color: var(--muted); font-size: 0.95rem; }
.usernav a:hover { color: var(--text); }

/* ---- layout ---- */
.page { width: 100%; max-width: 44rem; margin: 0 auto; padding: 28px 20px 48px; flex: 1; }
.footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 20px; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 20px; letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; margin: 0 0 4px; }
p { margin: 0 0 14px; }

/* ---- home cards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; position: relative;
}
.card p { color: var(--muted); font-size: 0.93rem; margin: 0; }
.card.soon { opacity: 0.7; }
.badge {
  display: inline-block; margin-top: 12px; font-size: 0.75rem; font-weight: 600;
  color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px;
}

/* ---- messages ---- */
.messages { list-style: none; padding: 0; margin: 0 0 20px; }
.msg { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.msg.error { border-left-color: var(--danger); }

/* ---- forms (login, 2FA and account pages) ---- */
form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin: 0 0 18px; }
form p, form > div { margin: 0 0 14px; }
label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=email], input[type=number], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input[type=checkbox] { width: 20px; height: 20px; vertical-align: middle; margin-right: 8px; accent-color: var(--accent); }
label:has(input[type=checkbox]) { display: flex; align-items: center; font-weight: 500; }
button, input[type=submit], .button {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-text); border: 0; border-radius: 10px;
  padding: 12px 20px; min-height: 46px; margin: 4px 8px 4px 0;
}
button[name=action_remove], button.danger { background: var(--danger); }
.helptext, .help-block, small { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.errorlist { color: var(--danger); padding-left: 18px; margin: 6px 0; font-size: 0.9rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
code, pre { font-size: 0.92rem; }
img[alt*="QR"], svg { background: #fff; padding: 8px; border-radius: 10px; max-width: 220px; height: auto; }
