/* One screen, one hand, one job.
   No web fonts and no external requests: this page loads on congested venue
   wifi or it does not get used. Character comes from treatment, not downloads. */

:root {
  --ink:    #12201C;   /* deep green-black */
  --paper:  #F2F4F0;   /* sage-tinted off-white */
  --card:   #FFFFFF;
  --moss:   #2F6F52;   /* actions */
  --moss-d: #24573F;
  --mute:   #6B7A72;
  --rule:   #DCE3DC;
  --alert:  #A3341F;

  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gap: 1.15rem;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1.5rem, env(safe-area-inset-bottom));
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

.card {
  width: 100%;
  max-width: 26rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.6rem 1.35rem 1.35rem;
  box-shadow: 0 1px 2px rgba(18, 32, 28, .04), 0 12px 32px -18px rgba(18, 32, 28, .3);
}

@media (prefers-reduced-motion: no-preference) {
  .card { animation: rise .45s cubic-bezier(.2, .7, .3, 1) both; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
  }
}

/* --- badge line -----------------------------------------------------------
   The signature element: the active event, set the way an event is printed on
   a conference badge. It is also the one piece of state this whole app exists
   to change, so it earns the most distinctive treatment on the page. */

.badge {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: 1.4rem;
}

.badge::before,
.badge::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.badge span {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--moss);
  text-align: center;
}

/* --- type ----------------------------------------------------------------- */

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 7.5vw, 2.1rem);
  line-height: 1.12;
  letter-spacing: -.015em;
  margin: 0 0 .5rem;
}

.lede {
  margin: 0 0 1.5rem;
  color: var(--mute);
  font-size: .95rem;
}

.note {
  margin: 1.15rem 0 0;
  font-size: .78rem;
  line-height: 1.45;
  color: var(--mute);
}

/* --- fields --------------------------------------------------------------- */

.field { margin-bottom: var(--gap); }

label {
  display: block;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: .35rem;
}

input, select {
  width: 100%;
  font: inherit;
  font-size: 1rem;               /* 16px minimum or iOS zooms the page on focus */
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: .7rem .8rem;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7A72' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: .7rem;
  padding-right: 2.1rem;
  text-overflow: ellipsis;   /* country names are longer than this field */
}

input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 2px;
}

input::placeholder { color: #A9B5AE; }

.phone-row {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: .5rem;
}

/* Grid items default to min-width:auto, so the country select's longest option
   ("Saint Vincent and the Grenadines…") sets an intrinsic floor and pushes the
   whole card past the viewport. This is the fix, and it is load-bearing. */
.phone-row > * { min-width: 0; }

.error-text {
  display: block;
  margin-top: .3rem;
  font-size: .8rem;
  color: var(--alert);
}

.field.invalid input,
.field.invalid select { border-color: var(--alert); }

/* --- channel choice ------------------------------------------------------- */

.channels {
  display: grid;
  gap: .55rem;
  /* Carries the separation the removed "Where should we continue?" label used to
     provide. Without it the button crowds the phone row and stops reading as the
     next step. */
  margin-top: 1.5rem;
}

.channel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: 10px;
  padding: .85rem 1rem;
  cursor: pointer;
  transition: background .15s, color .15s;
}

/* Text and logo read as one phrase — "Let's connect on <logo>" — so they group on
   the left while the arrow stays pinned right by the button's space-between. */
.channel-label {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

/* Optically centred against lowercase text rather than the line box. */
.glyph {
  flex: none;
  display: block;
  margin-top: -1px;
}

/* The envelope is drawn in currentColor, so it has to invert with the button on
   hover. The brand marks are fixed colours and stay as they are. */
.channel:hover .glyph,
.channel:active .glyph {
  color: var(--paper);
}

.channel::after {
  content: "→";
  font-weight: 400;
  color: var(--mute);
  transition: transform .15s, color .15s;
}

.channel:hover,
.channel:active {
  background: var(--ink);
  color: var(--paper);
}

.channel:hover::after,
.channel:active::after {
  color: var(--paper);
  transform: translateX(3px);
}

/* --- handoff -------------------------------------------------------------- */

.preview {
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.5;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--moss);
  border-radius: 8px;
  padding: .9rem 1rem;
  margin: 0 0 1.35rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.go {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: #FFF;
  background: var(--moss);
  border: 1px solid var(--moss);
  border-radius: 10px;
  padding: .95rem 1rem;
  cursor: pointer;
  transition: background .15s;
}

.go:hover, .go:active { background: var(--moss-d); }

.go.secondary {
  color: var(--ink);
  background: var(--card);
  border-color: var(--ink);
  margin-top: .55rem;
}

.go.secondary:hover, .go.secondary:active { background: var(--paper); }

.go.done {
  background: var(--card);
  border-color: var(--moss);
  color: var(--moss);
}

.step {
  display: flex;
  align-items: baseline;
  gap: .55rem;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 1.25rem 0 .5rem;
}

.step:first-of-type { margin-top: 0; }

.step b {
  font-variant-numeric: tabular-nums;
  color: var(--moss);
}

.back {
  display: inline-block;
  margin-top: 1.15rem;
  font-size: .82rem;
  color: var(--mute);
}
