/* Shared styles for the sign-in, set-password and admin pages.
   Colors match the calculator (sampled from the ABC Testing Services logo). */
:root {
  --navy: #1f2e80;
  --blue: #2e86c6;
  --blue-dark: #236ca3;
  --red: #e02424;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1c2233;
  --muted: #5b6478;
  --border: #d9dfeb;
  --err-bg: #fdecec;
  --err-text: #a51c1c;
  --ok: #1d7a45;
  --ok-bg: #e8f6ee;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
header {
  background: #fff;
  border-bottom: 4px solid var(--navy);
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
}
.header-inner { max-width: 960px; margin: 0 auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo { height: 56px; width: 56px; display: block; border-radius: 8px; }
header h1 { margin: 0; font-size: 1.3rem; line-height: 1.25; color: var(--navy); font-weight: 700; flex: 1 1 220px; }
header h1 span { display: block; font-size: .95rem; font-weight: 500; color: var(--blue); margin-top: 2px; }
header a { color: var(--blue-dark); font-weight: 600; }

main { max-width: 440px; margin: 0 auto; padding: 24px 16px 32px; }
main.wide { max-width: 960px; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 18px 20px; box-shadow: 0 1px 2px rgba(20, 30, 70, .05); margin-bottom: 18px;
}
.card h2 { margin: 0 0 6px; font-size: 1.1rem; color: var(--navy); }
.card p { margin: 0 0 14px; color: var(--muted); font-size: .92rem; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: .9rem; margin-bottom: 4px; font-weight: 600; }
input[type="email"], input[type="password"], input[type="text"] {
  width: 100%; font: inherit; font-size: 16px; /* 16px stops iOS zoom-on-focus */
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
  min-height: 44px;
}
input:focus { outline: 3px solid rgba(46, 134, 198, .3); border-color: var(--blue); }
.pw { position: relative; }
.pw input { padding-right: 68px; }
.pw button {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--blue-dark); font: inherit; font-size: .85rem; font-weight: 600;
  padding: 8px; cursor: pointer;
}

.btn {
  display: inline-block; width: 100%; min-height: 46px; padding: 10px 16px; border-radius: 8px;
  border: 1px solid var(--navy); background: var(--navy); color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn.small { width: auto; min-height: 38px; padding: 6px 12px; font-size: .9rem; }
.btn.plain { background: #fff; color: var(--navy); }
.btn.danger { background: var(--red); border-color: var(--red); }
.link {
  background: none; border: 0; padding: 10px 0 0; color: var(--blue-dark); font: inherit; font-weight: 600;
  text-decoration: underline; cursor: pointer; text-align: left;
}

.msg { border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; font-size: .92rem; font-weight: 600; }
.msg.error { background: var(--err-bg); color: var(--err-text); border: 1px solid #f3b4b4; }
.msg.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #a9dcbd; }
[hidden] { display: none !important; }

/* Admin page */
.add-row { display: flex; gap: 10px; flex-wrap: wrap; }
.add-row input { flex: 1 1 240px; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
td.email { font-weight: 600; overflow-wrap: anywhere; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn + .btn { margin-left: 6px; }
.tag { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: .78rem; font-weight: 700; }
.tag.active { background: var(--ok-bg); color: var(--ok); }
.tag.removed { background: var(--err-bg); color: var(--err-text); }
.tag.admin { background: #eef5fc; color: var(--navy); margin-left: 6px; }
.sub { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }
.table-wrap { overflow-x: auto; }
@media (max-width: 640px) {
  .hide-narrow { display: none; }
}
