:root {
  --login-canvas: #f6f3ed;
  --login-surface: #fcfbf8;
  --login-text: #18221e;
  --login-muted: #65706a;
  --login-primary: #28675b;
  --login-primary-hover: #20554b;
  --login-border: #dddcd5;
  --login-error: #b84e4e;
  --login-font: "Onest", "Inter", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color-scheme: light;
  background: var(--login-canvas);
  color: var(--login-text);
  font-family: var(--login-font);
  -webkit-font-smoothing: antialiased;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--login-canvas);
}

.login-skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--login-text);
  color: var(--login-surface);
  text-decoration: none;
  transform: translateY(calc(-100% - 20px));
}

.login-skip-link:focus {
  transform: translateY(0);
}

.login-header {
  flex: 0 0 auto;
  padding: 20px 24px;
}

.login-logo {
  width: fit-content;
  min-height: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--login-text);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.login-logo__dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--login-primary);
}

.login-main {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
}

.login-card {
  width: 100%;
  max-width: 448px;
  padding: 32px;
  border: 1px solid var(--login-border);
  border-radius: 20px;
  background: var(--login-surface);
  box-shadow: 0 1px 2px rgb(24 34 30 / 5%);
}

.login-card h1 {
  margin: 0 0 4px;
  color: var(--login-text);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.33;
  letter-spacing: -0.025em;
}

.login-card__intro {
  margin: 0 0 32px;
  color: var(--login-muted);
  font-size: 16px;
  line-height: 1.5;
}

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

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field label {
  color: var(--login-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.login-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--login-border);
  border-radius: 10px;
  outline: 2px solid transparent;
  outline-offset: 0;
  background: var(--login-surface);
  color: var(--login-text);
  font-size: 16px;
  line-height: 1.5;
  transition: border-color 150ms ease, outline-color 150ms ease;
}

.login-field input::placeholder {
  color: var(--login-muted);
  opacity: 1;
}

.login-field input:focus {
  border-color: transparent;
  outline-color: var(--login-primary);
}

.login-field--error input {
  border-color: var(--login-error);
}

.login-field--error input:focus {
  border-color: transparent;
  outline-color: var(--login-error);
}

.login-password {
  position: relative;
}

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

.login-password__toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--login-muted);
  cursor: pointer;
  transform: translateY(-50%);
  transition: color 150ms ease;
}

.login-password__toggle:hover {
  color: var(--login-text);
}

.login-forgot {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.login-forgot button,
.login-actions a {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--login-primary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.login-forgot button:hover,
.login-actions a:hover {
  text-decoration: underline;
}

.login-error {
  margin: 0;
  color: var(--login-error);
  font-size: 14px;
  line-height: 1.45;
}

.login-error p {
  margin: 0;
}

.login-error--summary:empty {
  display: none;
}

.login-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.login-submit {
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--login-primary);
  color: white;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, opacity 150ms ease;
}

.login-submit:hover {
  background: var(--login-primary-hover);
}

.login-submit:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.login-actions p {
  margin: 8px 0 0;
  color: var(--login-muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.login-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-page--modal-open {
  overflow: hidden;
}

.login-modal {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.login-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 30%);
  backdrop-filter: blur(2px);
}

.login-modal__panel {
  position: relative;
  width: 100%;
  max-width: 384px;
  padding: 32px;
  border: 1px solid var(--login-border);
  border-radius: 20px;
  background: var(--login-surface);
  box-shadow: 0 20px 25px -5px rgb(24 34 30 / 16%), 0 8px 10px -6px rgb(24 34 30 / 12%);
  animation: login-modal-enter 200ms ease-out;
}

.login-modal__close {
  position: absolute;
  z-index: 1;
  top: 2px;
  right: 2px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--login-muted);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.login-modal__close:hover {
  background: #eeece6;
  color: var(--login-text);
}

.login-modal__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 24px;
  margin-bottom: 20px;
}

.login-modal__icon,
.login-modal__success-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgb(40 103 91 / 10%);
  color: var(--login-primary);
}

.login-modal__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.login-modal__icon .login-icon {
  width: 20px;
  height: 20px;
}

.login-modal h2 {
  margin: 0;
  color: var(--login-text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.015em;
}

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

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

.login-reset-form__error {
  margin-top: -8px;
}

.login-modal__actions {
  display: flex;
  gap: 12px;
  padding-top: 4px;
}

.login-modal__cancel,
.login-modal__submit {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.login-modal__actions > * {
  flex: 1 1 0;
}

.login-modal__cancel {
  border: 1px solid var(--login-border);
  background: var(--login-surface);
  color: var(--login-muted);
}

.login-modal__cancel:hover {
  background: #eeece6;
}

.login-modal__submit {
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--login-primary);
  color: white;
}

.login-modal__submit:hover {
  background: var(--login-primary-hover);
}

.login-modal__submit:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.login-modal__success {
  padding: 16px 0 0;
  text-align: center;
}

.login-modal__success-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  border-radius: 50%;
}

.login-modal__success-icon .login-icon {
  width: 28px;
  height: 28px;
}

.login-modal__success-icon--error {
  background: rgb(180 55 55 / 10%);
  color: var(--login-error);
}

.login-modal__success h2 {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.4;
}

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

.login-modal__success strong {
  color: var(--login-text);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.login-modal__success .login-modal__submit {
  width: 100%;
  text-decoration: none;
}

.login-modal__success .login-modal__actions {
  width: 100%;
}

@keyframes login-modal-enter {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

:focus-visible {
  outline: 2px solid var(--login-primary);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 639px) {
  .login-main {
    padding-top: 32px;
  }
}

@media (max-width: 420px) {
  .login-header {
    padding-inline: 20px;
  }

  .login-card {
    padding: 28px 24px;
  }

  .login-modal__panel {
    padding: 28px 24px 24px;
  }

}

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