.signup {
  max-width: 28rem;
  width: 100%;
  padding: 2rem 16px 4rem;
  margin-inline: auto;
  box-sizing: border-box;
}

.signup h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.6rem, 4vw, 2rem);
  color: var(--emerald);
}

.signup .sub {
  margin: 0 0 1.5rem;
}

.signup-recover-hint {
  margin: -0.5rem 0 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--emerald, #0F5C4A) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--emerald, #0F5C4A) 18%, transparent);
  line-height: 1.55;
}

.signup-recover-hint a {
  color: var(--emerald, #0F5C4A);
  font-weight: 600;
}

.signup-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  padding: 0;
  margin: 0 0 1.5rem;
}

.signup-steps li {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  padding-top: 0.5rem;
  border-top: 3px solid var(--border);
}

.signup-steps li.is-on,
.signup-steps li.is-done {
  color: var(--ink);
  border-top-color: var(--emerald);
  font-weight: 600;
}

.signup-panel label,
.signup-panel legend {
  display: block;
  margin: 0.85rem 0 0.35rem;
  font-weight: 600;
}

.signup-panel input[type="tel"],
.signup-panel input[type="email"],
.signup-panel input[type="text"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.signup-panel fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.signup-panel .choice {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 400;
  margin: 0.45rem 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--paper);
  cursor: pointer;
}

.signup-panel .choice:has(input:checked) {
  border-color: var(--emerald);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--emerald) 35%, transparent);
}

.signup-error {
  color: #b42318;
  background: color-mix(in srgb, #b42318 8%, var(--paper));
  border: 1px solid color-mix(in srgb, #b42318 25%, transparent);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  margin: 0 0 1rem;
}

.signup-code {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  padding: 1rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--emerald) 10%, var(--paper));
  border: 1px dashed color-mix(in srgb, var(--emerald) 40%, transparent);
}

.signup .small {
  font-size: 0.9rem;
}

.signup .cta-row {
  margin-top: 1.25rem;
}

.signup-wait {
  margin-top: 1rem;
  font-weight: 600;
  color: var(--emerald);
}

.signup-connected {
  margin-top: 1.25rem;
  padding: 1.35rem 1rem 1.2rem;
  border-radius: 16px;
  text-align: center;
  background: color-mix(in srgb, var(--emerald) 10%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--emerald) 28%, transparent);
  animation: signup-connected-in 0.45s ease-out both;
}

.signup-connected-mark {
  display: flex;
  justify-content: center;
  margin-bottom: 0.65rem;
}

.signup-connected-ring {
  fill: none;
  stroke: var(--emerald);
  stroke-width: 3;
  stroke-dasharray: 180;
  stroke-dashoffset: 180;
  animation: signup-ring 0.55s ease-out 0.05s forwards;
}

.signup-connected-check {
  fill: none;
  stroke: var(--emerald);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: signup-check 0.4s ease-out 0.35s forwards;
}

.signup-connected-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--emerald);
}

@keyframes signup-connected-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes signup-ring {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes signup-check {
  to {
    stroke-dashoffset: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .signup-connected,
  .signup-connected-ring,
  .signup-connected-check {
    animation: none;
  }
  .signup-connected-ring,
  .signup-connected-check {
    stroke-dashoffset: 0;
  }
}

.signup-tg {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--emerald) 6%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--emerald) 22%, transparent);
  text-align: center;
}

.signup-tg-qr {
  display: flex;
  justify-content: center;
  margin: 0.85rem 0;
}

.signup-tg-qr svg {
  display: block;
  width: min(200px, 70vw);
  height: auto;
  border-radius: 12px;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 8%, transparent);
}

.signup-tg-scan {
  margin: 0;
}

.signup-tg-scan a {
  color: var(--emerald);
  font-weight: 600;
}
