/*
 * The portal is read on a parent's own phone, often an inexpensive one on a
 * slow connection, so there is no framework and no web font: one stylesheet,
 * system fonts, and layouts that work from 320px upwards.
 *
 * Qalam green is the app's own, so a parent recognises where they are.
 */

:root {
  --green: #0eb582;
  --green-dark: #0a8a63;
  --ink: #123;
  --muted: #6b7a86;
  --line: #e4e9ee;
  --bg: #f5f7f9;
  --warn: #b8531b;
  --card-radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ------------------------------------------------------------------ door */

body.door {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.card {
  width: 100%;
  max-width: 26rem;
  background: #fff;
  border-radius: var(--card-radius);
  padding: 2rem 1.5rem;
  box-shadow: 0 1px 3px rgba(18, 51, 68, .08);
}

.card h1 { margin: 0 0 .25rem; color: var(--green); font-size: 1.9rem; }
.lead { margin: 0 0 1.5rem; font-weight: 600; }
.lead span, label span { display: block; font-weight: 400; font-size: .85rem; color: var(--muted); }

label { display: block; margin: 1rem 0 .4rem; font-weight: 600; }

input[type="tel"], input[type="text"] {
  width: 100%;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1.1rem;
}

input:focus { outline: 2px solid var(--green); border-color: var(--green); }

button {
  width: 100%;
  margin-top: 1.25rem;
  padding: .9rem;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

button:hover { background: var(--green-dark); }

button.link {
  background: none;
  color: var(--green);
  font-weight: 500;
  margin-top: .5rem;
}

.notice {
  background: #eefaf5;
  border: 1px solid #cdeee1;
  border-radius: 10px;
  padding: .75rem;
  font-size: .95rem;
}

.foot { margin-top: 1.5rem; font-size: .85rem; color: var(--muted); }
.foot span { color: var(--muted); }

/* ----------------------------------------------------------------- shell */

.top {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: .9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top .brand { color: var(--green); font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.top a.out { color: var(--muted); font-size: .9rem; text-decoration: none; }

.wrap { max-width: 54rem; margin: 0 auto; padding: 1.25rem; }

/* -------------------------------------------------------------- children */

.child-list { display: grid; gap: .85rem; }

.child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #fff;
  border-radius: var(--card-radius);
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(18, 51, 68, .06);
}

.child strong { display: block; font-size: 1.05rem; }
.child small { color: var(--muted); }
.child .go { color: var(--green); font-weight: 600; }

/* ---------------------------------------------------------------- report */

h2 { margin: 0 0 .35rem; font-size: 1.4rem; }
.sub { margin: 0 0 1.25rem; color: var(--muted); }

.periods { display: flex; gap: .5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.periods a {
  padding: .45rem .85rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: .9rem;
}
.periods a.on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .85rem; }

.tile {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(18, 51, 68, .06);
}
.tile .n { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.tile .l { color: var(--muted); font-size: .85rem; }
.tile .d { font-size: .8rem; margin-top: .35rem; }
.tile .d.up { color: var(--green-dark); }
.tile .d.down { color: var(--warn); }

section.block {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 1.25rem;
  margin-top: 1.25rem;
  box-shadow: 0 1px 2px rgba(18, 51, 68, .06);
}

section.block h3 { margin: 0 0 .9rem; font-size: 1.05rem; }
section.block h3 span { font-weight: 400; color: var(--muted); font-size: .85rem; }

/* Days of the week, as bars a parent can read at a glance. */
.days { display: flex; align-items: flex-end; gap: .5rem; height: 7rem; }
.days .day { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-align: center; }
.days .bar { background: var(--green); border-radius: 6px 6px 0 0; min-height: 3px; }
.days .bar.none { background: var(--line); }
.days .cap { font-size: .72rem; color: var(--muted); margin-top: .35rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; }
tr:last-child td { border-bottom: 0; }

.empty { color: var(--muted); margin: 0; }

.pill { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.pill.good { background: #eefaf5; color: var(--green-dark); }
.pill.poor { background: #fdf1ea; color: var(--warn); }

.stale {
  background: #fdf6ec;
  border: 1px solid #f2e0c6;
  border-radius: 10px;
  padding: .8rem 1rem;
  margin-bottom: 1.25rem;
  font-size: .92rem;
}

@media (max-width: 420px) {
  .tile .n { font-size: 1.55rem; }
  .wrap { padding: 1rem .85rem; }
}
