:root {
  color-scheme: light;
  --sensor-green: #0b5d3b;
  --sensor-green-dark: #07462d;
  --sensor-green-soft: #e8f2ed;
  --text-primary: #17231e;
  --text-secondary: #53615a;
  --border: #9ca9a2;
  --surface: rgba(255, 255, 255, 0.97);
  --focus-ring: rgba(11, 93, 59, 0.28);
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
  font-weight: 400;
  font-synthesis: none;
}

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

html {
  min-width: 320px;
  min-height: 100%;
  background: #eef2ef;
}

body {
  margin: 0;
}

button,
input {
  font: inherit;
}

.login-page {
  position: relative;
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  flex-direction: column;
  overflow-x: hidden;
  color: var(--text-primary);
  background-image: url("../images/login/login-background.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.login-page::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  background: rgba(245, 248, 246, 0.1);
  content: "";
  pointer-events: none;
}

.login-main {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  flex: 1;
  place-items: center;
  padding: 20px 16px;
}

.login-card {
  width: min(calc(100% - 32px), 480px);
  padding: 36px 44px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(24, 48, 37, 0.16), 0 3px 12px rgba(24, 48, 37, 0.08);
}

.login-header {
  margin-bottom: 24px;
  text-align: center;
}

.login-logo {
  display: block;
  width: min(100%, 280px);
  height: auto;
  margin: 0 auto 20px;
}

.login-header h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(1.55rem, 2.2vw, 1.78rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.study-name {
  margin: 4px 0 0;
  color: var(--sensor-green);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
}

.login-description {
  max-width: 340px;
  margin: 8px auto 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 16px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label {
  color: var(--text-primary);
  font-size: 0.91rem;
  font-weight: 500;
}

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

.field-icon {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  color: #56635d;
  pointer-events: none;
}

.input-control input {
  width: 100%;
  min-height: 48px;
  padding: 11px 46px 11px 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  background: #fff;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input-control input::placeholder {
  color: #6d7973;
  opacity: 1;
}

.input-control input:hover {
  border-color: #728078;
}

.input-control input:focus-visible {
  border-color: var(--sensor-green);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.password-toggle {
  position: absolute;
  right: 2px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4f5d56;
  cursor: pointer;
}

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

.password-toggle:focus-visible,
.remember-option input:focus-visible,
.forgot-link:focus-visible,
.site-footer a:focus-visible {
  outline: 3px solid var(--sensor-green);
  outline-offset: 3px;
}

.password-toggle svg {
  width: 21px;
  height: 21px;
}

.password-toggle .eye-closed,
.password-toggle[aria-pressed="true"] .eye-open {
  display: none;
}

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

.form-options {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.9rem;
}

.remember-option {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 400;
}

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

.forgot-link,
.site-footer a {
  color: #075235;
  font-weight: 500;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.forgot-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  text-align: right;
}

.forgot-link:hover,
.site-footer a:hover {
  color: var(--sensor-green-dark);
  text-decoration-thickness: 2px;
}

.submit-button {
  display: flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border: 2px solid var(--sensor-green);
  border-radius: 10px;
  background: var(--sensor-green);
  box-shadow: 0 7px 18px rgba(11, 93, 59, 0.2);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 100ms ease;
}

.submit-button svg {
  width: 21px;
  height: 21px;
}

.submit-button:hover {
  border-color: var(--sensor-green-dark);
  background: var(--sensor-green-dark);
  box-shadow: 0 9px 22px rgba(7, 70, 45, 0.24);
}

.submit-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--sensor-green), 0 9px 22px rgba(7, 70, 45, 0.22);
}

.submit-button:active {
  transform: translateY(1px);
  box-shadow: 0 3px 10px rgba(7, 70, 45, 0.2);
}

.private-notice {
  display: flex;
  margin: -1px 0 0;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: center;
}

.private-notice svg {
  width: 17px;
  min-width: 17px;
  height: 17px;
  color: var(--sensor-green);
}

.form-status {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #a8c8b7;
  border-radius: 8px;
  background: #eff7f2;
  color: #174d33;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}

.form-status:empty {
  display: none;
}

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 12px 16px 18px;
  color: #39463f;
  font-size: 0.79rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
}

.site-footer p {
  display: flex;
  min-height: 44px;
  align-items: center;
  margin: 0;
}

.site-footer p:last-child {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.site-footer a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

@media (max-width: 768px) {
  .login-main {
    padding: 17px 0;
  }

  .login-card {
    width: calc(100% - 32px);
    padding: 30px 26px;
    border-radius: 16px;
  }

  .login-logo {
    width: min(100%, 250px);
    margin-bottom: 18px;
  }

  .site-footer {
    padding-bottom: 14px;
  }
}

@media (max-width: 430px) {
  .login-card {
    padding: 28px 22px;
  }

  .login-header {
    margin-bottom: 20px;
  }

  .login-header h1 {
    font-size: 1.5rem;
  }

  .study-name {
    font-size: 1.2rem;
  }

  .form-options {
    align-items: flex-start;
    gap: 8px;
  }

  .site-footer {
    flex-direction: column;
    gap: 2px;
  }
}

@media (max-height: 760px) and (min-width: 769px) {
  .login-main {
    padding-top: 13px;
    padding-bottom: 13px;
  }

  .login-card {
    padding-top: 30px;
    padding-bottom: 30px;
  }

  .login-header {
    margin-bottom: 18px;
  }

  .login-logo {
    width: 250px;
    margin-bottom: 14px;
  }

  .login-form {
    gap: 13px;
  }
}

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