:root {
  --background: #f5f6f3;
  --surface: #ffffff;
  --surface-soft: #eef1eb;
  --text: #1f2923;
  --muted: #69756e;
  --border: #dfe5de;
  --accent: #526d5b;
  --accent-dark: #3d5546;
  --accent-soft: #e8eee9;
  --danger: #a34a49;
  --warning: #9a741d;
  --success: #477457;
  --shadow: 0 10px 30px rgba(31, 41, 35, 0.07);
}

* { box-sizing: border-box; }

body {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 48px;
  background: var(--background);
  color: var(--text);
  font-family: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { margin: 0 0 1rem; font-size: clamp(2rem, 5vw, 3rem); }
h2 { margin: 2rem 0 1rem; font-size: 1.35rem; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 -24px 32px;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--accent); color: white; }
.app-nav { display: flex; align-items: center; gap: 8px; }
.app-nav a { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 9px; }
.app-nav a:hover { background: var(--surface-soft); color: var(--text); }

main { min-height: 60vh; }
.page, .card, .panel, .auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.page { padding: clamp(24px, 5vw, 44px); }
.card { padding: 24px; }
.panel { padding: 20px; }

.auth-card { width: min(100%, 460px); margin: 64px auto; padding: 36px; }
.auth-card h1 { font-size: 2.1rem; }

.flash { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; margin: 0 0 12px; }
.flash.error { background: #fbefee; color: var(--danger); border-color: #eccdcb; }
.flash.warning { background: #faf4df; color: #775b17; border-color: #eadba9; }
.flash.success { background: #edf5ef; color: var(--success); border-color: #cfe0d3; }
.flash.info { background: #edf3f7; color: #4b687c; border-color: #cddae2; }

label { display: block; color: var(--muted); font-size: 0.92rem; font-weight: 700; }
input, textarea, select {
  display: block;
  width: 100%;
  max-width: 680px;
  margin: 6px 0 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcfa;
  color: var(--text);
  padding: 11px 12px;
  font: inherit;
}
input:focus, textarea:focus, select:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
textarea { min-height: 110px; resize: vertical; }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin: 4px 6px 4px 0;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: white;
  padding: 9px 14px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { background: var(--accent-dark); }
button.secondary, .button.secondary { background: white; color: var(--accent); }
form.inline { display: inline-block; margin-right: 8px; }

label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 8px; }
input[type="checkbox"] { width: auto; display: inline-block; margin: 0 0 18px; accent-color: var(--accent); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; background: white; }
th { color: var(--muted); background: var(--surface-soft); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.055em; }
th, td { border-bottom: 1px solid var(--border); padding: 12px; text-align: left; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }

.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.status-item { padding: 16px; background: var(--surface-soft); border-radius: 12px; }
.status-item strong { display: block; margin-top: 4px; font-size: 1.2rem; }
.assignment-name { font-size: clamp(2.4rem, 9vw, 5rem); margin: 24px 0; color: var(--accent-dark); }
.muted { color: var(--muted); }

participant-timeline-page { max-width: 820px; margin: 0 auto; }
.participant-header { margin-bottom: 32px; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-weight: 800; font-size: .78rem; }
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: 23px; top: 24px; bottom: 24px; width: 2px; background: var(--border); }
.timeline-step { position: relative; display: grid; grid-template-columns: 48px 1fr; gap: 18px; min-height: 145px; }
.timeline-marker { position: relative; z-index: 1; width: 48px; height: 48px; display: grid; place-items: center; border: 2px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--muted); font-weight: 800; }
.timeline-step.complete .timeline-marker { background: var(--accent); border-color: var(--accent); color: white; }
.timeline-step.current .timeline-marker { border: 3px solid var(--accent); background: var(--surface); color: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); }
.timeline-content { padding: 2px 0 30px; }
.timeline-content h2 { margin: 2px 0 8px; }
.timeline-label { margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 800; }
.status-complete { color: var(--success); font-weight: 800; }
.assignment-reveal { margin-top: 18px; padding: 20px; border-radius: 12px; background: var(--surface-soft); }
.assignment-reveal .assignment-name { margin: 4px 0 0; font-size: clamp(2rem, 8vw, 3.6rem); }
locked-location { display: block; margin: 10px 0 14px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.locked-location span, .locked-location strong { display: block; }
.locked-location strong { margin-top: 4px; }

@media (max-width: 650px) {
  body { padding: 0 12px 32px; }
  .app-header { margin: 0 -12px 20px; padding: 14px 12px; }
  .brand span:last-child { display: none; }
  .page { padding: 20px 16px; border-radius: 12px; }
  .auth-card { margin: 24px auto; padding: 24px 20px; }
  .app-nav { gap: 2px; }
  .timeline-step { grid-template-columns: 44px 1fr; gap: 12px; }
  .timeline::before { left: 21px; }
  .timeline-marker { width: 44px; height: 44px; }
}
