:root {
  --ink: #152428;
  --muted: #4d6468;
  --accent: #0a5c5a;
  --accent-deep: #063d3c;
  --accent-soft: #dceceb;
  --border: #c5d6d4;
  --danger: #8b1e1e;
  --danger-bg: #f8e8e8;
  --surface: #ffffff;
  --radius: 8px;
  --font: "DM Sans", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
}

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

body.login-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  /* Show full hero (incl. right icons): contain, not aggressive cover crop. */
  background-color: #cfe8e6;
  background-image:
    linear-gradient(
      105deg,
      rgba(238, 244, 243, 0.9) 0%,
      rgba(238, 244, 243, 0.72) 22%,
      rgba(238, 244, 243, 0.28) 40%,
      transparent 58%
    ),
    url("/assets/login-hero-evoedge.jpg");
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
}

.login-shell {
  max-width: 1100px;
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 1.25rem;
  padding: 1.5rem 1.25rem 2rem;
}

.login-panel {
  width: min(100%, 26.5rem);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.35rem 1.2rem;
  box-shadow: 0 8px 28px rgba(6, 61, 60, 0.12);
  backdrop-filter: blur(6px);
  animation: rise 0.55s ease-out both;
}

.login-brand {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.25rem;
  color: var(--accent-deep);
  line-height: 1.3;
}

.login-brand .brand-home {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.login-brand .brand-home:hover {
  opacity: 0.9;
}

.login-brand .brand-logo {
  display: block;
  height: clamp(3rem, 7.5vw, 3.825rem);
  width: auto;
  max-width: min(21rem, 85vw);
  object-fit: contain;
}

.login-brand .brand-tagline {
  font-family: var(--font);
  font-size: clamp(0.78rem, 2vw, 0.95rem);
  font-weight: 400;
  letter-spacing: 0.055em;
  color: var(--muted);
  opacity: 1;
}

.login-panel h1 {
  margin: 0.35rem 0 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
}

.login-lead {
  margin: 0.55rem 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 36rem;
}

.login-form {
  display: grid;
  gap: 0.75rem;
  max-width: 26rem;
}

.login-field {
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.password-wrap {
  position: relative;
  display: grid;
}

.login-field input {
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.65rem 2.6rem 0.65rem 0.75rem;
  background: #fff;
  width: 100%;
}

.login-field input:focus {
  outline: 2px solid #8cbcb8;
  outline-offset: 1px;
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.toggle-password:hover,
.toggle-password:focus-visible {
  color: var(--accent-deep);
  background: var(--accent-soft);
  outline: none;
}

.toggle-password[aria-pressed='true'] {
  color: var(--accent);
}

.toggle-password .icon-eye {
  display: block;
}

.login-error {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 0.9rem;
}

.login-submit {
  font: inherit;
  font-weight: 700;
  border: 1px solid var(--accent-deep);
  border-radius: 6px;
  padding: 0.65rem 1rem;
  background: var(--accent);
  color: #f5fffe;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.login-submit:hover:not(:disabled) {
  background: var(--accent-deep);
}

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

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

.login-legal {
  margin: 0.85rem 0 0;
  text-align: left;
}

.login-legal a {
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-legal a:hover {
  color: var(--accent);
}

.footer-legal-sep {
  margin: 0 0.35rem;
  color: #9bb0ad;
  font-size: 0.8rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  body.login-page {
    background-size: contain;
    background-position: center top;
    background-image:
      linear-gradient(
        180deg,
        rgba(238, 244, 243, 0.55) 0%,
        rgba(238, 244, 243, 0.82) 48%,
        rgba(238, 244, 243, 0.94) 100%
      ),
      url("/assets/login-hero-evoedge.jpg");
  }

  .login-shell {
    align-content: end;
    padding: 1rem 1rem 1.5rem;
  }

  .login-panel {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .login-panel {
    padding: 1.1rem;
  }
}
