/* =====================================================================
   Login page — split layout: site photo with rotating message on the
   left, sign-in form on the right. Mentek colours: red, black, white.
   ===================================================================== */

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/SourceSerif4-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/SourceSerif4-latin-ext.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

.login-page {
  --lg-red: #d71920;
  --lg-red-dark: #b0141a;
  --lg-ink: #111111;
  --lg-ink-2: #2d2d2d;
  --lg-ink-3: #5c5c5c;
  --lg-ink-4: #8c8c8c;
  --lg-line: #d9d9d9;
  --lg-serif: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  background: #fff;
}

.login-page::before {
  display: none;
}

.login {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 62.5fr) minmax(0, 37.5fr);
}

/* ---------- left: photo + message ---------- */
.login-hero {
  position: relative;
  overflow: hidden;
  color: var(--lg-ink);
  background: #eef0f2;
}

.login-photo,
.login-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.login-photo img {
  object-fit: cover;
  object-position: 72% 50%;
  transform: scale(1.04);
  animation: login-drift 28s cubic-bezier(0.32, 0.72, 0, 1) both;
}

/* white wash from the left so the text reads like on paper */
.login-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.93) 26%, rgba(255, 255, 255, 0.62) 42%, rgba(255, 255, 255, 0.12) 60%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.55) 100%);
  pointer-events: none;
}

.login-hero-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: clamp(36px, 6.4vh, 58px) clamp(28px, 5.5vw, 88px) clamp(36px, 6.6vh, 60px);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 24px;
}

.login-brand img {
  display: block;
  width: auto;
  height: 36px;
}

.login-brand-rule {
  width: 1px;
  height: 40px;
  background: rgba(17, 17, 17, 0.22);
}

.login-brand-product {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.34em;
  color: var(--lg-ink-3);
}

/* rotating message */
.login-slides {
  position: relative;
  flex: 1;
  display: grid;
  align-items: center;
  margin: 32px 0;
}

.login-slide {
  grid-area: 1 / 1;
  max-width: 470px;
  opacity: 0;
  transform: translateY(14px);
  filter: blur(4px);
  transition: opacity 0.9s cubic-bezier(0.32, 0.72, 0, 1), transform 0.9s cubic-bezier(0.32, 0.72, 0, 1), filter 0.9s cubic-bezier(0.32, 0.72, 0, 1);
  pointer-events: none;
}

.login-slide.is-active {
  opacity: 1;
  transform: none;
  filter: none;
  pointer-events: auto;
}

.login-slide h1 {
  margin: 0;
  font-family: var(--lg-serif);
  font-size: clamp(2.5rem, 1.1rem + 2.75vw, 3.5rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.012em;
  color: var(--lg-ink);
}

.login-slide h1 span {
  display: block;
}

.login-slide h1 i {
  font-style: normal;
}

.login-slide .is-red {
  color: var(--lg-red);
}

.login-rule {
  display: block;
  width: 76px;
  height: 2px;
  margin: 26px 0 30px;
  background: var(--lg-red);
}

.login-slide p {
  max-width: 340px;
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--lg-ink-2);
}

.login-hero-foot {
  display: grid;
  gap: 34px;
}

.login-sectors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  letter-spacing: 0.16em;
  color: var(--lg-ink-2);
}

.login-sectors li + li::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 16px;
  margin: 0 22px;
  vertical-align: -3px;
  background: rgba(17, 17, 17, 0.45);
}

/* ---------- right: form ---------- */
.login-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(36px, 6.4vh, 56px) clamp(28px, 5vw, 82px) clamp(32px, 5.6vh, 52px);
  background: #fff;
}

.login-lang {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--lg-ink-2);
}

.login-lang .icon {
  width: 20px;
  height: 20px;
}

.login-lang .login-lang-caret {
  width: 14px;
  height: 14px;
  margin-left: 6px;
}

.login-form-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 438px;
  padding: 32px 0;
}

.login-title {
  margin: 0;
  font-family: var(--lg-serif);
  font-size: clamp(2rem, 1.3rem + 1.3vw, 2.6rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--lg-ink);
}

.login-tagline {
  margin: 14px 0 48px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--lg-ink-3);
}

.login-form-wrap .alert {
  margin-bottom: 22px;
  border-radius: 6px;
  font-size: 13.5px;
}

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

.login-field label {
  display: block;
  margin-bottom: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--lg-ink-2);
}

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

.login-input > .icon {
  position: absolute;
  left: 15px;
  width: 19px;
  height: 19px;
  color: var(--lg-ink-2);
  pointer-events: none;
}

.login-input input {
  width: 100%;
  height: 48px;
  padding: 0 46px 0 47px;
  border: 1px solid var(--lg-line);
  border-radius: 5px;
  font: inherit;
  font-size: 14.5px;
  color: var(--lg-ink);
  background: #fff;
  outline: none;
  transition: border-color 0.3s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.login-input input::placeholder {
  color: var(--lg-ink-4);
}

.login-input input:hover {
  border-color: #bdbdbd;
}

.login-input input:focus {
  border-color: var(--lg-ink);
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.12);
}

.login-eye {
  position: absolute;
  right: 8px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  color: var(--lg-ink-2);
  background: transparent;
}

.login-eye:hover {
  color: var(--lg-red);
}

.login-eye .icon {
  width: 20px;
  height: 20px;
}

.login-eye.is-on {
  color: var(--lg-red);
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -2px;
}

.login-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--lg-ink-2);
  cursor: pointer;
}

.login-check input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--lg-red);
  cursor: pointer;
}

.login-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--lg-red);
  text-decoration: none;
}

.login-link:hover {
  color: var(--lg-red-dark);
  text-decoration: underline;
}

.login-forgot {
  display: none;
  margin: -8px 0 0;
  padding: 10px 12px;
  border-left: 2px solid var(--lg-red);
  font-size: 13px;
  color: var(--lg-ink-2);
  background: #faf6f6;
}

.login-forgot:target {
  display: block;
}

.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  margin-top: 6px;
  border: 0;
  border-radius: 5px;
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  background: var(--lg-red);
  box-shadow: 0 10px 22px -14px rgba(215, 25, 32, 0.9);
  transition: background 0.3s cubic-bezier(0.32, 0.72, 0, 1), transform 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.login-submit .icon {
  width: 17px;
  height: 17px;
  transition: transform 0.45s cubic-bezier(0.34, 1.32, 0.64, 1);
}

.login-submit:hover {
  background: var(--lg-red-dark);
}

.login-submit:hover .icon {
  transform: translateX(3px);
}

.login-submit:active {
  transform: scale(0.99);
}

.login-or {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 26px 0;
  font-size: 13.5px;
  color: var(--lg-ink-3);
}

.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e2e2;
}

.login-sso {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 48px;
  border: 1px solid var(--lg-line);
  border-radius: 5px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--lg-ink);
  background: #fff;
}

.login-sso svg {
  width: 21px;
  height: 21px;
}

.login-sso:disabled {
  cursor: not-allowed;
}

/* development partner: small, in the bottom right corner */
.login-partner {
  position: absolute;
  right: clamp(20px, 2.2vw, 32px);
  bottom: clamp(16px, 2.4vh, 24px);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--lg-ink-4);
}

.login-partner-rule {
  width: 1px;
  height: 18px;
  background: rgba(17, 17, 17, 0.16);
}

.login-partner img {
  display: block;
  width: auto;
  height: 19px;
}

@keyframes login-drift {
  from { transform: scale(1.1); }
  to { transform: scale(1.04); }
}

/* ---------- small screens: photo + message on top, form below ---------- */
@media (max-width: 991.98px) {
  .login {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-hero-inner {
    min-height: 0;
    padding: 28px 20px 26px;
  }

  .login-hero::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.82) 55%, rgba(255, 255, 255, 0.55) 100%);
  }

  .login-brand img {
    height: 28px;
  }

  .login-brand-product {
    font-size: 14px;
  }

  .login-slides {
    margin: 28px 0 22px;
  }

  .login-slide h1 {
    font-size: 2.1rem;
  }

  .login-rule {
    margin: 16px 0 18px;
  }

  .login-slide p {
    font-size: 15px;
  }

  .login-hero-foot {
    gap: 16px;
  }

  .login-sectors {
    font-size: 12px;
  }

  .login-sectors li + li::before {
    margin: 0 12px;
  }

  .login-panel {
    padding: 22px 20px 30px;
  }

  .login-lang {
    display: none;
  }

  .login-form-wrap {
    max-width: none;
    padding: 6px 0 30px;
  }

  .login-tagline {
    margin-bottom: 30px;
    letter-spacing: 0.2em;
  }

  .login-partner {
    position: static;
    align-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-photo img {
    animation: none;
  }

  .login-slide {
    transition: none;
  }
}

/* ---------- desktop: everything fits the window, no page scroll ---------- */
@media (min-width: 992px) {
  html:has(.login-page),
  .login-page {
    height: 100%;
    overflow: hidden;
  }

  .login {
    height: 100dvh;
    min-height: 0;
  }

  .login-hero-inner {
    min-height: 0;
    padding-top: clamp(22px, 5.5vh, 58px);
    padding-bottom: clamp(20px, 5.5vh, 60px);
  }

  .login-brand img {
    height: clamp(26px, 4.2vh, 36px);
  }

  .login-brand-rule {
    height: clamp(28px, 4.6vh, 40px);
  }

  .login-slides {
    margin: clamp(10px, 3vh, 32px) 0;
  }

  .login-slide h1 {
    font-size: min(clamp(2.5rem, 1.1rem + 2.75vw, 3.5rem), 6.4vh);
  }

  .login-rule {
    margin: clamp(12px, 2.8vh, 26px) 0 clamp(14px, 3.2vh, 30px);
  }

  .login-slide p {
    font-size: clamp(14px, 1.95vh, 17px);
  }

  .login-panel {
    padding-top: clamp(18px, 5.2vh, 56px);
    padding-bottom: clamp(44px, 7vh, 64px);
    overflow-y: auto;
    scrollbar-width: none;
  }

  .login-form-wrap {
    padding: clamp(6px, 2.4vh, 32px) 0;
  }

  .login-title {
    font-size: min(clamp(2rem, 1.3rem + 1.3vw, 2.6rem), 5vh);
  }

  .login-tagline {
    margin: clamp(6px, 1.4vh, 14px) 0 clamp(16px, 4.6vh, 48px);
  }

  .login-form {
    gap: clamp(10px, 2.2vh, 22px);
  }

  .login-field label {
    margin-bottom: clamp(4px, 0.9vh, 9px);
  }

  .login-input input,
  .login-submit,
  .login-sso {
    height: clamp(38px, 5.2vh, 48px);
  }

  .login-or {
    margin: clamp(10px, 2.6vh, 26px) 0;
  }
}
