:root {
  --blooom-blue: #2563eb;
  --blooom-blue-dark: #1e3a8a;
  --blooom-blue-soft: #eff6ff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f3f4f6;
  --card: #ffffff;
  --ok: #15803d;
  --warn: #b45309;
  --err: #b91c1c;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
body {
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--ink); background: var(--bg); margin: 0;
}

/* Brand logo (real Blooom wordmark, demo-app/logo.svg) */
.brand { display: flex; align-items: center; gap: .6rem; }
.brand .logo-img { height: 28px; width: auto; display: block; }

/* App header */
header.app {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 0 1.75rem; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
header.app .who { color: var(--muted); font-size: 14px; display: flex; gap: 1rem; align-items: center; }

/* Buttons */
.btn { display: inline-block; padding: .6rem 1.1rem; border: 0; border-radius: 8px;
       font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
       transition: background .15s, opacity .15s; }
.btn-primary { background: var(--blooom-blue); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-warn { background: var(--warn); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* Layout */
.page { max-width: 920px; margin-inline: auto; padding: 1.75rem; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 1.25rem 1.4rem; box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.card.wide { grid-column: 1 / -1; }
.card h3 { margin: 0 0 .6rem; font-size: 13px; text-transform: uppercase;
           letter-spacing: .04em; color: var(--muted); }
.metric { font-size: 1.9rem; font-weight: 700; color: var(--ink); }
.metric .unit { font-size: .9rem; font-weight: 500; color: var(--muted); }

/* Locked card state (before MijnPGO connect) */
.card.locked { position: relative; }
.card.locked .lock-overlay {
  color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: .4rem;
}
.card.locked .metric { color: #cbd5e1; }

/* Loading shimmer (while fetching from MijnPGO) + fade-in when data lands */
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel {
  background: linear-gradient(90deg, #f1f3f5 0%, #e5e7eb 50%, #f1f3f5 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: 5px;
}
.skel-metric { height: 28px; width: 62%; margin-top: .35rem; }
.skel-sub { height: 12px; width: 38%; margin-top: .55rem; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn .4s ease both; }

/* 3-step progress strip */
.steps { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
         background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
         padding: .9rem 1.1rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.step { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: 14px; }
.step .num { width: 22px; height: 22px; border-radius: 50%; background: var(--line);
             color: #fff; display: flex; align-items: center; justify-content: center;
             font-size: 12px; font-weight: 700; flex-shrink: 0; }
.step.done .num { background: var(--ok); }
.step.current { color: var(--ink); font-weight: 600; }
.step.current .num { background: var(--blooom-blue); }
.step .arrow { color: #cbd5e1; }

/* Login */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-card { width: 360px; background: #fff; border: 1px solid var(--line);
             border-radius: 14px; box-shadow: 0 4px 20px rgba(0,0,0,.06); padding: 2rem; }
.auth-card h1 { margin: 1rem 0 .25rem; font-size: 1.25rem; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 1.25rem; }
.field { margin-bottom: .85rem; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: .25rem; }
.field input { width: 100%; padding: .6rem .7rem; border: 1px solid var(--line);
               border-radius: 8px; font-size: 14px; }
.auth-hint { background: var(--blooom-blue-soft); border: 1px solid #dbeafe; border-radius: 8px;
             padding: .65rem .8rem; font-size: 13px; color: var(--blooom-blue-dark); margin-bottom: 1rem; }
.auth-toggle { text-align: center; font-size: 13px; margin-top: 1rem; color: var(--muted); }
.auth-toggle a { color: var(--blooom-blue); cursor: pointer; text-decoration: none; }
.form-err { color: var(--err); font-size: 13px; margin-bottom: .75rem; min-height: 1em; }

/* Misc reused from old index */
.muted { color: var(--muted); font-size: 13px; }
.err { color: var(--err); }
code { font-size: 13px; background: #f0f0f3; padding: 1px 5px; border-radius: 3px; }
.row { display: grid; grid-template-columns: 180px 1fr; gap: .25rem 1rem; }
.row dt { color: var(--muted); } .row dd { margin: 0; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid #eee; font-size: 14px; }
th { color: var(--muted); font-weight: 500; background: #fafafb; }

/* Collapsible demo reference */
.demo-ref { margin-top: 2rem; }
.demo-ref-title { font-size: 13px; text-transform: uppercase; letter-spacing: .04em;
                  color: var(--muted); margin: 0 0 .5rem; border-bottom: 1px solid var(--line);
                  padding-bottom: .35rem; }
.users { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: .6rem; margin-top: .6rem; }
.user { padding: .6rem .7rem; background: #fafafb; border: 1px solid var(--line); border-radius: 8px; }
.user b { display: block; font-size: 14px; } .user .pid { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); }
.links { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 14px; margin-top: .6rem; }
.links a { color: var(--blooom-blue); text-decoration: none; }
