/*
 * Login page (index.php). Linked by that page only.
 *
 * Design: docs/login-page-design (ui.jpg). Brand green #1F4B2A, lime #E1EA75.
 * The ids js/connect.js reads (#username, #password, #login, #error) are
 * unchanged in the markup; this file only styles them.
 */

:root {
  --hc-login-green: #1f4b2a;
  --hc-login-lime: #e1ea75;
  --hc-login-lime-hover: #d4de5c;
  --hc-login-ink: #16241a;
  --hc-login-muted: #8a9290;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body.hc-login {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 56px 16px 20px;
  font-family: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
  color: #fff;
  background: #7a9a4a url('../images/login/login-bg.webp?v3') center bottom / cover no-repeat fixed;
  -webkit-font-smoothing: antialiased;
}

.hc-login-main {
  display: flex;
  flex: 1 0 auto;
  align-items: flex-start;
  justify-content: center;
}

.hc-login-card {
  width: 100%;
  max-width: 440px;
  padding: 56px 52px 60px;
  text-align: center;
  background: var(--hc-login-green);
  border-radius: 32px;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.28),
    0 8px 20px rgba(0, 0, 0, 0.18);
}

.hc-login-logo {
  display: block;
  width: 136px;
  height: auto;
  margin: 0 auto;
}

.hc-login-title {
  margin: 36px 0 30px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: #fff;
}

.hc-login-form {
  margin: 0;
}

.hc-login-field {
  margin: 0 0 10px;
}

.hc-login-field input {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 22px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--hc-login-ink);
  background: #fff;
  border: 2px solid var(--hc-login-lime);
  border-radius: 999px;
  outline: none;
  transition: box-shadow 0.15s ease;
}

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

.hc-login-field input:focus {
  box-shadow: 0 0 0 4px rgba(225, 234, 117, 0.35);
}

.hc-login-card #login {
  display: block;
  width: 100%;
  max-width: 236px;
  height: 48px;
  margin: 32px auto 0;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  color: var(--hc-login-ink);
  cursor: pointer;
  background: var(--hc-login-lime);
  border: 0;
  border-radius: 999px;
  transition:
    background 0.15s ease,
    transform 0.1s ease;
}

.hc-login-card #login:hover {
  background: var(--hc-login-lime-hover);
}

.hc-login-card #login:active {
  transform: translateY(1px);
}

.hc-login-card #login:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.hc-login-card #login:disabled {
  cursor: wait;
  opacity: 0.8;
}

.hc-login-card .msg,
.hc-login-card #error,
.hc-login-card #output {
  display: block;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.hc-login-card #error:not(:empty) {
  margin-top: 18px;
}

.hc-login-footer {
  flex-shrink: 0;
  padding-top: 28px;
  text-align: center;
}

.hc-login-footer p {
  margin: 0;
  font-size: 12px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

/* Big or high-density screens (4K, retina laptops): the 3840px copy. */
@media (min-width: 1921px), (min-width: 1200px) and (min-resolution: 1.5dppx) {
  body.hc-login {
    background-image: url('../images/login/login-bg-xl.webp?v3');
  }
}

/* Phones: the portrait crop of the photo, tighter card. */
@media (max-width: 767.98px) {
  body.hc-login {
    padding-top: 32px;
    background-image: url('../images/login/login-bg-sm.webp?v3');
    background-attachment: scroll;
  }
  .hc-login-card {
    padding: 40px 24px 44px;
    border-radius: 28px;
  }
  .hc-login-logo {
    width: 116px;
  }
  .hc-login-title {
    margin: 28px 0 24px;
    font-size: 18px;
  }
}

/* Short screens (landscape phone, small laptop): smaller logo and gaps, the page scrolls. */
@media (max-height: 640px) {
  body.hc-login {
    padding-top: 20px;
  }
  .hc-login-card {
    padding-top: 32px;
    padding-bottom: 36px;
  }
  .hc-login-logo {
    width: 96px;
  }
  .hc-login-title {
    margin: 20px 0 18px;
  }
  .hc-login-card #login {
    margin-top: 22px;
  }
}
