:root {
  --lm-orange: #f07a1a;
  --lm-orange-deep: #d94a12;
  --lm-panel: rgb(18 28 36 / 0.85);
  --lm-panel-border: rgb(255 255 255 / 0.28);
  --lm-text: #f5f8fc;
  --lm-muted: #c7d2dc;
  --lm-field: rgb(8 14 20 / 0.72);
  --lm-line: rgb(255 255 255 / 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--lm-text);
  background: #141820 url("../../../assets/images/bg.jpg") center / cover no-repeat fixed;
}

.lm-login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 28px 16px 36px;
  background: linear-gradient(180deg, rgb(8 12 18 / 0.18), rgb(8 12 18 / 0.42));
}

.lm-brand {
  display: flex;
  justify-content: center;
}

.lm-brand img {
  display: block;
}

.lm-login-card {
  width: min(400px, 100%);
  border-radius: 18px;
  padding: 28px 28px 24px;
  border: 2px solid var(--lm-panel-border);
  background: var(--lm-panel);
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.35);
}

.lm-panel-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 0;
  position: relative;
}

.lm-panel-title {
  margin: 0;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.01em;
}

.lm-otp-actions {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.lm-back-btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--lm-panel-border);
  border-radius: 999px;
  background: transparent;
  color: var(--lm-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.lm-back-btn:hover,
.lm-back-btn:focus-visible {
  border-color: #fff;
  outline: none;
}

.lm-error {
  display: none;
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgb(170 40 48 / 0.85);
  color: #fff;
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
}

.lm-error.is-visible {
  display: block;
}

.lm-error.is-success {
  background: rgb(34 120 70 / 0.85);
}

.lm-form {
  margin-top: 18px;
}

.lm-login-section,
.lm-otp-section {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.step-hidden {
  display: none !important;
}

.lm-field {
  position: relative;
  margin-top: 14px;
}

.lm-field:first-child {
  margin-top: 0;
}

.lm-field input {
  width: 100%;
  height: 52px;
  border: 1px solid rgb(255 255 255 / 0.55);
  border-radius: 12px;
  padding: 0 46px 0 46px;
  font-size: 16px;
  color: #fff;
  background: var(--lm-field);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lm-field input::placeholder {
  color: rgb(210 220 230 / 0.72);
}

.lm-field input:focus {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgb(240 122 26 / 0.25);
}

.lm-field-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #fff;
  pointer-events: none;
}

.lm-toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: rgb(220 230 240 / 0.85);
  cursor: pointer;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lm-toggle-password:hover,
.lm-toggle-password:focus-visible {
  color: #fff;
  outline: none;
}

.lm-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 14px;
  font-size: 14px;
}

.lm-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--lm-text);
  cursor: pointer;
  user-select: none;
}

.lm-shortcut input {
  width: 16px;
  height: 16px;
  accent-color: var(--lm-orange);
}

.lm-submit {
  margin-top: 18px;
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(90deg, #f08a1d 0%, #ef6a16 42%, #e24a12 100%);
  box-shadow:
    0 2px 0 rgb(255 255 255 / 0.22) inset,
    0 10px 22px rgb(180 60 10 / 0.35);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.lm-submit:hover {
  filter: brightness(1.05);
}

.lm-submit:active {
  transform: translateY(1px);
}

.lm-submit:focus-visible {
  outline: 3px solid rgb(240 122 26 / 0.45);
  outline-offset: 2px;
}

.lm-submit:disabled,
.lm-submit.is-loading {
  opacity: 0.85;
  cursor: wait;
  pointer-events: none;
}

.lm-submit-arrow {
  font-size: 20px;
  line-height: 1;
}

.lm-submit .btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lm-btn-spin 0.7s linear infinite;
}

@keyframes lm-btn-spin {
  to {
    transform: rotate(360deg);
  }
}

.lm-otp-label {
  margin: 4px 0 12px;
  color: var(--lm-text);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.otp-inputs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.otp-digit {
  width: 100%;
  height: 48px;
  border: 1px solid rgb(255 255 255 / 0.55);
  border-radius: 10px;
  background: var(--lm-field);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  outline: none;
}

.otp-digit:focus {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgb(240 122 26 / 0.25);
}

.otp-resend-row {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 14px;
}

.otp-resend-link {
  border: 0;
  background: transparent;
  color: #7ec8ff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.otp-resend-link:disabled,
.otp-resend-link[disabled] {
  color: rgb(180 190 200 / 0.7);
  cursor: not-allowed;
}

.lm-features {
  /* Mock: bottom bar is only a bit wider than the login card, not full-bleed. */
  width: min(460px, 100%);
  display: flex;
  align-items: stretch;
  border-radius: 14px;
  border: 2px solid var(--lm-panel-border);
  background: var(--lm-panel);
  box-shadow: 0 14px 34px rgb(0 0 0 / 0.28);
  overflow: hidden;
}

.lm-feature {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 14px 18px;
  text-align: center;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}

.lm-feature:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 0;
  bottom: 14px;
  width: 1px;
  background: linear-gradient(
    180deg,
    rgb(255 255 255 / 0) 0%,
    rgb(255 255 255 / 0.28) 18%,
    rgb(255 255 255 / 0.28) 82%,
    rgb(255 255 255 / 0) 100%
  );
}

.lm-feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
}

.lm-feature-icon img {
  display: block;
  width: auto;
  height: 28px;
  max-width: 36px;
  object-fit: contain;
  /* White/cyan icons on black plates */
  mix-blend-mode: screen;
}

@media (max-width: 760px) {
  .lm-login-page {
    gap: 20px;
    padding: 20px 12px 28px;
    justify-content: flex-start;
  }

  .lm-panel-title {
    font-size: 24px;
  }

  .lm-login-card {
    padding: 22px 18px 20px;
  }

  .lm-features {
    flex-wrap: wrap;
  }

  .lm-feature {
    flex: 1 1 45%;
  }

  .lm-feature:not(:last-child)::after {
    display: none;
  }

  .lm-feature:nth-child(odd)::after {
    display: block;
    top: 14px;
    right: 0;
    bottom: 14px;
    width: 1px;
    height: auto;
    background: linear-gradient(
      180deg,
      rgb(255 255 255 / 0) 0%,
      rgb(255 255 255 / 0.28) 18%,
      rgb(255 255 255 / 0.28) 82%,
      rgb(255 255 255 / 0) 100%
    );
  }

  .lm-feature:nth-child(-n + 2)::before {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(
      90deg,
      rgb(255 255 255 / 0) 0%,
      rgb(255 255 255 / 0.28) 18%,
      rgb(255 255 255 / 0.28) 82%,
      rgb(255 255 255 / 0) 100%
    );
  }
}

@media (max-width: 480px) {
  .lm-feature {
    flex: 1 1 100%;
  }

  .lm-feature:nth-child(odd)::after {
    display: none;
  }

  .lm-feature:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(
      90deg,
      rgb(255 255 255 / 0) 0%,
      rgb(255 255 255 / 0.28) 18%,
      rgb(255 255 255 / 0.28) 82%,
      rgb(255 255 255 / 0) 100%
    );
  }
}
