/* Sign-up (join/): one calm card at a time. */

.join-page {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 100% -10%, var(--pink-soft), transparent 70%),
    radial-gradient(700px 400px at -10% 110%, var(--surface-2), transparent 70%),
    var(--bg);
}

.join {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 100px 16px 60px;
}

.panel {
  padding: 34px 30px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: rise 0.5s var(--ease);
}

.panel[hidden] {
  display: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.panel h1 {
  font-size: 28px;
  font-weight: 700;
}

.panel .sub {
  margin-top: 6px;
  color: var(--muted);
}

@media (max-width: 480px) {
  .join {
    padding-top: 84px;
  }

  .panel {
    padding: 26px 18px;
    border-radius: 24px;
  }
}

/* progress dots */
.progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.progress li {
  width: 26px;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  transition: background 0.3s, width 0.3s var(--ease);
}

.progress li.done {
  background: var(--pink);
}

.progress li.now {
  width: 44px;
  background: var(--accent);
}

/* ------------------------------------------------------------- inputs */

.field {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
}

.field em {
  color: var(--muted);
  font-style: normal;
  font-weight: 400;
}

.field input,
.field select,
.with-prefix {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  color: var(--text);
  font: 400 16px var(--font);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field select:focus,
.with-prefix:focus-within {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
}

.with-prefix {
  display: flex;
  align-items: center;
  gap: 10px;
}

.with-prefix > span {
  color: var(--muted);
  font-weight: 500;
}

.with-prefix input {
  flex: 1;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none !important;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

@media (max-width: 420px) {
  .two {
    grid-template-columns: 1fr;
  }
}

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 20px;
  font-size: 15px;
  cursor: pointer;
}

.check input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  flex: none;
  accent-color: var(--accent);
}

form .btn.block,
.panel > .btn.block {
  margin-top: 22px;
}

.link {
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: 500 15px var(--font);
  cursor: pointer;
}

.link[disabled] {
  color: var(--muted);
  cursor: default;
}

.link.center,
.fine.center {
  display: block;
  margin: 16px auto 0;
  text-align: center;
}

.row-links {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.alert {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
  font-size: 14px;
}

.alert[hidden] {
  display: none;
}

.fine {
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
}

.unavailable {
  margin-top: 20px;
  color: var(--muted);
}

.nav-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.nav-row .btn {
  flex: 1;
}

/* ---------------------------------------------------- sign-in options */

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 24px;
  padding: 5px;
  border-radius: 18px;
  background: var(--surface-2);
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label > span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}

.segmented input:checked + span {
  background: var(--surface);
  color: var(--accent-text);
  box-shadow: 0 6px 16px -10px rgba(120, 10, 70, 0.5);
}

.segmented input:focus-visible + span {
  outline: 3px solid var(--accent);
}

.btn.google {
  margin-top: 22px;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--line);
  box-shadow: none;
}

.or {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 2px;
  color: var(--muted);
  font-size: 13px;
}

.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ------------------------------------------------------------- photos */

.avatar-pick {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 22px;
}

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  padding: 0;
  border: 2px dashed var(--pink);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent);
  cursor: pointer;
  overflow: hidden;
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar .icon {
  font-size: 30px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.tiles.three {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 420px) {
  .tiles.three {
    grid-template-columns: 1fr 1fr;
  }
}

.tile button {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 8px;
  border: 1.5px dashed var(--pink);
  border-radius: 16px;
  background: var(--bg-soft);
  color: var(--text);
  font: 500 13px var(--font);
  text-align: center;
  cursor: pointer;
  overflow: hidden;
}

.tile button .icon {
  color: var(--accent);
}

.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile .state {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tile.done button {
  border-style: solid;
  border-color: var(--success);
}

.tile.done .state {
  color: var(--success);
}

.tile.error button {
  border-color: var(--danger);
}

.tile.busy button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.tile.busy .state {
  z-index: 1;
}

.tile.busy .state .icon {
  animation: spin 1s linear infinite;
}

/* ------------------------------------------------------------ choices */

.choices {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.choice,
.type {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  font: 400 15px var(--font);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s var(--ease), background 0.2s;
}

.choice:hover,
.type:hover {
  border-color: var(--pink);
  transform: translateY(-1px);
}

.choice[aria-pressed="true"],
.type[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--bg-soft);
}

.choice .icon,
.type .icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 26px;
}

.choice b {
  display: block;
  font-size: 17px;
}

.choice small {
  color: var(--muted);
}

.types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.type {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.type small {
  margin-top: -8px;
  color: var(--muted);
}

/* ------------------------------------------------------------ review */

.summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 18px;
  margin: 22px 0 0;
  font-size: 15px;
}

.summary dt {
  color: var(--muted);
}

.summary dd {
  margin: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.note,
.app-cta {
  display: flex;
  gap: 14px;
  margin-top: 22px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface-2);
  font-size: 14px;
}

.note .icon,
.app-cta .icon {
  color: var(--accent);
}

/* ------------------------------------------------------------- status */

.panel.wide {
  padding-top: 30px;
}

.me {
  display: flex;
  align-items: center;
  gap: 18px;
}

.me .avatar {
  flex: none;
  width: 76px;
  height: 76px;
  border-style: solid;
  border-color: var(--pink);
}

.me .initials {
  color: var(--accent-text);
  font-size: 26px;
  font-weight: 700;
}

.me .edit {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 16px;
}

.me h1 {
  font-size: 24px;
}

.cards {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.status-card {
  display: flex;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
}

.status-card > .icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--accent);
}

.status-card.good > .icon {
  color: var(--success);
}

.status-card.bad > .icon {
  color: var(--danger);
}

.status-card .body {
  flex: 1;
  min-width: 0;
}

.status-card h2 {
  font-size: 16px;
  font-weight: 600;
}

.status-card p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}

.status-card .btn {
  margin-top: 12px;
}

/* ------------------------------------------------------------ spinner */

#p-loading {
  display: grid;
  place-items: center;
  min-height: 240px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--surface-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn .spin {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
