* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(ellipse at 50% 0%, #dbe8ff, transparent 62%), #eff3f9;
  color: #18273d;
  font: 16px/1.6 system-ui, -apple-system, "Yu Gothic UI", sans-serif;
}
.join-shell {
  position: relative;
  z-index: 1;
  width: min(35rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1.75rem, 6vh, 4.5rem) 0 1.5rem;
  transition: opacity 200ms ease, transform 200ms ease, visibility 0s;
}
.join-header { text-align: center; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .65rem;
  color: #294a88;
  font-size: .875rem;
  font-weight: 700;
}
.brand span {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: .65rem;
  background: #2759c7;
  color: #fff;
}
h1 { margin: 0; font-size: clamp(1.25rem, 4.2vw, 1.85rem); line-height: 1.35; overflow-wrap: anywhere; }
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 1.6rem 0 .85rem;
  padding: 0;
}
.steps li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: .4rem;
  color: #52647d;
  text-align: center;
  font-size: clamp(.72rem, 3vw, .9rem);
  font-weight: 650;
}
.steps li::after {
  content: "";
  position: absolute;
  top: 1rem;
  left: calc(50% + 1.25rem);
  width: calc(100% - 2.5rem);
  height: 2px;
  background: #c8d4e7;
}
.steps li:last-child::after { display: none; }
.steps li span {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 1px solid #cad7eb;
  background: #f8fbff;
  transition: background 220ms, box-shadow 220ms, color 220ms;
}
.steps .complete::after { background: #6489dc; }
.steps .complete span { background: #e1ebff; color: #224a9c; }
.steps [aria-current="step"] { color: #1f49a0; }
.steps [aria-current="step"] span { background: #2759c7; color: #fff; border-color: #2759c7; box-shadow: 0 0 0 .22rem #dce8ff; }
body[data-busy="true"] .steps [aria-current="step"] span { animation: pulse 1.8s ease-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 .14rem #cadcff; }
  66% { box-shadow: 0 0 0 .42rem #dbe7fc; }
}
.join-card {
  border: 1px solid #dce5f1;
  border-radius: 1.15rem;
  padding: clamp(1rem, 5vw, 1.85rem);
  background: #fff;
  box-shadow: 0 12px 35px #1d3e6412;
}
.join-card h2 { font-size: 1.12rem; margin: 0; }
.join-state { display: flex; align-items: center; gap: .65rem; }
.connection-spinner {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  border: 2px solid #cbdaf7;
  border-top-color: #2759c7;
  border-radius: 50%;
  animation: connection-spin .8s linear infinite;
}
@keyframes connection-spin { to { transform: rotate(360deg); } }
#status { color: #405772; margin: .35rem 0 0; }
#application, #view-site { margin-top: 1.25rem; }
label { display: block; font-weight: 650; font-size: .9rem; }
input, button { font: inherit; }
input {
  display: block;
  width: 100%;
  margin: .3rem 0 .9rem;
  padding: .62rem .75rem;
  border: 1px solid #bacbe2;
  border-radius: .6rem;
  background: #fbfdff;
  color: inherit;
}
#room-code { letter-spacing: .085em; }
button {
  width: 100%;
  border: 0;
  border-radius: .65rem;
  padding: .7rem .9rem;
  background: #2759c7;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
button:disabled { opacity: .65; cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid #2759c7; outline-offset: 3px; }
[hidden] { display: none !important; }
#site-preview {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  border: 0;
  opacity: 0;
  pointer-events: none;
  background: #fff;
  transition: opacity 220ms ease;
}
body.viewing .join-shell { opacity: 0; transform: translateY(-.4rem); visibility: hidden; transition-delay: 0s, 0s, 200ms; }
body.viewing #site-preview { opacity: 1; pointer-events: auto; transition-delay: 170ms; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.control-shell .join-card { margin-top: 1.25rem; }
#requests { margin-top: 1rem; }
#applicants { list-style: none; padding: 0; }
#applicants li { background: #eff3f9; border-radius: .65rem; margin-block: .5rem; padding: .7rem; overflow-wrap: anywhere; }
#applicants .decision { display: flex; gap: .5rem; margin-top: .45rem; }
#applicants .decision button:last-child, #disconnect { background: #e1ebff; color: #23458e; }
#disconnect { margin-top: .5rem; }
 .verification-code { margin: 16px 0; padding: 16px; border-radius: 12px; background: #eef3fa; color: #1d293a; font: 700 24px ui-monospace, monospace; }
