/* EnergyLens IQ -- shared stylesheet for the logged-in product shell
   (index.html / login.html / insights.html). Served at /static/app-shell.css.
   Every class name here is load-bearing: app.js generates markup that
   depends on these exact selectors (.card, .chip.*, .finding, .dropzone,
   .consent, .credbox, .tag, .row2/.row3, button.btn[.secondary|.danger],
   table/tr.clickable, nav button[.active]) -- do not rename any of them
   without also updating app.js. */

:root {
  --navy: #0b1220;
  --navy2: #101828;
  --green: #0a7d54;
  --green-light: #2fd48f;
  --gold: #e0a020;
  --gold-light: #ffcf6b;
  --red: #b3261e;
  --amber: #9a6700;
  --gray: #667085;
  --border: #e2e5ea;
  --bg: #f7f8fa;
  --card: #ffffff;
  --radius: 10px;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; margin: 0; background: var(--bg); color: #1c2128; }

/* ---------- header (shared shape across index.html / insights.html) ---------- */
header { background: var(--navy2); color: #fff; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; }
header .left { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-mark svg { width: 22px; height: 22px; flex: none; }
.brand-mark .wordmark { font-weight: 700; font-size: 15px; color: #fff; }
.brand-mark .wordmark .iq { color: var(--green-light); }
header .tag { display: inline-block; background: #1c2740; border-radius: 5px; padding: 2px 8px; font-size: 11px; margin-left: 8px; color: #b7c0d1; font-weight: 500; }
header a.hlink { color: #b7c0d1; font-size: 12.5px; text-decoration: none; }
header a.hlink:hover { color: #fff; }
header .who { font-size: 13px; color: #b7c0d1; }
header button { background: transparent; border: 1px solid #3a4358; color: #fff; padding: 5px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; }
header button:hover { background: rgba(255,255,255,.08); }

nav { display: flex; gap: 4px; padding: 10px 20px 0; }
nav button { background: none; border: none; padding: 8px 14px; font-size: 13px; cursor: pointer; border-radius: 6px 6px 0 0; color: #445; font-weight: 500; }
nav button.active { background: #fff; font-weight: 700; color: var(--navy2); box-shadow: 0 -2px 0 var(--green) inset; }

main { max-width: 980px; margin: 0 auto; padding: 20px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
h2 { font-size: 17px; margin: 0 0 4px; letter-spacing: -.005em; }
h3 { font-size: 14.5px; margin: 0 0 8px; }
.sub { color: var(--gray); font-size: 13px; margin: 0 0 12px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--gray); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .02em; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #f4f6f9; }
.card { overflow-x: auto; }

/* ---------- small screens: header wraps instead of clipping, tables scroll
   inside their card instead of overflowing the viewport ---------- */
@media (max-width: 640px) {
  header { flex-wrap: wrap; row-gap: 8px; }
  header .left { flex-wrap: wrap; row-gap: 6px; }
  table { min-width: 560px; }
}

.chip { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .01em; }
.chip.green { background: #e5f4ec; color: var(--green); }
.chip.red { background: #fbe9e7; color: var(--red); }
.chip.amber { background: #fdf3e0; color: var(--amber); }
.chip.gray { background: #eef0f3; color: var(--gray); }

label { display: block; font-size: 12.5px; color: #445; margin: 10px 0 3px; font-weight: 500; }
input, select, textarea { width: 100%; padding: 9px 10px; border: 1px solid #ccd2db; border-radius: 7px; font-size: 13px; font-family: inherit; transition: border-color .12s ease; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .row2, .row3 { grid-template-columns: 1fr; } }

button.btn { background: var(--green); color: #fff; border: none; padding: 9px 16px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .12s ease; }
button.btn:hover { background: #086943; }
button.btn.secondary { background: #fff; color: #333; border: 1px solid #ccd2db; font-weight: 600; }
button.btn.secondary:hover { background: #f7f8fa; }
button.btn.danger { background: #fff; color: var(--red); border: 1px solid #f3c9c4; font-weight: 600; }
button.btn.danger:hover { background: #fdf2f1; }
button.btn:disabled { opacity: .5; cursor: not-allowed; }

.finding { border: 1px solid var(--border); border-radius: 9px; padding: 14px 16px; margin-bottom: 10px; }
.finding .amt { font-size: 21px; font-weight: 800; color: var(--green); }
.finding .ev { color: var(--gray); font-size: 12.5px; margin-top: 4px; }

.dropzone { border: 2px dashed #ccd2db; border-radius: 10px; padding: 26px; text-align: center; cursor: pointer; color: var(--gray); font-size: 13px; transition: border-color .12s ease, background .12s ease; }
.dropzone:hover { border-color: #aab2c0; }
.dropzone.drag { border-color: var(--green); background: #f2fbf6; }

.consent { background: #fbfbf0; border: 1px solid #ece7b5; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; margin: 12px 0; display: flex; gap: 8px; align-items: flex-start; }
.consent input { width: auto; margin-top: 2px; }

.note { font-size: 12px; color: var(--gray); }
/* Gold edge marks this box as a one-time, save-it-now moment -- same "gold = energy/
   attention" convention as the public site's mark and "coming next" badges. */
.credbox { background: var(--navy2); color: #d9f7e6; padding: 14px 16px; border-radius: 9px; font-family: ui-monospace, "SF Mono", monospace; font-size: 13px; margin-top: 10px; border-left: 3px solid var(--gold); }
.tag { display: inline-block; background: #eef0f3; border-radius: 5px; padding: 1px 6px; font-size: 11px; margin-left: 6px; color: var(--gray); }

/* ---------- login page ---------- */
body.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: radial-gradient(900px 560px at 50% -10%, #123227 0%, transparent 60%), linear-gradient(160deg, var(--navy) 0%, var(--navy2) 55%, #0b1a15 100%); }
.login-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 34px 32px; width: 320px;
  box-shadow: 0 24px 60px -25px rgba(0,0,0,.5); }
.login-card .brand-mark { margin-bottom: 18px; }
.login-card .brand-mark .wordmark { color: #14181f; font-size: 16px; }
.login-card p.sub { color: var(--gray); font-size: 13px; margin: 0 0 4px 0; }
.login-card button[type="submit"] { width: 100%; margin-top: 20px; padding: 10px; background: var(--green); color: #fff; border: none;
  border-radius: 7px; font-size: 14px; font-weight: 600; cursor: pointer; }
.login-card button[type="submit"]:hover { background: #086943; }
.login-card .err { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 16px; }
