/* SQ-78 D2/D4: parent consent page and consent management. No external resources, no inline styles (strict CSP). */
:root {
  color-scheme: light dark;
  --bg: #f3f5f7;
  --card: #ffffff;
  --text: #202b36;
  --muted: #53606d;
  --line: #cbd5df;
  --accent: #0b6b8f;
  --brand-blue: #138cc8;
  --brand-teal: #1a8ea1;
  --brand-green: #44bd8c;
  --on-accent: #ffffff;
  --error-bg: #fdecea;
  --error-line: #b3261e;
  --danger: #b3261e;
  --on-danger: #ffffff;
  --focus: #0b57d0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1820;
    --card: #17222d;
    --text: #e6edf3;
    --muted: #a9b6c3;
    --line: #34444f;
    --accent: #7fd0e6;
    --on-accent: #0b1a26;
    --error-bg: #3a1a18;
    --error-line: #f2b8b5;
    --danger: #f2b8b5;
    --on-danger: #3a1a18;
    --focus: #8ab4f8;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body::before {
  content: "";
  display: block;
  height: 0.5rem;
  background-color: var(--brand-teal);
  background-image: linear-gradient(90deg, var(--brand-blue), var(--brand-teal), var(--brand-green));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.bar,
.card,
.footer {
  width: 100%;
  max-width: 42rem;
  margin-inline: auto;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent);
}

.brand img { width: 2.25rem; height: 2.25rem; }

select {
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 0.5rem;
  min-height: 2.75rem;
  padding: 0 0.75rem;
}

.card {
  background: var(--card);
  border-radius: 0.75rem;
  padding: 1.25rem 1rem 1.5rem;
  overflow-wrap: anywhere;
}

@media (min-width: 44rem) {
  .card { padding: 2rem; }
}

h1 { font-size: 1.5rem; line-height: 1.3; margin: 0 0 1rem; }
h2 { font-size: 1.3rem; line-height: 1.4; margin: 2rem 0 0.5rem; }
h3 { font-size: 1.1rem; line-height: 1.4; margin: 0 0 0.25rem; }
p { margin: 0 0 1rem; }
ol, ul { padding-left: 1.5rem; }
li { margin-bottom: 0.75rem; }

.notice ol { padding-left: 1.5rem; }
.notice ul li { margin-bottom: 0.75rem; }

.muted { color: var(--muted); }

a { color: var(--accent); text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

h1:focus { outline: none; }

form { margin-top: 2rem; border-top: 1px solid var(--line); padding-top: 1.5rem; }

label.field { display: block; font-weight: 600; margin-bottom: 0.25rem; }

input[type="text"] {
  font: inherit;
  letter-spacing: 0.2em;
  width: 100%;
  max-width: 14rem;
  min-height: 3rem;
  padding: 0 0.75rem;
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 0.5rem;
}

.help { color: var(--muted); font-size: 0.95rem; margin: 0.25rem 0 1rem; }

.check {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 1rem 0 1.5rem;
}

.check input {
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.2rem;
  flex: none;
  accent-color: var(--accent);
}

.buttons { display: grid; gap: 0.75rem; }

button {
  font: inherit;
  font-weight: 600;
  min-height: 3rem;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  border: 2px solid var(--accent);
  cursor: pointer;
}

button.primary { background: var(--accent); color: var(--on-accent); }
a.button {
  display: inline-block;
  box-sizing: border-box;
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--accent);
  border-radius: 0.5rem;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
a.button.primary { background: var(--accent); color: var(--on-accent); }
.qr { margin: 0 0 1rem; }
.qr-image { width: 11rem; max-width: 100%; border-radius: 0.5rem; overflow: hidden; background: #fff; }
.qr-image svg { display: block; width: 100%; height: auto; }
button.secondary { background: transparent; color: var(--accent); }
button.danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.notice-line {
  background: var(--card);
  border-left: 0.35rem solid var(--accent);
  border-radius: 0.25rem;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

.buttons.manage { gap: 1.25rem; }
.buttons.manage .help { margin: 0.5rem 0 0; }

.error {
  background: var(--error-bg);
  border-left: 0.35rem solid var(--error-line);
  border-radius: 0.25rem;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

.footer {
  padding: 1rem 1rem 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer p { margin: 0 0 0.5rem; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

@media (min-width: 36rem) {
  .buttons { grid-template-columns: repeat(3, auto); justify-content: start; }
  .buttons.manage { grid-template-columns: 1fr; }
  .buttons .primary { order: -1; }
}
