:root {
  --brand: #1f5eff;
  --brand-dark: #1546c4;
  --brand-soft: #edf3ff;
  --ink: #181a1f;
  --muted: #696f79;
  --line: #dfe2e7;
  --surface: #ffffff;
  --canvas: #f4f5f7;
  --success: #16835b;
  --success-soft: #e9f8f2;
  --danger: #c52d38;
  --danger-soft: #fff0f1;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(31, 94, 255, 0.09), transparent 26rem),
    var(--canvas);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.login-card {
  width: 440px;
  max-width: 100%;
  padding: 36px 38px 26px;
  border: 1px solid rgba(26, 29, 34, 0.08);
  border-radius: 22px;
  background: var(--surface);
  box-shadow:
    0 24px 60px rgba(26, 29, 34, 0.1),
    0 5px 16px rgba(26, 29, 34, 0.04);
}

.login-card::before {
  width: 42px;
  height: 4px;
  display: block;
  margin-bottom: 26px;
  border-radius: 999px;
  content: "";
  background: var(--brand);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 12px;
  color: #ffffff;
  border: 1px solid #dce6fb;
  background: #ffffff;
  box-shadow: 0 7px 14px rgba(31, 94, 255, 0.14);
}

.brand__icon img {
  width: 25px;
  height: 25px;
  display: block;
  object-fit: contain;
}

.brand__text {
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.brand__badge {
  margin-left: auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-heading {
  margin: 32px 0 27px;
}

.login-heading h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.login-heading p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 19px;
}

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

.field-group label {
  color: #34383f;
  font-size: 13px;
  font-weight: 750;
}

.input-shell {
  position: relative;
}

.input-shell__icon {
  position: absolute;
  top: 50%;
  left: 15px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9298a2;
  pointer-events: none;
  transform: translateY(-50%);
}

.input-shell__icon svg,
.password-toggle svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-shell input {
  width: 100%;
  height: 51px;
  padding: 0 48px 0 45px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  color: var(--ink);
  background: #fbfbfc;
  font-size: 14px;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease;
}

.input-shell input::placeholder {
  color: #a3a8b1;
}

.input-shell input:hover {
  border-color: #c8ccd2;
  background: #ffffff;
}

.input-shell input:focus {
  border-color: var(--brand);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.12);
}

.input-shell:focus-within .input-shell__icon {
  color: var(--brand);
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: #858b95;
  background: transparent;
  transform: translateY(-50%);
}

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

.password-toggle:focus-visible,
.toast__close:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.password-toggle__hide {
  display: none;
}

.password-toggle[aria-pressed="true"] .password-toggle__show {
  display: none;
}

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

.submit-button {
  min-height: 51px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 3px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 10px 20px rgba(31, 94, 255, 0.2);
  font-size: 14px;
  font-weight: 800;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    filter 150ms ease;
}

.submit-button__arrow {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.submit-button:hover:not(:disabled) {
  filter: brightness(1.04);
  box-shadow: 0 13px 24px rgba(31, 94, 255, 0.25);
  transform: translateY(-1px);
}

.submit-button:active:not(:disabled) {
  transform: translateY(1px);
}

.submit-button:focus-visible {
  outline: 3px solid rgba(31, 94, 255, 0.16);
  outline-offset: 3px;
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.78;
}

.submit-button.is-loading .submit-button__spinner {
  display: block;
}

.submit-button.is-loading .submit-button__arrow {
  display: none;
}

.security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 20px;
  color: #858b95;
  font-size: 11px;
}

.security-note svg {
  width: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-footer {
  margin-top: 27px;
  padding-top: 21px;
  border-top: 1px solid #eceef1;
  text-align: center;
}

.login-footer > img {
  width: 168px;
  height: 34px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
  opacity: 0.82;
}

.login-footer p {
  margin: 15px 0 0;
  color: #a0a5ad;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.toast-region {
  position: fixed;
  z-index: 1000;
  top: 22px;
  right: 22px;
  width: min(380px, calc(100% - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(24, 26, 31, 0.08);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(24, 26, 31, 0.16);
  opacity: 0;
  pointer-events: auto;
  transform: translateY(-14px);
  visibility: hidden;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    visibility 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.toast__icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 10px;
}

.toast__icon svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast__content {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  padding-top: 1px;
}

.toast__content strong {
  font-size: 13px;
}

.toast__content > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.toast__close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #8c929b;
  background: transparent;
}

.toast__close:hover {
  background: #f2f3f5;
}

.toast__close svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.toast--success .toast__icon {
  color: var(--success);
  background: var(--success-soft);
}

.toast--error .toast__icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.toast__error-icon,
.toast--error .toast__success-icon {
  display: none;
}

.toast--error .toast__error-icon {
  display: block;
}

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

@media (max-width: 520px) {
  .login-page {
    align-items: flex-start;
    padding: 16px;
  }

  .login-card {
    margin: auto 0;
    padding: 28px 22px 22px;
    border-radius: 18px;
  }

  .login-card::before {
    margin-bottom: 22px;
  }

  .login-heading {
    margin: 27px 0 24px;
  }

  .login-heading h1 {
    font-size: 25px;
  }

  .toast-region {
    top: 16px;
    right: 16px;
  }
}

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