* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-width: 320px;
  background: #fff;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  background: #fff;
  color: #101010;
  font-family: 'Urbanist', sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(520px, 1fr);
  min-height: 100vh;
  min-height: 100svh;
}

.login-visual {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(12, 12, 12, 0.08), rgba(12, 12, 12, 0.72)),
    url('images/login.jpeg?v=ai-20260827') center/cover no-repeat;
}

.login-back {
  position: absolute;
  top: 28px;
  left: 28px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  backdrop-filter: blur(8px);
  transition: background 180ms ease, transform 180ms ease;
}

.login-back:hover,
.login-back:focus-visible {
  background: rgba(0, 0, 0, 0.55);
  transform: translateX(-2px);
}

.login-visual__brand {
  position: absolute;
  right: 44px;
  bottom: 42px;
  left: 44px;
  color: #fff;
}

.login-visual__brand a {
  display: inline-block;
  margin-bottom: 6px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 700;
}

.login-visual__brand p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: clamp(40px, 7vw, 90px);
  background: #fff;
}

.login-card {
  width: min(100%, 520px);
}

.login-mobile-brand {
  display: none;
}

.login-heading {
  margin-bottom: 42px;
}

.login-heading h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 2.7rem);
  line-height: 1.15;
}

.login-heading p {
  color: #3a3a3a;
  font-size: 0.98rem;
}

.login-heading a,
.forgot-link {
  color: #183f34;
  font-weight: 700;
}

.login-heading a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-heading a:hover,
.forgot-link:hover {
  text-decoration: underline;
}

#loginForm {
  display: grid;
  gap: 22px;
}

.input-group {
  display: grid;
  gap: 9px;
  color: #111;
  font-size: 0.88rem;
  font-weight: 700;
}

.input-group > input,
.password-field {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  border: 1px solid #bdbdbd;
  border-radius: 8px;
  background: #fff;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.input-group > input {
  padding: 0 18px;
}

.input-group > input:focus,
.password-field:focus-within {
  border-color: #183f34;
  box-shadow: 0 0 0 3px rgba(47, 95, 79, 0.12);
  outline: 0;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.password-field input {
  min-width: 0;
  height: 56px;
  padding: 0 8px 0 18px;
  border: 0;
  outline: 0;
}

.password-toggle {
  min-width: 54px;
  height: 38px;
  margin-right: 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #2f2f2f;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.password-toggle:hover {
  background: #f1f1f1;
  color: #101010;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #303030;
  font-size: 0.86rem;
}

.remember-option {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.remember-option input {
  width: 18px;
  height: 18px;
  accent-color: #101010;
}

.login-submit {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  background: #171717;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms ease;
}

.login-submit:hover {
  background: #2f5f4f;
}

.login-submit:disabled,
.social-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 34px 0;
  color: #777;
  font-size: 0.86rem;
}

.divider::before,
.divider::after {
  height: 1px;
  background: #dedede;
  content: '';
}

.social-login {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid #bdbdbd;
  border-radius: 8px;
  background: #fff;
  color: #111;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.social-btn:hover {
  border-color: #9e9e9e;
  background: #f7f7f7;
}

.social-btn__icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.social-btn__icon--apple {
  width: 21px;
  height: 21px;
}

.login-terms {
  max-width: 420px;
  margin: 28px auto 0;
  color: #555;
  font-size: 0.74rem;
  line-height: 1.6;
  text-align: center;
}

.auth-message {
  padding: 11px 13px;
  border-radius: 6px;
  background: #edf5f1;
  color: #285040;
  font-size: 0.82rem;
  text-align: center;
}

.auth-message--error {
  background: #fff0f1;
  color: #a3192a;
}

@media (max-width: 980px) {
  .login-layout {
    grid-template-columns: minmax(320px, 0.85fr) minmax(460px, 1.15fr);
  }

  .login-panel {
    padding: 48px 38px;
  }
}

@media (max-width: 760px) {
  .login-layout {
    display: block;
  }

  .login-visual {
    min-height: 220px;
    background-position: center 46%;
  }

  .login-visual__brand {
    display: none;
  }

  .login-back {
    top: 18px;
    left: 18px;
    width: 44px;
    height: 44px;
  }

  .login-panel {
    min-height: calc(100svh - 220px);
    padding: 38px 24px 48px;
  }

  .login-mobile-brand {
    display: inline-block;
    margin-bottom: 24px;
    font-size: 1.5rem;
    font-weight: 700;
  }

  .login-heading {
    margin-bottom: 32px;
  }
}

@media (max-width: 520px) {
  .login-visual {
    min-height: 180px;
  }

  .login-panel {
    min-height: calc(100svh - 180px);
    padding: 32px 18px 42px;
  }

  .login-heading h1 {
    font-size: 1.9rem;
  }

  .login-options {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .social-login {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .login-panel {
    padding: 28px 14px 38px;
  }

  .login-heading {
    margin-bottom: 26px;
  }

  .login-heading h1 {
    font-size: 1.72rem;
    overflow-wrap: anywhere;
  }

  .input-group > input,
  .password-field,
  .login-submit,
  .social-btn {
    min-height: 52px;
  }

  .password-field input {
    height: 50px;
  }

  .password-toggle {
    min-width: 46px;
    margin-right: 6px;
    font-size: 0.72rem;
  }
}

.login-terms a {
  color: #183f34;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}