:root {
  color-scheme: light;
  --tree-ink: #10211f;
  --tree-muted: #72777f;
  --tree-border: #d7dcdd;
  --tree-green: #00a87a;
  --tree-green-dark: #008d68;
  --tree-lime: #b9ec35;
  --tree-focus: rgba(0, 168, 122, 0.2);
  --tree-danger: #b42318;
}

* {
  box-sizing: border-box;
}

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

body {
  background: #ffffff;
  color: var(--tree-ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

.login-page {
  display: grid;
  grid-template-columns: minmax(0, 54.2%) minmax(440px, 45.8%);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.login-hero {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  background: #071b1a url("./login-background.png") center / cover no-repeat;
  color: #ffffff;
}

.login-hero__overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 21% 42%, rgba(27, 68, 57, 0.14), transparent 42%),
    linear-gradient(90deg, rgba(4, 22, 21, 0.2), transparent 72%);
  pointer-events: none;
}

.login-hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: clamp(36px, 5vw, 70px) clamp(42px, 5vw, 82px);
}

.login-hero__logo {
  display: block;
  width: clamp(205px, 18vw, 290px);
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.login-hero__message {
  margin: auto 0;
  transform: translateY(-2vh);
}

.login-hero__message h1 {
  max-width: 670px;
  margin: 0;
  font-size: clamp(38px, 4vw, 66px);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.login-hero__message h1 span {
  color: #8edc52;
}

.login-hero__message p {
  max-width: 540px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(17px, 1.35vw, 22px);
  line-height: 1.45;
}

.login-hero__footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 15px;
}

.login-hero__footer span {
  width: 34px;
  height: 2px;
  background: var(--tree-green);
}

.login-panel {
  display: grid;
  min-height: 100%;
  place-items: center;
  overflow-y: auto;
  background:
    radial-gradient(circle at 100% 0, rgba(0, 168, 122, 0.035), transparent 30%),
    #ffffff;
  padding: clamp(32px, 5vw, 72px);
}

.login-card {
  width: min(100%, 520px);
}

.login-panel__logo {
  display: block;
  width: auto;
  max-width: 118px;
  height: 58px;
  margin-bottom: 38px;
  object-fit: contain;
  object-position: left center;
}

.login-card__header h2 {
  margin: 0;
  color: var(--tree-ink);
  font-size: clamp(32px, 3vw, 43px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.login-card__header p {
  margin: 10px 0 0;
  color: var(--tree-muted);
  font-size: 17px;
}

.login-form {
  margin-top: 28px;
}

.form-field + .form-field {
  margin-top: 18px;
}

.form-field label {
  display: inline-block;
  margin-bottom: 9px;
  color: #182220;
  font-size: 15px;
  font-weight: 600;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.input-shell > svg {
  position: absolute;
  left: 18px;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #7f858a;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  pointer-events: none;
}

.input-shell input {
  width: 100%;
  height: 58px;
  border: 1px solid var(--tree-border);
  border-radius: 8px;
  outline: none;
  background: #ffffff;
  color: var(--tree-ink);
  font-size: 16px;
  padding: 0 52px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-shell input::placeholder {
  color: #9a9fa5;
}

.input-shell input:hover {
  border-color: #aeb6b6;
}

.input-shell input:focus {
  border-color: var(--tree-green);
  box-shadow: 0 0 0 4px var(--tree-focus);
}

.input-shell input:user-invalid {
  border-color: #e4a19b;
}

.password-toggle {
  position: absolute;
  right: 10px;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 7px;
  outline: none;
  background: transparent;
  color: #7f858a;
  cursor: pointer;
}

.password-toggle:hover {
  background: #f2f7f5;
  color: var(--tree-green-dark);
}

.password-toggle:focus-visible {
  box-shadow: 0 0 0 3px var(--tree-focus);
}

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

.password-toggle__hide,
.password-toggle.is-visible .password-toggle__show {
  display: none;
}

.password-toggle.is-visible .password-toggle__hide {
  display: block;
}

.login-form__options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  font-size: 14px;
}

.remember-option {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.remember-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--tree-green);
}

.forgot-password-trigger,
.login-support span {
  color: var(--tree-green-dark);
  font-weight: 600;
  text-decoration: none;
}

.forgot-password-trigger {
  padding: 4px 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

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

.forgot-password-trigger:focus-visible {
  border-radius: 3px;
  outline: 3px solid var(--tree-focus);
  outline-offset: 2px;
}

.login-feedback {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--tree-danger);
  font-size: 13px;
  line-height: 1.35;
}

.login-submit,
.sso-button {
  display: flex;
  width: 100%;
  height: 58px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
}

.login-submit {
  border: 1px solid var(--tree-green);
  background: linear-gradient(100deg, #00a97b, #00b383);
  box-shadow: 0 8px 20px rgba(0, 168, 122, 0.13);
  color: #ffffff;
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.login-submit:hover:not(:disabled) {
  background: linear-gradient(100deg, #009a70, #00a87a);
  box-shadow: 0 10px 24px rgba(0, 168, 122, 0.2);
  transform: translateY(-1px);
}

.login-submit:focus-visible,
.sso-button:focus-visible {
  outline: 3px solid var(--tree-focus);
  outline-offset: 2px;
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.82;
}

.login-submit__loading {
  display: none;
  align-items: center;
  gap: 9px;
}

.login-submit[aria-busy="true"] .login-submit__label {
  display: none;
}

.login-submit[aria-busy="true"] .login-submit__loading {
  display: flex;
}

.login-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: login-spin 650ms linear infinite;
}

.login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: #8b9095;
}

.login-divider span {
  height: 1px;
  background: #e1e5e5;
}

.login-divider small {
  font-size: 14px;
}

.sso-button {
  gap: 12px;
  border: 1px solid #9ca4a5;
  background: #ffffff;
  color: #1a2221;
}

.sso-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--tree-green-dark);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sso-button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.login-support {
  margin: 28px 0 0;
  font-size: 14px;
}

.login-links {
  display: flex;
  align-items: center;
  gap: 19px;
  margin-top: 54px;
  color: #80858c;
  font-size: 13px;
  white-space: nowrap;
}

.login-links i {
  font-style: normal;
}

.recovery-modal {
  width: min(calc(100% - 32px), 510px);
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 16px;
  outline: none;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(1, 25, 22, 0.25);
  color: var(--tree-ink);
}

.recovery-modal::backdrop {
  background: rgba(3, 20, 18, 0.66);
  backdrop-filter: blur(4px);
}

.recovery-modal__content {
  position: relative;
  padding: 38px;
}

.recovery-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #72777f;
  cursor: pointer;
}

.recovery-modal__close:hover {
  background: #f1f6f4;
  color: var(--tree-ink);
}

.recovery-modal__close:focus-visible {
  outline: 3px solid var(--tree-focus);
}

.recovery-modal__close svg,
.recovery-modal__icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.recovery-modal__icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 22px;
  place-items: center;
  border-radius: 14px;
  background: #eaf8f4;
  color: var(--tree-green-dark);
}

.recovery-modal__header h2 {
  margin: 0;
  font-size: 27px;
  letter-spacing: -0.025em;
}

.recovery-modal__header p {
  margin: 9px 0 0;
  color: var(--tree-muted);
  font-size: 15px;
  line-height: 1.5;
}

.recovery-form {
  margin-top: 25px;
}

.recovery-feedback {
  min-height: 20px;
  margin: 10px 0 4px;
  color: var(--tree-danger);
  font-size: 13px;
  line-height: 1.4;
}

.recovery-feedback.is-success {
  color: var(--tree-green-dark);
}

.recovery-form__actions {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 12px;
  margin-top: 18px;
}

.recovery-cancel,
.recovery-submit {
  display: flex;
  height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.recovery-cancel {
  border: 1px solid var(--tree-border);
  background: #ffffff;
  color: #52595a;
}

.recovery-submit {
  border: 1px solid var(--tree-green);
  background: var(--tree-green);
  color: #ffffff;
}

.recovery-cancel:hover {
  background: #f5f8f7;
}

.recovery-submit:hover:not(:disabled) {
  background: var(--tree-green-dark);
}

.recovery-cancel:focus-visible,
.recovery-submit:focus-visible {
  outline: 3px solid var(--tree-focus);
  outline-offset: 2px;
}

.recovery-submit:disabled {
  cursor: wait;
  opacity: 0.8;
}

.recovery-submit__loading {
  display: none;
  align-items: center;
  gap: 9px;
}

.recovery-submit[aria-busy="true"] .recovery-submit__label {
  display: none;
}

.recovery-submit[aria-busy="true"] .recovery-submit__loading {
  display: flex;
}

.swal2-popup.tree-auth-alert {
  width: min(calc(100% - 32px), 440px);
  padding: 34px 34px 30px;
  border-radius: 18px;
  box-shadow: 0 26px 80px rgba(3, 30, 26, 0.24);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tree-auth-alert .swal2-icon {
  margin-top: 2px;
  transform: scale(0.86);
}

.tree-auth-alert__title {
  padding-top: 6px;
  color: var(--tree-ink);
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.tree-auth-alert__text {
  margin: 8px 0 0;
  color: var(--tree-muted);
  font-size: 15px;
  line-height: 1.55;
}

.tree-auth-alert__confirm {
  min-width: 172px;
  height: 48px;
  margin-top: 22px;
  padding: 0 24px;
  border: 0;
  border-radius: 8px;
  outline: none;
  background: linear-gradient(100deg, var(--tree-green), #00b383);
  box-shadow: 0 8px 20px rgba(0, 168, 122, 0.18);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.tree-auth-alert__confirm:hover {
  box-shadow: 0 11px 25px rgba(0, 168, 122, 0.25);
  transform: translateY(-1px);
}

.tree-auth-alert__confirm:focus-visible {
  box-shadow: 0 0 0 4px var(--tree-focus);
}

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

@media (max-width: 1050px) {
  .login-page {
    grid-template-columns: minmax(360px, 44%) minmax(420px, 56%);
  }

  .login-hero__content {
    padding: 44px 38px;
  }

  .login-hero__message h1 {
    font-size: clamp(34px, 4.5vw, 52px);
  }

  .login-panel {
    padding: 46px;
  }

  .login-links {
    flex-wrap: wrap;
    row-gap: 10px;
    white-space: normal;
  }
}

@media (max-width: 760px) {
  .login-page {
    display: block;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
    background: #ffffff;
  }

  .login-hero {
    min-height: 150px;
    background-position: 70% 45%;
  }

  .login-hero__content {
    min-height: 150px;
    justify-content: space-between;
    padding: 25px 24px 28px;
  }

  .login-hero__logo {
    width: 176px;
  }

  .login-hero__message,
  .login-hero__footer {
    display: none;
  }

  .login-panel {
    display: block;
    min-height: calc(100vh - 150px);
    min-height: calc(100dvh - 150px);
    padding: 36px 24px 30px;
    overflow: visible;
  }

  .login-card {
    margin: 0 auto;
  }

  .login-panel__logo {
    display: none;
  }

  .login-card__header h2 {
    font-size: 31px;
  }

  .login-card__header p {
    font-size: 16px;
  }

  .login-form {
    margin-top: 26px;
  }

  .input-shell input,
  .login-submit,
  .sso-button {
    height: 56px;
  }

  .login-links {
    justify-content: center;
    margin-top: 38px;
  }
}

@media (max-width: 410px) {
  .login-form__options {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-links {
    gap: 9px;
    font-size: 12px;
  }

  .recovery-modal__content {
    padding: 32px 22px 24px;
  }

  .recovery-form__actions {
    grid-template-columns: 1fr;
  }

  .recovery-cancel {
    order: 2;
  }
}

@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;
  }
}
