.auth-card .field-grid {
  gap: 0 12px;
}

.auth-card .field {
  margin-bottom: 8px;
}

.auth-card .field-error {
  min-height: 0;
}

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

.field-link,
.auth-switch a,
.check-row a,
.link-button {
  color: var(--violet-700);
  font-weight: 750;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.18s;
}

.field-link:hover,
.auth-switch a:hover,
.check-row a:hover,
.link-button:hover {
  text-decoration-color: currentColor;
}

.field-link {
  font-size: 11.5px;
}

.forgot-password-row {
  display: flex;
  justify-content: flex-end;
  min-height: 30px;
  margin-top: 2px;
}

.forgot-password-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  color: var(--violet-700);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.forgot-password-link:hover {
  text-decoration: underline;
}

.forgot-password-link:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--violet-600);
  outline-offset: 2px;
}

.field-link:focus-visible,
.auth-switch a:focus-visible,
.check-row a:focus-visible,
.link-button:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--violet-500);
  outline-offset: 2px;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
}

.link-button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.auth-switch {
  font-size: 12px;
}

.password-rules {
  display: grid;
  gap: 5px;
  margin: -2px 0 12px;
  padding: 0;
  list-style: none;
}

.password-rules li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.4;
}

.password-rules i {
  position: relative;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  transition:
    border-color 0.18s,
    background 0.18s;
}

.password-rules li[data-state="met"] {
  color: var(--green-700);
}

.password-rules li[data-state="met"] i {
  border-color: var(--green-500);
  background: var(--green-500);
}

.password-rules li[data-state="met"] i::after {
  position: absolute;
  top: 1px;
  left: 4px;
  width: 3px;
  height: 6px;
  border: solid var(--surface);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  content: "";
}

.password-rules li[data-state="unmet"] i {
  border-color: var(--red-600);
}

.match-note {
  min-height: 16px;
  margin: -2px 0 10px;
  font-size: 11px;
  line-height: 1.4;
}

.match-note[data-state="met"] {
  color: var(--green-700);
}

.match-note[data-state="unmet"] {
  color: var(--red-700);
}

.field .check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 0;
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--violet-600);
  cursor: pointer;
}

.check-field {
  margin: 4px 0 6px;
}

.auth-inline-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: -8px 0 14px;
}

.auth-feedback {
  min-height: 0;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
}

.auth-feedback:empty {
  display: none;
}

.auth-feedback[data-tone="success"] {
  color: var(--green-700);
}

.auth-feedback[data-tone="error"] {
  color: var(--red-700);
}

.auth-result {
  display: grid;
  gap: 12px;
  outline: none;
}

.auth-result[hidden],
.auth-card [hidden] {
  display: none;
}

.auth-result p {
  margin: 0;
  color: var(--ink-600);
  font-size: 13px;
  line-height: 1.6;
}

.auth-result-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--green-700);
  border-radius: 14px;
  background: var(--green-50);
}

.auth-result[data-tone="error"] .auth-result-icon {
  color: var(--red-700);
  background: var(--red-50);
}

.auth-result-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.auth-result-actions {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.auth-result-actions:empty {
  display: none;
}

.auth-card h2:focus {
  outline: none;
}

.auth-spinner {
  display: flex;
  min-height: 48px;
  align-items: center;
  color: var(--violet-700);
}

.auth-spinner .button-spinner {
  width: 24px;
  height: 24px;
  border-width: 3px;
}

.invite-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 16px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 12px;
}

.invite-summary span {
  color: var(--ink-500);
}

.invite-summary strong {
  min-width: 0;
  color: var(--ink-900);
  overflow-wrap: anywhere;
}

@media (max-width: 479px) {
  .auth-card .field-grid {
    grid-template-columns: 1fr;
  }

  .invite-summary {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .invite-summary strong {
    margin-bottom: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .password-rules i,
  .field-link,
  .link-button {
    transition: none;
  }
}

.auth-result {
  grid-template-columns: minmax(0, 1fr);
}

.auth-result p,
.auth-card .form-intro,
.auth-card h1,
.auth-card h2,
.login-card .form-intro,
.login-card h1,
.login-card h2 {
  overflow-wrap: anywhere;
}

.auth-card h1:focus {
  outline: none;
}

.auth-card .password-toggle,
.login-card .password-toggle {
  min-height: 44px;
}

.auth-card .button,
.login-card .button {
  min-height: 45px;
  font-size: var(--button-font-size);
}

.auth-card .field .check-row {
  padding-block: 13px;
}

.auth-card .check-row a {
  padding-block: 3px;
}

.auth-card .field-link,
.login-card .field-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-block: -14px;
  font-size: 12px;
}

.auth-card .auth-switch a,
.login-card .auth-switch a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-block: -14px;
  text-decoration-color: currentColor;
}

.auth-card .link-button,
.login-card .link-button {
  min-height: 44px;
  margin-block: -14px;
}

.auth-card .field-error,
.login-card .field-error,
.auth-card .password-rules li,
.auth-card .match-note,
.auth-card .form-alert,
.login-card .form-alert,
.auth-card .support-note,
.login-card .support-note,
.auth-card .auth-feedback,
.login-card .auth-feedback {
  font-size: 12px;
}

.auth-card .form-intro,
.login-card .form-intro {
  font-size: 14px;
}

.login-layout .login-panel {
  padding-left: max(clamp(22px, 5vw, 80px), env(safe-area-inset-left));
  padding-right: max(clamp(22px, 5vw, 80px), env(safe-area-inset-right));
}

.match-note:empty {
  min-height: 0;
  margin: 0;
}

.invite-summary strong:last-child {
  margin-bottom: 0;
}

.check-row a,
.auth-card .form-intro a,
.login-card .form-intro a,
.auth-result p a {
  color: var(--violet-700);
  font-weight: 750;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
}

.auth-card input::placeholder,
.login-card input::placeholder {
  color: var(--ink-500);
}

.story-copy .story-title {
  max-width: none;
  margin-top: 0;
  margin-bottom: 22px;
  color: inherit;
  font-family: var(--font-display);
  font-size: clamp(38px, 4.6vw, 66px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.07;
}

.login-card h1 {
  margin-bottom: 8px;
  font-size: clamp(27px, 3vw, 36px);
}

@media (max-width: 920px) {
  .story-copy .story-title {
    font-size: 38px;
  }
}

@media (min-width: 768px) and (max-height: 700px) {
  .story-copy .story-title {
    margin-bottom: 14px;
    font-size: clamp(34px, 4vw, 48px);
  }
}

@media (max-width: 479px) {
  .login-card h1 {
    font-size: 27px;
  }

  .login-layout .login-panel {
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
  }
}

@media (max-width: 767px) and (max-height: 640px) {
  .login-card h1 {
    margin-bottom: 5px;
  }
}

@media (forced-colors: active) {
  .password-rules i {
    border-color: ButtonText;
  }

  .password-rules li[data-state="met"] i {
    border-color: Highlight;
    background: Highlight;
    forced-color-adjust: none;
  }

  .password-rules li[data-state="met"] i::after {
    border-color: HighlightText;
  }

  .auth-card .password-toggle,
  .login-card .password-toggle {
    border: 1px solid ButtonText;
    color: ButtonText;
  }

  .auth-card :focus-visible,
  .login-card :focus-visible {
    outline-color: Highlight;
  }
}
