:root {
  --ink: #15151a;
  --muted: #73737d;
  --placeholder: #aaaab4;
  --line: #e2e2e8;
  --line-strong: #d4d4dc;
  --background: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #f2f2f5;
  --primary: #0070c0;
  --primary-hover: #005b9b;
  --primary-soft: #e8f3fb;
  --success: #247a55;
  --success-soft: #edf8f3;
  --danger: #c43e48;
  --danger-soft: #fff4f4;
  font-family:
    Inter, "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--background);
}

button,
input {
  font: inherit;
}

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

a {
  color: inherit;
}

.page-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 20px;
  background: var(--background);
  place-items: center;
}

.auth-card {
  width: min(100%, 540px);
  padding: 28px 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 18px 60px rgba(35, 34, 55, 0.06);
}

.invitation-title {
  display: flex;
  justify-content: center;
  margin: -8px 0 16px;
}

.invitation-title img {
  display: block;
  width: min(300px, 72%);
  height: auto;
}

.brand-logo {
  display: block;
  width: 88px;
  height: auto;
  margin: 0 auto 24px;
}

.primary-button:focus-visible {
  outline: 3px solid rgba(0, 112, 192, 0.22);
  outline-offset: 3px;
}

.form-status {
  margin: -8px 0 18px;
  padding: 10px 14px;
  color: var(--success);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.5;
  background: var(--success-soft);
  border: 1px solid #cce9dc;
  border-radius: 12px;
}

.form-status.is-error {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #f1ccd0;
}

.form-status.is-loading {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: #c9e3f6;
}

.form-field {
  margin-bottom: 10px;
}

.form-field label {
  display: block;
  margin-bottom: 5px;
  color: #202025;
  font-size: 13px;
  font-weight: 650;
}

.form-field > input,
.password-field input {
  width: 100%;
  height: 46px;
  padding: 0 15px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.form-field > input::placeholder,
.password-field input::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

.form-field > input:hover,
.password-field input:hover {
  border-color: #bebec9;
}

.form-field > input:focus,
.password-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 112, 192, 0.11);
}

.form-field > input[aria-invalid="true"],
.password-field input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(196, 62, 72, 0.08);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 54px;
}

.password-toggle {
  position: absolute;
  top: 4px;
  right: 5px;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  color: #777782;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 9px;
  place-items: center;
}

.password-toggle:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eye-closed,
.password-toggle[aria-pressed="true"] .eye-open {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
  display: block;
}

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

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

.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  margin-top: 4px;
  padding: 0 24px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 750;
  cursor: pointer;
  background: var(--primary);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(0, 112, 192, 0.24);
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.primary-button:hover {
  background: var(--primary-hover);
  box-shadow: 0 14px 32px rgba(0, 91, 155, 0.28);
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.9;
  transform: none;
}

.button-spinner {
  display: none;
  width: 19px;
  height: 19px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.primary-button.is-loading .button-label {
  display: none;
}

.primary-button.is-loading .button-spinner {
  display: block;
}

.secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  margin-top: 10px;
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  background: #ffffff;
  border: 1px solid var(--primary);
  border-radius: 999px;
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.secondary-button:hover {
  background: var(--primary-soft);
  box-shadow: 0 8px 20px rgba(0, 112, 192, 0.1);
  transform: translateY(-1px);
}

.secondary-button:active {
  transform: translateY(0);
}

.secondary-button:focus-visible {
  outline: 3px solid rgba(0, 112, 192, 0.22);
  outline-offset: 3px;
}

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

@media (max-width: 620px) {
  .page-shell {
    display: block;
    padding: 12px;
  }

  .auth-card {
    width: 100%;
    padding: 24px 22px;
    border-radius: 22px;
  }

  .brand-logo {
    width: 82px;
    margin-bottom: 22px;
  }

  .form-field > input,
  .password-field input {
    height: 46px;
  }

  .primary-button {
    height: 50px;
  }
}

@media (max-width: 380px) {
  .auth-card {
    padding-right: 20px;
    padding-left: 20px;
  }

}

@media (max-height: 720px) and (min-width: 621px) {
  .page-shell {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .auth-card {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .brand-logo {
    width: 76px;
    margin-bottom: 16px;
  }

  .form-field {
    margin-bottom: 7px;
  }

  .form-field > input,
  .password-field input {
    height: 43px;
  }

  .password-toggle {
    top: 2px;
  }

  .primary-button {
    height: 48px;
  }

}

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