:root {
  --bg: #0b0d10;
  --panel: #13161b;
  --panel-2: #1a1f26;
  --text: #f5f7fa;
  --muted: #9aa4b2;
  --line: #2a313b;
  --accent: #ffffff;
  --success: #49c27f;
  --danger: #ff6b6b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at top left, #1c2230 0, transparent 36%),
    radial-gradient(circle at bottom right, #151b26 0, transparent 32%),
    var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 28px;
}

.signup-card {
  width: 100%;
  max-width: 620px;
  background: rgba(19, 22, 27, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: 34px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 22px;
  background: #ffffff;
  color: #0b0d10;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.32em;
}

.heading {
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.heading > p:last-child,
.state-screen > p {
  color: var(--muted);
  line-height: 1.65;
  margin-top: 14px;
}

.invite-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 15px 17px;
  margin-bottom: 24px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.invite-info span {
  color: var(--muted);
  font-size: 12px;
}

.invite-info strong {
  word-break: break-word;
}

form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.name-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 14px;
  font-weight: 650;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0f1217;
  color: var(--text);
  padding: 14px 15px;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

input:focus {
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.07);
  background: #11151b;
}

.email-field {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0f1217;
  overflow: hidden;
}

.email-field:focus-within {
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.07);
}

.email-field input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.email-field input:focus {
  box-shadow: none;
  background: transparent;
}

.email-field span {
  color: var(--muted);
  padding-right: 15px;
  white-space: nowrap;
  font-size: 14px;
}

small {
  color: var(--muted);
  font-size: 12px;
}

.field-status {
  min-height: 18px;
  font-size: 13px;
}

.field-status.success {
  color: var(--success);
}

.field-status.error {
  color: var(--danger);
}

.form-error {
  padding: 13px 15px;
  border-radius: 13px;
  border: 1px solid rgba(255, 107, 107, 0.25);
  background: rgba(255, 107, 107, 0.08);
  color: #ff9a9a;
  line-height: 1.5;
}

button,
.mail-button {
  border: 0;
  border-radius: 14px;
  padding: 15px 18px;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease,
    background 0.15s ease;
}

button {
  margin-top: 4px;
  background: #ffffff;
  color: #0b0d10;
}

button:hover,
.mail-button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.state-screen {
  text-align: center;
  padding: 36px 8px 18px;
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 18px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  background: rgba(73, 194, 127, 0.14);
  color: var(--success);
  font-size: 28px;
  font-weight: 800;
  border: 1px solid rgba(73, 194, 127, 0.25);
}

.new-email {
  margin: 20px 0;
  padding: 16px 18px;
  border-radius: 15px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 18px;
  font-weight: 750;
  word-break: break-word;
}

.mail-button {
  display: inline-block;
  width: 100%;
  background: #ffffff;
  color: #0b0d10;
}

.hidden {
  display: none !important;
}

footer {
  margin-top: 18px;
  color: #737d8a;
  font-size: 12px;
}

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

@media (max-width: 640px) {
  .page {
    padding: 18px 12px;
    justify-content: flex-start;
  }

  .signup-card {
    padding: 24px 18px;
    border-radius: 22px;
    margin-top: 10px;
  }

  .name-grid {
    grid-template-columns: 1fr;
  }

  .email-field {
    align-items: stretch;
    flex-direction: column;
  }

  .email-field span {
    padding: 0 15px 13px;
  }
}
