/* Styles for the application pages served by Tomcat (/app). Same palette as public-site/css/site.css. */

:root {
  --ink: #1d2433;
  --muted: #566074;
  --brand: #2f6fde;
  --brand-dark: #2257b5;
  --band: #f3f6fb;
  --line: #dde3ee;
  --error: #b42318;
  --error-bg: #fef3f2;
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--band);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--brand); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 0.4em; }
h2 { font-size: 1.15rem; margin: 0 0 0.6em; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }

/* Top bar */
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-row { max-width: 960px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.topbar nav { display: flex; align-items: center; gap: 18px; }
.topbar nav a { color: var(--ink); text-decoration: none; }
.topbar nav a:hover { color: var(--brand); }

/* Layout */
main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 32px 20px; }
.narrow { max-width: 440px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin-bottom: 20px; }

/* Forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input { width: 100%; padding: 10px 12px; font: inherit; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; }
.field input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.field .hint { font-size: 0.9rem; color: var(--muted); margin-top: 4px; }
.field .error { font-size: 0.9rem; color: var(--error); margin-top: 4px; }
.field.invalid input { border-color: var(--error); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

button, .button {
  display: inline-block; padding: 10px 20px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--brand); color: #fff; font: inherit; font-weight: 600; text-decoration: none;
}
button:hover, .button:hover { background: var(--brand-dark); color: #fff; }
button:disabled { opacity: 0.6; cursor: wait; }
button.quiet, .link-button { background: transparent; color: var(--brand); padding: 0; font-weight: 400; }
button.quiet:hover, .link-button:hover { background: transparent; color: var(--brand-dark); text-decoration: underline; }
.button.secondary { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); text-align: center; box-sizing: border-box; }
.button.secondary:hover { background: var(--brand); color: #fff; }
.wide { width: 100%; }
.below { margin-top: 18px; font-size: 0.95rem; color: var(--muted); }

/* Messages */
.notice { border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; }
.notice.error { background: var(--error-bg); color: var(--error); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
[hidden] { display: none !important; }

footer { text-align: center; color: var(--muted); font-size: 0.9rem; padding: 20px; }

@media (max-width: 520px) {
  .card { padding: 20px; }
  .row { grid-template-columns: 1fr; gap: 0; }
}

/* Lists of children, devices, adults and invitations */
h3 { font-size: 1rem; margin: 1.6em 0 0.4em; }
.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li { padding: 14px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between;
  align-items: center; gap: 12px; flex-wrap: wrap; }
.item-list li:first-child { border-top: 0; padding-top: 0; }
.item-list li.stack { flex-direction: column; align-items: flex-start; gap: 4px; }
.item-list a { font-weight: 600; font-size: 1.05rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
button.small { padding: 6px 12px; font-size: 0.9rem; }
button.danger { background: transparent; color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
button.danger:hover { background: var(--error); color: #fff; }
.secondary-button { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); padding: 8px 14px; }
.secondary-button:hover { background: var(--brand); color: #fff; }
.field select { width: 100%; padding: 10px 12px; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
fieldset.checks { border: 0; padding: 0; margin: 0 0 16px; }
fieldset.checks legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
fieldset.checks label, .inline-checks label { margin-right: 18px; white-space: nowrap; }
fieldset.checks .hint { font-size: 0.9rem; color: var(--muted); margin-top: 4px; }
.inline-checks { font-size: 0.95rem; }
.result { margin-top: 20px; padding: 16px; border-radius: 8px; background: var(--band); }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; padding: 8px 10px; font: inherit; font-size: 0.9rem; border: 1px solid var(--line); border-radius: 8px; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; letter-spacing: 0.08em; }
.spaced { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.sibling { font-weight: 600; font-size: 1.05rem; cursor: pointer; }
.sibling input { width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; }
.qr { width: 240px; max-width: 100%; margin: 4px 0 16px; }
.qr svg { display: block; width: 100%; height: auto; border-radius: 6px; }

/* Friendships and chats (Stage 4 and 5) */
.attention { color: var(--brand-dark); font-size: 0.95rem; flex-basis: 100%; }
.tag { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 1px 8px; border-radius: 999px;
  background: var(--band); color: var(--muted); margin-left: 6px; vertical-align: middle; }
.tag.waiting { background: #fff4e5; color: #8a4b00; }
.controls p { margin: 0 0 0.6em; }
.controls .actions { margin-top: 0; }
.secondary-button.small { padding: 6px 12px; }

/* A transcript: read-only bubbles, the adult's own child on the right */
.transcript { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.transcript li { display: flex; flex-direction: column; max-width: 80%; align-self: flex-start; align-items: flex-start; }
.transcript li.yours { align-self: flex-end; align-items: flex-end; }
.transcript .who { font-size: 0.85rem; color: var(--muted); margin-bottom: 2px; }
.transcript .bubble { padding: 9px 13px; border-radius: 16px; background: var(--band); border: 1px solid var(--line);
  white-space: pre-wrap; overflow-wrap: anywhere; }
.transcript li.yours .bubble { background: #e8f0fd; border-color: #c9dafb; }
.transcript .bubble.was-hidden { border-style: dashed; }
.transcript .hidden-note { font-size: 0.8rem; color: var(--error); }

/* The parents' discussion: a warm tint so it never looks like the children's chat */
.discussion { background: #fffaf0; border-color: #f0dfb8; }
.discussion .transcript { margin-bottom: 12px; }
.discussion textarea { width: 100%; box-sizing: border-box; font: inherit; resize: vertical; }
.notes .bubble { background: #fff; }
.transcript.notes li.yours .bubble { background: #fdf0d2; border-color: #efd9a4; }
