:root {
  color-scheme: light;
  --ink: #12233a;
  --muted: #65788f;
  --paper: #f3f8fc;
  --panel: #ffffff;
  --line: #d7e6f3;
  --navy: #16304b;
  --navy-soft: #244b70;
  --blue: #5f9fca;
  --blue-soft: #dcefff;
  --blue-pale: #eef7ff;
  --danger: #a23a35;
  --success: #287354;
  --shadow: 0 18px 42px rgba(25, 55, 84, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(90deg, rgba(95, 159, 202, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(95, 159, 202, 0.08) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
}

.app-shell {
  display: grid;
  gap: 18px;
  width: min(1240px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.progress-panel {
  display: grid;
  gap: 24px;
  padding: 26px;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(95, 159, 202, 0.38), transparent 58%),
    linear-gradient(315deg, rgba(220, 239, 255, 0.16), transparent 42%),
    var(--navy);
}

.intro-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: center;
}

.brand-lockup {
  display: flex;
  gap: 16px;
  align-items: center;
}

.brand-mark {
  display: grid;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(220, 239, 255, 0.42);
  border-radius: 8px;
  color: #fff;
  font-weight: 850;
  background: rgba(220, 239, 255, 0.14);
}

.eyebrow {
  margin: 0 0 8px;
  color: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  opacity: 0.72;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 3.2rem;
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.42rem;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
  line-height: 1.55;
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.22fr) minmax(280px, 1fr) minmax(120px, 0.22fr);
  gap: 14px;
  align-items: stretch;
}

.top-stat,
.progress-card {
  border: 1px solid rgba(220, 239, 255, 0.28);
  border-radius: 8px;
  background: rgba(238, 247, 255, 0.11);
}

.top-stat {
  display: grid;
  align-content: center;
  min-height: 108px;
  padding: 18px;
}

.stat-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.progress-panel .stat-label {
  color: rgba(238, 247, 255, 0.7);
}

.top-stat strong {
  display: block;
  font-size: 2.4rem;
  line-height: 1;
}

.progress-card {
  display: grid;
  align-content: center;
  min-height: 108px;
  padding: 18px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: rgba(238, 247, 255, 0.82);
  font-weight: 800;
}

.progress-track {
  height: 14px;
  overflow: hidden;
  border: 1px solid rgba(220, 239, 255, 0.36);
  border-radius: 999px;
  background: rgba(238, 247, 255, 0.18);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #dcefff, #86bddf, #5f9fca);
  transition: width 260ms ease;
}

.milestone-track {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.milestone {
  min-width: 54px;
  padding: 7px 10px;
  border: 1px solid rgba(220, 239, 255, 0.25);
  border-radius: 999px;
  color: rgba(238, 247, 255, 0.68);
  font-size: 0.82rem;
  font-weight: 850;
  text-align: center;
}

.milestone.reached {
  border-color: transparent;
  color: var(--navy);
  background: var(--blue-soft);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.join-panel,
.people-panel {
  padding: 24px;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading .eyebrow {
  color: var(--blue);
  opacity: 1;
}

.join-form {
  display: grid;
  gap: 11px;
}

label {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
}

input {
  width: 100%;
  height: 48px;
  border: 1px solid #cbdbea;
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(95, 159, 202, 0.16);
}

.country-combobox {
  position: relative;
}

.country-options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  box-shadow: 0 18px 30px rgba(25, 55, 84, 0.16);
}

.country-option {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  text-align: left;
  background: transparent;
}

.country-option:hover,
.country-option:focus {
  background: var(--blue-pale);
  outline: none;
}

.country-flag {
  font-size: 1.2rem;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 18px;
  font-weight: 900;
}

.primary-button {
  margin-top: 10px;
  color: #fff;
  background: var(--navy-soft);
}

.primary-button:hover:not(:disabled) {
  background: var(--navy);
}

.secondary-button {
  color: var(--navy);
  border-color: #b7d7ef;
  background: var(--blue-soft);
}

.message {
  min-height: 24px;
  margin: 16px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.message[data-type="warning"],
.message[data-type="error"] {
  color: var(--danger);
}

.message[data-type="success"] {
  color: var(--success);
}

.share-card {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.share-card strong {
  display: block;
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.share-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.share-stats {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.people-panel {
  min-height: 520px;
}

.people-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.people-count {
  min-width: 48px;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--navy);
  font-weight: 900;
  text-align: center;
  background: var(--blue-soft);
}

.people-list {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding: 0 4px 0 0;
  margin: 0;
  list-style: none;
}

.people-list li {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
}

.person-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  background: var(--navy-soft);
}

.person-identity {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.person-identity strong,
.person-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-identity small,
.person-joined {
  color: var(--muted);
  font-weight: 750;
}

.person-joined {
  font-size: 0.86rem;
  text-align: right;
}

.people-empty {
  grid-template-columns: 1fr !important;
  color: var(--muted);
  font-weight: 750;
}

.modal-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 35, 58, 0.42);
  backdrop-filter: blur(4px);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(18, 35, 58, 0.26);
}

.modal-card .eyebrow {
  color: var(--blue);
  opacity: 1;
}

.modal-card h2 {
  margin-bottom: 10px;
  color: var(--navy);
  font-size: 2rem;
}

.modal-copy {
  margin-bottom: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.modal-share-row {
  margin-top: 8px;
}

.icon-button {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 900;
  background: var(--blue-pale);
}

@media (max-width: 900px) {
  .intro-row,
  .progress-row,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .progress-row {
    gap: 10px;
  }

  .top-stat {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 12px;
  }

  .progress-panel,
  .join-panel,
  .people-panel,
  .modal-card {
    padding: 18px;
  }

  h1 {
    font-size: 2.45rem;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .share-row,
  .modal-share-row {
    grid-template-columns: 1fr;
  }

  .people-list li {
    grid-template-columns: 42px 1fr;
  }

  .person-joined {
    grid-column: 2;
    text-align: left;
  }
}
