/* OpenMind conference app. Mobile first, high contrast, no external assets. */

:root {
  --bg: #fffdf7;
  --surface: #ffffff;
  --ink: #12161c;
  --muted: #44505f;
  --line: #b9c1cc;
  --accent: #0a4fc4;
  --accent-ink: #ffffff;
  --accent-soft: #e3edff;
  --danger: #a1081f;
  --danger-soft: #fde8eb;
  --ok: #0a6a37;
  --banner-bg: #ffe9a3;
  --banner-line: #7a4b00;
  --banner-ink: #2b1a00;
  --focus: #b35a00;
  --think-bg: #e8f6ee;
  --think-line: #0a6a37;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1318;
    --surface: #181e26;
    --ink: #f3f5f8;
    --muted: #b8c1ce;
    --line: #455060;
    --accent: #8db4ff;
    --accent-ink: #08142b;
    --accent-soft: #1b2a47;
    --danger: #ff8d9c;
    --danger-soft: #3a1219;
    --ok: #6fdc9f;
    --banner-bg: #4a3600;
    --banner-line: #ffcc4d;
    --banner-ink: #fff0c2;
    --focus: #ffb454;
    --think-bg: #12301f;
    --think-line: #6fdc9f;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wrap { max-width: 40rem; margin: 0 auto; padding: 16px; }
main.wrap { padding-top: 20px; padding-bottom: 40px; }

h1 { font-size: 1.7rem; line-height: 1.2; margin: 0.4em 0 0.5em; }
h2 { font-size: 1.25rem; line-height: 1.25; margin: 1.2em 0 0.5em; }
.card h2 { margin-top: 0; }
h3 { font-size: 1.1rem; margin: 0 0 0.3em; }
p { margin: 0 0 0.9em; }
a { color: var(--accent); text-underline-offset: 3px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0 16px; }
.lead { font-size: 1.1rem; }
.hint { color: var(--muted); font-size: 0.95rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* Header and footer */
.top { background: var(--surface); border-bottom: 2px solid var(--line); }
.top-inner { max-width: 40rem; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.brand { font-weight: 800; font-size: 1.2rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.nav a { color: var(--ink); font-weight: 600; }
.who { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9rem; color: var(--muted); }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
form.inline { display: inline; margin: 0; }

/* Cards and layout */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin: 0 0 16px;
}
fieldset.card { min-width: 0; }
legend { font-weight: 700; padding: 0 6px; }
.stack > * + * { margin-top: 14px; }
.stack > .btn + .hint, .stack .hint { margin-top: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
ul.cards { list-style: none; padding: 0; margin: 0; }
.steps { padding-left: 1.3em; }
.steps li { margin-bottom: 0.8em; }
.prose h2, .prose h3, .prose h4 { margin-top: 1em; }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 1em; }
.prose th, .prose td, table th, table td { border: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.prose code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--accent-soft); padding: 0 4px; border-radius: 4px; }
.task-prompt { border-left: 6px solid var(--accent); font-size: 1.1rem; }
.keep-lines { white-space: pre-line; }

/* Buttons: large tap targets */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 12px 22px;
  background: var(--accent); color: var(--accent-ink);
  border: 2px solid var(--accent); border-radius: 12px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  text-align: center;
}
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.btn-outline { background: transparent; color: var(--accent); }
.btn-quiet { background: transparent; color: var(--ink); border-color: transparent; text-decoration: underline; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.btn-small { min-height: 44px; padding: 8px 14px; font-size: 0.95rem; }
.danger-link { color: var(--danger); font-weight: 600; }
form .btn { width: 100%; }
form.inline .btn, .actions .btn, .card .btn-small, form.switch .btn { width: auto; }

/* Form fields */
label { display: block; font-weight: 700; margin-bottom: 6px; }
input[type="text"], input[type="password"], textarea {
  width: 100%; min-height: 56px; padding: 12px 14px;
  font: inherit; color: var(--ink); background: var(--surface);
  border: 2px solid var(--line); border-radius: 10px;
}
textarea { min-height: 110px; }
input[type="file"] {
  width: 100%; padding: 14px; font: inherit; color: var(--ink);
  background: var(--accent-soft); border: 2px dashed var(--accent); border-radius: 12px;
}
.alt-label { font-weight: 600; color: var(--muted); }
label.check { display: flex; align-items: flex-start; gap: 12px; font-weight: 400; padding: 10px 0; min-height: 48px; }
label.check input { flex: none; width: 28px; height: 28px; margin: 2px 0 0; accent-color: var(--accent); }
.req { font-style: normal; font-weight: 700; color: var(--danger); font-size: 0.85rem; }
.opt { font-style: normal; color: var(--muted); font-size: 0.85rem; }
.choices { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; margin: 0; flex: 1 1 6rem; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: flex; align-items: center; justify-content: center; min-height: 56px;
  border: 2px solid var(--line); border-radius: 12px; font-weight: 700; cursor: pointer; background: var(--surface);
}
.choice input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Messages */
.alert, .notice {
  border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; font-weight: 600;
}
.alert { background: var(--danger-soft); border: 2px solid var(--danger); color: var(--ink); }
.notice { background: var(--accent-soft); border: 2px solid var(--accent); color: var(--ink); font-weight: 500; }

/* The preview banner: impossible to miss */
.banner {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--banner-bg); color: var(--banner-ink);
  border: 3px solid var(--banner-line); border-radius: 14px;
  padding: 14px 16px; margin: 0 0 18px;
}
.banner p { margin: 0; font-weight: 700; }
.banner-tag {
  align-self: flex-start; background: var(--banner-line); color: var(--banner-bg);
  font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.85rem;
  padding: 2px 10px; border-radius: 999px;
}
.think { background: var(--think-bg); border: 2px solid var(--think-line); border-radius: 14px; padding: 14px 16px; margin: 0 0 16px; }
.think h2 { margin-top: 0; }
.think p { margin: 0; font-size: 1.1rem; }

/* Codes and photos */
.label { font-weight: 700; color: var(--muted); font-size: 0.95rem; }
.secret {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.8rem; font-weight: 800;
  letter-spacing: 0.08em; padding: 10px 0; word-break: break-all; user-select: all;
}
.pill { display: inline-block; padding: 2px 12px; border-radius: 999px; background: var(--accent-soft); font-size: 0.9rem; font-weight: 600; }
.preview, .photo { display: block; max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); }
.preview { max-height: 320px; width: auto; margin: 0 auto; }

.busy { display: flex; align-items: center; gap: 12px; font-weight: 700; background: var(--accent-soft); border: 2px solid var(--accent); border-radius: 12px; padding: 12px 16px; }
.spinner {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  border: 4px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* Admin */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 10px; margin: 0; }
.stats div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.stats dt { color: var(--muted); font-size: 0.9rem; }
.stats dd { margin: 0; font-size: 1.5rem; font-weight: 800; }
.switch { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.on { color: var(--ok); } .off { color: var(--danger); }
table { border-collapse: collapse; width: 100%; }

/* Typed answers (the main path) */
.progress { color: var(--muted); font-weight: 600; margin: 0.4em 0 0; }
.answer-input { font-size: 1.2rem; }
textarea { min-height: 140px; line-height: 1.45; }
.btn-big { min-height: 64px; font-size: 1.15rem; width: 100%; }
.actions .btn-big { width: 100%; }
.next-actions { flex-direction: column; }
.gap { border-left: 6px solid var(--think-line); padding: 2px 0 2px 12px; margin: 0 0 14px; }
.gap h3 { margin-bottom: 0.2em; }
.gap p { margin: 0; }

/* Collapsible boxes: "Prefer paper?", "What you sent", "Come back later or withdraw" */
summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.alt-photo { margin: 0 0 16px; }
.alt-photo > summary { color: var(--accent); font-weight: 600; font-size: 0.95rem; text-decoration: underline; text-underline-offset: 3px; }
.alt-photo[open] > summary { margin-bottom: 8px; }
.comeback { margin-top: 24px; }
.comeback[open] > summary { margin-bottom: 8px; }
.sent > summary { font-weight: 600; }
