:root {
  color-scheme: light;
  --ink: #17252e;
  --muted: #596a74;
  --subtle: #77858d;
  --line: #d8e0e4;
  --surface: #ffffff;
  --canvas: #f3f6f8;
  --canvas-accent: #e8f1ef;
  --brand: #0d6b5e;
  --brand-strong: #09584e;
  --brand-soft: #e7f3f0;
  --danger: #a92f35;
  --danger-soft: #fff0f0;
  --warning: #8a5b00;
  --warning-soft: #fff7df;
  --shadow: 0 22px 60px rgba(27, 51, 61, 0.11);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(13, 107, 94, 0.08), transparent 30rem),
    radial-gradient(circle at 92% 82%, rgba(58, 116, 133, 0.07), transparent 28rem),
    var(--canvas);
}

button,
input {
  font: inherit;
}

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

.page-shell {
  width: min(100% - 32px, 1120px);
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.platform-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 10px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: var(--brand);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand > span:last-child {
  display: grid;
  line-height: 1.05;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.secure-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.secure-label svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.setup-card {
  align-self: center;
  width: min(100%, 560px);
  margin: 32px auto;
  overflow: hidden;
  border: 1px solid rgba(204, 216, 221, 0.95);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.state-panel {
  padding: 44px 46px 46px;
}

.loading-panel {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.spinner {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 3px solid var(--brand-soft);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 1.8s; }
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.supporting-copy {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.invitation-context {
  margin: 28px 0;
  padding: 17px 18px;
  border: 1px solid #d7e8e4;
  border-radius: 14px;
  background: var(--brand-soft);
}

.invitation-context__header > span:first-child,
.invited-email dt {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.invitation-context__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.verified-cue {
  flex: 0 0 auto;
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.invitation-context strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.4;
}

.invited-email {
  margin: 0 0 24px;
}

.invited-email,
.invited-email div,
.invited-email dd {
  padding: 0;
}

.invited-email dd {
  display: block;
  margin-top: 5px;
  margin-left: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 700;
}

.field-group + .field-group {
  margin-top: 19px;
}

label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
}

.password-control {
  position: relative;
}

input {
  width: 100%;
  min-height: 50px;
  padding: 12px 58px 12px 14px;
  border: 1px solid #aebcc3;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:hover {
  border-color: #82969f;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(36, 132, 178, 0.35);
  outline-offset: 2px;
}

input:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 107, 94, 0.12);
  outline: none;
}

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

.visibility-toggle {
  position: absolute;
  inset: 4px 5px 4px auto;
  min-width: 48px;
  border: 0;
  border-radius: 8px;
  color: var(--brand-strong);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.field-help,
.field-error {
  margin: 7px 2px 0;
  font-size: 13px;
  line-height: 1.45;
}

.field-help { color: var(--subtle); }
.field-error { color: var(--danger); font-weight: 650; }
.field-error:empty { display: none; }

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 50px;
  margin-top: 27px;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 750;
}

.primary-button {
  border: 1px solid var(--brand);
  color: #fff;
  background: var(--brand);
  box-shadow: 0 7px 16px rgba(13, 107, 94, 0.18);
}

.primary-button:hover { background: var(--brand-strong); }
.primary-button:disabled { cursor: wait; opacity: 0.7; }

.secondary-button {
  border: 1px solid #bcc9ce;
  color: var(--ink);
  background: #fff;
}

.form-error {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid #efc6c8;
  border-radius: 10px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 14px;
  line-height: 1.5;
}

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

.status-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 24px;
  font-weight: 800;
}

.status-icon.success {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.status-icon.error {
  color: var(--danger);
  background: var(--danger-soft);
}

.status-icon.warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.activation-notice {
  margin-top: 26px;
  padding: 17px 18px;
  border-left: 3px solid var(--brand);
  border-radius: 3px 10px 10px 3px;
  background: #f5f8f8;
}

.activation-notice strong {
  display: block;
  margin-bottom: 5px;
}

.activation-notice p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.completion-sequence {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.completion-sequence li {
  position: relative;
  min-height: 42px;
  padding: 2px 0 17px 42px;
}

.completion-sequence li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 29px;
  bottom: 3px;
  left: 14px;
  width: 1px;
  background: var(--line);
}

.sequence-number {
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #b9c8ce;
  border-radius: 50%;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.completion-sequence li.is-complete .sequence-number {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.completion-sequence strong {
  display: block;
  font-size: 14px;
  line-height: 1.4;
}

.sequence-label {
  display: block;
  margin-bottom: 2px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.page-footer {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--subtle);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 600px) {
  .page-shell { width: min(100% - 24px, 560px); }
  .platform-header { min-height: 76px; }
  .secure-label { display: none; }
  .setup-card { margin: 18px auto 24px; border-radius: 17px; }
  .state-panel { padding: 32px 24px 34px; }
  .loading-panel { min-height: 280px; align-items: flex-start; flex-direction: column; }
  .page-footer { min-height: 64px; flex-direction: column; gap: 2px; line-height: 1.35; }
  .page-footer span[aria-hidden] { display: none; }
  .invitation-context__header { align-items: flex-start; flex-direction: column; gap: 4px; }
}

@media (max-width: 370px) {
  .page-shell { width: min(100% - 16px, 560px); }
  .state-panel { padding-inline: 20px; }
}
