:root {
  --panel: #e7ecf2;
  --card: #fbfcfd;
  --border: #dde3ea;
  --ink: #141a22;
  --sub: #5b6774;
  --label: #59646f;
  --legal: #5e6873;
  --field-border: #ccd6e1;
  --accent: #2f4f8f;
  --accent-dark: #233d70;
  --accent-ring: rgba(47, 79, 143, 0.16);
  --error: #a33b3b;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: #eef1f5;
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.shell {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  min-height: 100%;
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  background: var(--card);
}

.form {
  padding: 40px clamp(24px, 4vw, 56px) 48px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.spacer-top {
  flex: 1;
  min-height: 36px;
}

.spacer-bottom {
  flex: 1.3;
  min-height: 36px;
}

.card {
  max-width: 360px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

h1 {
  margin: 0;
  text-align: center;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

label span {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--label);
}

input {
  width: 100%;
  padding: 14px 15px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--field-border);
  border-radius: 8px;
  outline: none;
}

input::placeholder {
  color: #8b97a6;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

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

input[aria-invalid="true"]:focus {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(163, 59, 59, 0.16);
}

.field-error {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--error);
}

.field-error:empty {
  display: none;
}

button[type="submit"] {
  margin-top: 6px;
  width: 100%;
  padding: 15px 20px;
  font: inherit;
  font-weight: 600;
  font-size: 15.5px;
  color: var(--card);
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

button[type="submit"]:hover {
  background: var(--accent-dark);
}

button[type="submit"]:focus {
  outline: none;
}

button[type="submit"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.legal {
  margin: 0;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--legal);
}

.legal a {
  color: var(--legal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal a:hover {
  color: var(--accent);
}

.success {
  display: none;
  margin: 0;
  text-align: center;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}

.success.is-visible {
  display: block;
}

.signup-form.is-success .fields {
  display: none;
}

.panel {
  position: relative;
  background: var(--panel);
  padding: 46px clamp(24px, 4vw, 56px) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

.panel-copy {
  max-width: 540px;
  width: 100%;
  position: relative;
  z-index: 2;
}

h2 {
  margin: 0;
  font-size: 39px;
  font-weight: 600;
  letter-spacing: -0.032em;
  line-height: 1.08;
  text-wrap: pretty;
}

.panel-copy p {
  margin: 16px 0 0;
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--sub);
  max-width: 500px;
  text-wrap: pretty;
}

.panel-spacer {
  flex: 1;
  min-height: 20px;
}

.figure {
  width: min(100%, 430px);
  position: relative;
  z-index: 1;
}

.figure svg {
  display: block;
  max-height: 520px;
  margin-bottom: -2px;
}

/* Minimal stub pages */
.stub {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 16px;
}

.stub h1 {
  font-size: 28px;
}

.stub p {
  margin: 0;
  max-width: 420px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--sub);
}

.stub a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.success.is-error {
  color: var(--error);
  border-color: rgba(163, 59, 59, 0.35);
  background: rgba(163, 59, 59, 0.06);
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

