/* Attendee page: the join form and the "you're on the map" confirmation.
   Sized for a phone first -- almost everyone arrives here from a QR code. */

.shell {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  padding-bottom: max(clamp(16px, 4vw, 48px), env(safe-area-inset-bottom));
}

.card {
  width: 100%;
  max-width: 560px;
  background: var(--cream);
  border-radius: 28px;
  padding: clamp(26px, 5vw, 44px);
  box-shadow: 0 24px 60px -28px var(--shadow), 0 0 0 1px var(--ink-hairline);
}
.card.map-card { max-width: 940px; }

.card-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 30px;
}
.card-head.compact { gap: 10px; margin-bottom: 20px; }

.lockup { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.lockup .mark { width: clamp(38px, 6vw, 46px); }
.lockup .wordmark { width: clamp(150px, 26vw, 205px); }
.lockup.small .mark { width: 34px; }

/* ---------- form ---------- */
.form { display: flex; flex-direction: column; gap: 18px; }

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 460px) {
  .row { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 7px; position: relative; }

.field label {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.field input {
  font: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--cream-soft);
  border: 0;
  box-shadow: inset 0 0 0 1px var(--ink-faint);
  border-radius: 14px;
  padding: 14px 16px;
  width: 100%;
  transition: box-shadow .18s ease, background .18s ease;
}
.field input::placeholder { color: rgba(41, 39, 31, .34); font-weight: 400; }
.field input:hover:not(:disabled) { box-shadow: inset 0 0 0 1px rgba(41, 39, 31, .26); }
.field input:focus {
  outline: 0;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--orange);
}
.field input:disabled { opacity: .5; cursor: not-allowed; }
.field input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--orange); }

.field-hint {
  margin: 0;
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-soft);
  min-height: 1.1em;
}

.form-error {
  margin: 0;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--orange);
}

#submitBtn { margin-top: 4px; align-self: flex-start; }
@media (max-width: 460px) {
  #submitBtn { align-self: stretch; text-align: center; }
}

/* ---------- autocomplete ---------- */
.ac-field { z-index: 2; }
.ac-field:focus-within { z-index: 3; }

.ac-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 6px 0 0;
  padding: 6px;
  list-style: none;
  background: var(--cream-soft);
  border-radius: 16px;
  box-shadow: 0 20px 44px -20px var(--shadow), 0 0 0 1px var(--ink-faint);
  max-height: 268px;
  overflow-y: auto;
  z-index: 10;
  -webkit-overflow-scrolling: touch;
}

.ac-option {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 11px 13px;
  border-radius: 11px;
  cursor: pointer;
  line-height: 1.25;
}
.ac-option:hover, .ac-option.is-active { background: var(--sand); }
.ac-option.is-active { box-shadow: inset 0 0 0 2px var(--orange); }

.ac-main { font-weight: 600; font-size: .98rem; }
.ac-detail {
  font-size: .82rem;
  color: var(--ink-soft);
  margin-left: auto;
  text-align: right;
  padding-left: 10px;
}

.ac-empty {
  padding: 12px 13px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* ---------- confirmation map ---------- */
.map-card .map-wrap {
  background: var(--sand-deep);
  border-radius: 18px;
  padding: 12px;
  overflow: hidden;
}
.attendee .world .land { stroke-width: .35; }

/* the viewer's own pin gets a ring so they can pick it out at a glance */
.attendee .pin.is-mine .pin-dot { r: 6; }
.attendee .pin.is-mine .pin-halo {
  opacity: .9;
  animation: minePulse 2.6s ease-out infinite;
}
@keyframes minePulse {
  0%   { opacity: .8; transform: scale(.5); }
  100% { opacity: 0;  transform: scale(4); }
}

.map-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.tally {
  margin: 0;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.tally b { color: var(--ink); }

.boot-error {
  position: fixed;
  inset-inline: 16px;
  bottom: 16px;
  margin: 0;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--cream-soft);
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.45;
  z-index: 50;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .5);
}

@media (prefers-reduced-motion: reduce) {
  .attendee .pin.is-mine .pin-halo { animation: none; opacity: .5; }
}

/* ---------- photo field ---------- */
.field-optional {
  font-weight: 600;
  letter-spacing: .06em;
  color: rgba(41, 39, 31, .42);
  text-transform: none;
}

.photo-row { display: flex; align-items: center; gap: 14px; }

.photo-preview {
  position: relative;
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--cream-soft);
  box-shadow: inset 0 0 0 1px var(--ink-faint);
  display: grid;
  place-items: center;
}
.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-placeholder { color: rgba(41, 39, 31, .34); display: grid; place-items: center; }

.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* The real input is visually hidden, so this label is the button. It has to
   look and focus like one. */
.photo-btn { cursor: pointer; display: inline-block; }
#photo:focus-visible + .photo-btn {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

/* the viewer's own photo, on the confirmation card */
.mine-photo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--orange);
}
