:root {
  --login-bg: #f3f7f4;
  --login-paper: #ffffff;
  --login-paper-soft: #f8fbf9;
  --login-ink: #132016;
  --login-muted: #5b6a61;
  --login-line: #d4dfd8;
  --login-accent: #2f7b49;
  --login-accent-strong: #245f38;
  --login-shadow: 0 22px 50px rgba(19, 32, 22, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: calc(18px + var(--safe-top)) 16px calc(18px + var(--safe-bottom));
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--login-ink);
  background:
    radial-gradient(1100px 520px at -6% -8%, rgba(47, 123, 73, 0.15), transparent 62%),
    radial-gradient(900px 480px at 100% 20%, rgba(47, 123, 73, 0.11), transparent 60%),
    linear-gradient(180deg, #f9fcfa 0%, var(--login-bg) 100%);
}

.login-shell {
  width: min(980px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-radius: 30px;
  border: 1px solid var(--login-line);
  background: var(--login-paper);
  box-shadow: var(--login-shadow);
  overflow: hidden;
}

.login-aside {
  padding: clamp(24px, 3.5vw, 38px);
  border-right: 1px solid var(--login-line);
  background:
    radial-gradient(520px 320px at 0% 0%, rgba(47, 123, 73, 0.18), transparent 58%),
    linear-gradient(170deg, #f4faf6, #edf5ef);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--login-ink);
}

.login-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.login-brand-name {
  font-family: "Space Grotesk", "Manrope", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
}

.login-brand-sub {
  margin-top: 2px;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--login-muted);
}

.login-aside-title {
  margin: 20px 0 10px;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  letter-spacing: -0.03em;
  font-size: clamp(32px, 4vw, 42px);
  line-height: 0.98;
}

.login-aside-text {
  margin: 0;
  color: #43534a;
  line-height: 1.6;
  font-size: 14px;
  font-weight: 600;
  max-width: 42ch;
}

.login-aside-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.login-aside-list li {
  border: 1px solid var(--login-line);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
  color: #3f5046;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-aside-list li i {
  color: var(--login-accent);
  font-size: 14px;
  flex-shrink: 0;
}

.login-aside-link {
  display: inline-flex;
  margin-top: 14px;
  text-decoration: none;
  color: #245f38;
  font-size: 13px;
  font-weight: 800;
  border-bottom: 1px solid rgba(36, 95, 56, 0.3);
  width: fit-content;
}

.login-aside-link:hover {
  border-bottom-color: rgba(36, 95, 56, 0.65);
}

.login-aside-foot {
  color: #5d6c63;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  font-weight: 700;
}

.login-card {
  padding: clamp(24px, 3.5vw, 38px);
  background: var(--login-paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.login-card-head {
  margin-bottom: 4px;
}

.login-title {
  margin: 0;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: 30px;
  letter-spacing: -0.03em;
  color: #16241a;
}

.login-subtitle {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--login-muted);
}

.login-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #27352d;
  font-weight: 700;
}

.login-input-wrapper {
  position: relative;
  margin-bottom: 14px;
}

.login-input {
  width: 100%;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid #cad8cf;
  background: #ffffff;
  font-size: 14px;
  color: #132016;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-input--with-icon {
  padding-left: 40px;
  padding-right: 40px;
}

.login-input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #66756c;
  font-size: 16px;
  pointer-events: none;
}

.login-password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #66756c;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-password-toggle:hover {
  background: rgba(47, 123, 73, 0.08);
  color: var(--login-accent);
}

.login-password-toggle:active {
  transform: translateY(-50%) scale(0.95);
}

.login-input:focus {
  border-color: rgba(47, 123, 73, 0.65);
  box-shadow: 0 0 0 3px rgba(47, 123, 73, 0.18);
}

.login-input:focus + .login-password-toggle {
  color: var(--login-accent);
}

.login-field {
  margin-top: 2px;
}

.login-button {
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid var(--login-accent-strong);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--login-accent), var(--login-accent-strong));
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(47, 123, 73, 0.24);
}

.login-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-button-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-button-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.spin {
  animation: spin 1s linear infinite;
}

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

.login-error {
  display: none;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid #f0b7b7;
  background: #fff3f3;
  color: #a32020;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
}

.login-error--visible,
.login-error--noscript {
  display: block;
}

.login-field--hidden {
  display: none;
}

.login-hint {
  margin-top: -8px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
  color: #66756c;
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-aside {
    border-right: none;
    border-bottom: 1px solid var(--login-line);
  }
}

@media (max-width: 520px) {
  body {
    padding: calc(12px + var(--safe-top)) 12px calc(12px + var(--safe-bottom));
    align-items: flex-start;
  }

  .login-shell {
    width: 100%;
    border-radius: 20px;
  }

  .login-aside,
  .login-card {
    padding: 18px 16px;
  }

  .login-title {
    font-size: 26px;
  }

  .login-aside-title {
    font-size: 30px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .login-shell {
    animation: login-fade-up 400ms ease both;
  }

  @keyframes login-fade-up {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
