:root {
    --maroon: #901A3C;
    --maroon-dark: #6f1430;
    --orange: #F07A22;
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #e2e5ea;
    --field-line: #d7dce3;
    --bg: #f6f5f3;
    --error: #b91c1c;
    --ok-bg: #f0fdf4;
    --ok-line: #86efac;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--maroon); }

/* ── Public container ───────────────────────────────────────── */
.page { padding: 40px 16px 56px; }
/* Layout modelled on the Cantus Silvae registration page: one centred
   white card, soft shadow, logo on top, single column of full-width fields. */
.card {
    max-width: 920px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(16, 24, 40, 0.06);
    padding: 40px 40px 36px;
}
.brand { text-align: center; margin-bottom: 12px; }
.brand img { height: 170px; width: auto; max-width: 60%; }
.page-title { text-align: center; font-size: 30px; font-weight: 800; margin: 12px 0 6px; letter-spacing: -0.2px; }
.page-sub { text-align: center; color: #4b5563; margin: 0 0 24px; font-size: 15px; }

.steps { display: flex; justify-content: center; gap: 8px; margin-bottom: 24px; }
.steps span {
    font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px;
    background: #f1f2f4; color: var(--muted);
}
.steps span.on { background: var(--maroon); color: #fff; }

.section { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; }
.section.section--first { border-top: none; margin-top: 0; padding-top: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-title { font-size: 16px; font-weight: 700; margin: 0; padding-left: 10px; border-left: 4px solid var(--orange); }
.section-note { color: var(--muted); font-size: 13px; margin: -6px 0 14px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.grid > .col-2 { grid-column: 1 / -1; }
.col-2 { grid-column: 1 / -1; }

.field label, .field .label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.req { color: inherit; }
.opt { color: var(--muted); font-weight: 400; }
.field input[type=text], .field input[type=email], .field input[type=tel],
.field input[type=date], .field input[type=password], .field select, .field textarea {
    width: 100%; height: 46px; padding: 0 14px;
    border: 1px solid var(--field-line); border-radius: 8px; background: #fff;
    font: inherit; color: inherit;
}
.field input::placeholder { color: #6b7280; }
.field input:focus, .field select:focus { outline: 2px solid rgba(144, 26, 60, 0.25); border-color: var(--maroon); }
.field.has-error input, .field.has-error select { border-color: var(--error); }
.input-with-btn { display: flex; gap: 10px; align-items: center; }
.input-with-btn input { flex: 1; min-width: 0; }
.input-with-btn .btn { height: 46px; white-space: nowrap; flex-shrink: 0; }
.field-error, .errorlist { color: var(--error); font-size: 12.5px; margin: 4px 0 0; padding: 0; list-style: none; }
.alert { border-radius: 8px; padding: 12px 14px; margin-bottom: 18px; font-size: 14px; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: var(--error); }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-success { background: var(--ok-bg); border: 1px solid var(--ok-line); color: #166534; }
.alert-warn { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; }

.checks { display: flex; gap: 12px; flex-wrap: wrap; }
.checks label {
    display: flex; align-items: center; gap: 8px; margin: 0;
    border: 1px solid var(--field-line); border-radius: 8px; padding: 10px 16px;
    font-weight: 500; cursor: pointer; min-height: 44px;
}
.checks input { width: 18px; height: 18px; accent-color: var(--maroon); }
.checks ul, .checks li { list-style: none; margin: 0; padding: 0; display: contents; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 44px; padding: 0 22px; border-radius: 8px; border: 1px solid var(--maroon);
    font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
    background: var(--maroon); color: #fff;
}
.btn:hover { background: var(--maroon-dark); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-outline { background: #fff; color: var(--maroon); }
.btn-outline:hover { background: #fdf2f5; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.actions .spacer { flex: 1; }

/* Signature pad (mirrors TMC review_form markup) */
.sig-wrap {
    border: 1.5px solid var(--field-line); border-radius: 12px; background: #fff;
    overflow: hidden; position: relative; cursor: crosshair;
}
.sig-canvas { display: block; width: 100%; height: 170px; touch-action: none; }
.sig-placeholder {
    position: absolute; bottom: 12px; left: 0; right: 0; text-align: center;
    font-size: 13px; color: #9ca3af; pointer-events: none; transition: opacity 0.15s;
}
.sig-remove {
    display: none; position: absolute; top: 6px; right: 6px; width: 30px; height: 30px;
    border-radius: 50%; border: 1px solid var(--field-line); background: #fff; cursor: pointer;
    align-items: center; justify-content: center; font-size: 17px; color: var(--muted);
    line-height: 1; padding: 0; z-index: 2;
}
.sig-tools { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 8px; gap: 8px; flex-wrap: wrap; }
.sig-help { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }

/* Modals (crop / preview) */
.modal {
    display: none; position: fixed; inset: 0; z-index: 9000; background: rgba(0, 0, 0, 0.72);
    align-items: center; justify-content: center; padding: 16px; overflow-y: auto;
}
.modal-box { background: #fff; border-radius: 16px; padding: 20px 20px 16px; width: 100%; margin: auto; }
.modal-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.modal-text { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.modal-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.modal-actions > div { display: flex; gap: 8px; }

/* Honeypot */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Terms */
.terms-box {
    border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px;
    max-height: 420px; overflow-y: auto; background: #fcfcfd; font-size: 14px;
}
.terms-box h2 { font-size: 16px; margin: 0 0 8px; color: var(--maroon); }
.terms-box h3 { font-size: 15px; margin: 16px 0 6px; }
.terms-meta { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }
.consent {
    display: flex; gap: 12px; align-items: flex-start; margin-top: 18px;
    border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; cursor: pointer;
}
.consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--maroon); flex-shrink: 0; }
.consent:has(input:checked) { background: var(--ok-bg); border-color: var(--ok-line); }

.ref-box {
    text-align: center; border: 1px dashed var(--orange); border-radius: 12px;
    padding: 18px; margin: 20px auto; max-width: 380px; background: #fffaf5;
}
.ref-box .ref { font-size: 26px; font-weight: 800; letter-spacing: 1px; color: var(--maroon); }

@media (max-width: 640px) {
    .page { padding: 16px 12px 32px; }
    .card { padding: 28px 18px; border-radius: 16px; }
    .page-title { font-size: 24px; }
    .brand img { height: 130px; }
    .grid { grid-template-columns: 1fr; gap: 16px; }
    .actions .btn { flex: none; width: 100%; }
    .input-with-btn { flex-direction: column; align-items: stretch; }
    .input-with-btn input { flex: none; }
    .input-with-btn .btn { height: 40px; }
    .actions .spacer { display: none; }
    .actions { flex-direction: column-reverse; }
}

/* ── Staff ───────────────────────────────────────────────────── */
.staff-bar {
    background: #fff; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 20px; flex-wrap: wrap;
}
.staff-bar img { height: 38px; width: auto; vertical-align: middle; }
.staff-bar .who { font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.staff-main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 48px; }
.staff-main h1 { font-size: 20px; margin: 0 0 14px; }
.search { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.search input { flex: 1 1 240px; height: 40px; padding: 0 12px; border: 1px solid var(--field-line); border-radius: 8px; font: inherit; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list th { background: #f8f9fb; font-size: 12.5px; color: var(--muted); font-weight: 600; }
table.list tr:last-child td { border-bottom: none; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; }
.panel h2 { font-size: 15px; margin: 0 0 12px; padding-left: 10px; border-left: 4px solid var(--orange); }
dl.kv { display: grid; grid-template-columns: 220px 1fr; margin: 0; }
dl.kv dt, dl.kv dd { padding: 7px 0; border-bottom: 1px solid #f0f1f3; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 13px; }
.orig { display: block; font-size: 12px; color: #9a3412; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.badge-ok { background: var(--ok-bg); color: #166534; border-color: var(--ok-line); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.sig-img { max-width: 360px; width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
details summary { cursor: pointer; font-weight: 600; }
@media (max-width: 640px) { dl.kv { grid-template-columns: 1fr; } dl.kv dt { border-bottom: none; padding-bottom: 0; } }
