:root {
  --ground: #F3F1EC; --ink: #1A1D21; --muted: #4A5059; --faint: #8A8F96; --line: #D6D2CA;
  --slate: #24323F; --white: #FFFFFF; --req: #9A3412; --soft: #ECE9E3; --err-bg: #FDECEA; --err: #8A1C1C;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.top {
  background: var(--ink); color: var(--white);
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #C9CDD3; }
h1 { margin: 2px 0 0; font-size: 20px; }
.lang { display: flex; border: 1px solid #5B636D; border-radius: 8px; overflow: hidden; }
.lang button { min-width: 64px; min-height: 44px; border: 0; background: transparent; color: var(--white); font: 600 14px/1 inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; }
.flag { width: 22px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.25); flex: 0 0 auto; }
.lang button[aria-pressed="true"] { background: var(--white); color: var(--ink); }

main { max-width: 560px; margin: 0 auto; padding: 20px 20px 40px; }
section { display: flex; flex-direction: column; gap: 20px; }
section[hidden], [hidden] { display: none !important; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack-tight { display: flex; flex-direction: column; gap: 6px; }
.muted { color: var(--muted); margin: 0; }
p { margin: 0; }

fieldset.block { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.label-strong { font-weight: 700; font-size: 17px; padding: 0; }
.cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cat {
  min-height: 84px; border-radius: 12px; border: 2px solid #C7C2B8; background: var(--white); color: var(--ink);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px;
  padding: 10px; cursor: pointer; text-align: left; font: 600 14px/1.25 inherit;
}
.cat[aria-checked="true"] { background: var(--slate); border-color: var(--slate); color: var(--white); }
.note { background: var(--soft); border-radius: 8px; padding: 10px 12px; font-size: 14px; color: #33383F; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-weight: 600; }
.req { color: var(--req); }
.hint { font-weight: 400; color: var(--faint); }
.help { font-size: 13px; color: var(--muted); }
.help-dark { font-size: 14px; color: #33383F; }
.row-help { display: flex; justify-content: space-between; gap: 12px; }
.count { font: 13px ui-monospace, Menlo, Consolas, monospace; color: var(--muted); white-space: nowrap; }
.center { text-align: center; }
input[type="text"], select, textarea {
  width: 100%; min-height: 48px; border: 1px solid var(--faint); border-radius: 8px; padding: 0 12px;
  font: 16px/1.4 inherit; background: var(--white); color: var(--ink);
}
textarea { padding: 10px 12px; resize: vertical; }
input:disabled { background: var(--soft); border-color: #C7C2B8; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, .photo-btn:focus-within {
  outline: 3px solid #3FA7A0; outline-offset: 2px;
}
.invalid { border-color: var(--req) !important; box-shadow: 0 0 0 1px var(--req); }

.photo-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px;
  border: 2px dashed var(--faint); border-radius: 12px; background: var(--white); color: var(--slate);
  font-weight: 600; cursor: pointer;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.photo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.photo-list li {
  display: flex; align-items: center; gap: 12px; background: var(--white); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px;
}
.photo-list img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--soft); }
.photo-list span { flex: 1; font-size: 14px; }
.photo-list button { min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--req); font: 600 14px inherit; cursor: pointer; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.card p { font-size: 14px; color: #33383F; margin-top: 6px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--slate); flex: 0 0 auto; }
.check.disabled { color: var(--faint); cursor: not-allowed; }
.indent { padding-left: 34px; margin-top: -10px; }
.divider { border-top: 1px solid var(--soft); padding-top: 14px; }

.turnstile { min-height: 65px; display: flex; justify-content: center; }
button.primary {
  min-height: 56px; border: 0; border-radius: 12px; background: var(--slate); color: var(--white);
  font: 700 18px inherit; cursor: pointer;
}
button.primary:disabled { opacity: .6; cursor: progress; }
button.secondary {
  min-height: 52px; border: 2px solid var(--slate); border-radius: 12px; background: var(--white); color: var(--slate);
  font: 700 16px inherit; cursor: pointer;
}
.error { background: var(--err-bg); color: var(--err); border: 1px solid #E8B4B0; border-radius: 8px; padding: 12px; font-weight: 600; }

.check-circle { width: 64px; height: 64px; border-radius: 50%; background: #1E7B34; color: var(--white); display: flex; align-items: center; justify-content: center; }
h2 { margin: 0; font-size: 26px; line-height: 1.2; }
.ticket { font: 600 22px ui-monospace, Menlo, Consolas, monospace; }
.strong { font-weight: 600; }

/* Logo top right; language buttons just below the header */
.top .logo { width: 56px; height: 56px; flex: 0 0 auto; }
.lang-row { display: flex; justify-content: flex-end; max-width: 720px; margin: 10px auto 0; padding: 0 16px; box-sizing: border-box; }
.lang-row .lang { border-color: #8A8F96; background: #FFFFFF; }
.lang-row .lang button { color: #1A1D21; background: #FFFFFF; }
.lang-row .lang button[aria-pressed="true"] { background: #1A1D21; color: #FFFFFF; }

/* Two photo buttons: camera and library */
.photo-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-btns[hidden] { display: none; }
#camera-btn { background: var(--slate); color: var(--white); border: 2px solid var(--slate); }   /* the camera: quickest on a phone */
@media (max-width: 380px) { .photo-btns { grid-template-columns: 1fr; } }
