@font-face {
  font-family: "Montserrat";
  src: url("./fonts/Montserrat-VariableFont_wght.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --login-card: #ece5d3;
  --login-text: #302d29;
  --login-muted: #74716c;
  --login-border: #c9c0ad;
  --login-accent: #ba9e76;
  --login-accent-hover: #a88b64;
  --font-sans: "Montserrat", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--login-text);
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

button,
input {
  font: inherit;
}

.login-page {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  padding: 48px 24px;
  background:
    linear-gradient(rgba(1, 23, 30, 0.12), rgba(5, 11, 9, 0.3)),
    url("./img/login-background.png") center / cover no-repeat;
}

.login-home-link {
  position: absolute;
  top: 32px;
  left: 32px;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #d2d2d2;
  color: #5e5e5e;
  transition:
    background-color 160ms ease,
    transform 160ms ease;
}

.login-home-link:hover {
  background: #e0e0e0;
  transform: translateX(-2px);
}

.login-home-link svg {
  width: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.login-card {
  position: relative;
  width: min(100%, 490px);
  min-height: 660px;
  border-radius: 18px;
  background: var(--login-card);
  padding: 70px 44px 54px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.22);
}

.login-card--compact {
  min-height: 0;
  padding-bottom: 50px;
}

.login-close {
  position: absolute;
  top: 24px;
  right: 24px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #646464;
}

.login-close svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.login-card h1 {
  margin: 0 0 36px;
  font-size: clamp(2rem, 3vw, 2.45rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.login-intro {
  margin: -22px 0 30px;
  color: var(--login-muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

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

.login-field {
  display: grid;
  gap: 8px;
}

.login-field label,
.login-password-toggle {
  color: var(--login-muted);
  font-size: 0.93rem;
}

.login-field > input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--login-border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--login-text);
  padding: 12px 15px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.login-field > input:hover {
  border-color: #b5aa95;
}

.login-field > input:focus {
  border-color: #9b805e;
  box-shadow: 0 0 0 3px rgba(186, 158, 118, 0.18);
  outline: none;
}

.login-password-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-password-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0 7px;
}

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

.login-submit {
  min-height: 51px;
  border: 0;
  border-radius: 7px;
  background: var(--login-accent);
  color: #fff;
  cursor: pointer;
  padding: 13px 30px;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  transition:
    background-color 160ms ease,
    transform 160ms ease;
}

.login-submit:hover {
  background: var(--login-accent-hover);
  transform: translateY(-1px);
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.login-remember {
  display: grid;
  grid-template-columns: 18px auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
}

.login-remember input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #2f2d29;
}

.login-forgot {
  color: #6d6459;
  font-size: 0.78rem;
  font-weight: 600;
}

.login-message {
  display: none;
  margin: -10px 0 0;
  font-size: 0.86rem;
  line-height: 1.4;
}

.login-message:not(:empty) {
  display: block;
}

.login-message.is-error {
  color: #9a3e35;
}

.login-message.is-success {
  color: #617456;
}

.login-signup {
  margin: 70px 0 0;
  color: var(--login-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.login-signup--compact {
  margin-top: 42px;
}

.login-signup a {
  color: var(--login-text);
  font-weight: 600;
}

.login-home-link:focus-visible,
.login-close:focus-visible,
.login-password-toggle:focus-visible,
.login-submit:focus-visible,
.login-field input:focus-visible,
.login-signup a:focus-visible {
  outline: 3px solid rgba(236, 229, 211, 0.52);
  outline-offset: 3px;
}

@media (max-width: 600px) {
  .login-page {
    align-items: center;
    padding: 84px 18px 30px;
  }

  .login-home-link {
    top: 18px;
    left: 18px;
    width: 46px;
    height: 46px;
  }

  .login-card {
    min-height: 0;
    padding: 62px 28px 42px;
  }

  .login-signup {
    margin-top: 52px;
  }
}

@media (max-height: 760px) and (min-width: 601px) {
  .login-card {
    min-height: 0;
    padding-top: 58px;
    padding-bottom: 42px;
  }

  .login-card h1 {
    margin-bottom: 28px;
  }

  .login-form {
    gap: 22px;
  }

  .login-signup {
    margin-top: 42px;
  }
}
