/* Login page, modeled on ximo.app/login. Colors come from the company style tokens. */
* {
  box-sizing: border-box;
}

body.lg-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: hsl(var(--background)) !important;
  color: hsl(var(--foreground));
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
}

.lg {
  width: 100%;
  max-width: 437px;
  margin: auto;
  padding: 48px 16px 40px;
}

.lg-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 30px;
}

.lg-mark {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lg-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.lg-product {
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
}

.lg-tenant {
  overflow: hidden;
  max-width: 55%;
  padding: 8px 14px;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}

.lg-title {
  display: inline-block;
  margin: 0 0 26px;
  padding: 0 0 12px 10px;
  border-left: 3px solid hsl(var(--accent));
  border-bottom: 1px solid hsl(var(--border));
  color: hsl(var(--foreground)) !important;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
}

.lg-form label:not(.lg-check) {
  display: block;
  margin: 0 0 7px;
  color: hsl(var(--foreground));
  font-size: 11.5px;
  font-weight: 600;
}

.lg-field {
  position: relative;
  margin-bottom: 15px;
}

.lg-icon {
  position: absolute;
  top: 50%;
  left: 11px;
  color: hsl(var(--muted-foreground));
  transform: translateY(-50%);
  pointer-events: none;
}

.lg-field input {
  width: 100%;
  height: 38px;
  padding: 0 40px 0 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: hsl(var(--muted)) !important;
  color: hsl(var(--foreground)) !important;
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.lg-field input::placeholder {
  color: hsl(var(--muted-foreground));
  opacity: .8;
}

.lg-field input:focus {
  border-color: hsl(var(--ring) / .55);
  box-shadow: 0 0 0 3px hsl(var(--ring) / .12);
}

.lg-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: hsl(var(--muted-foreground));
  transform: translateY(-50%);
  cursor: pointer;
}

.lg-eye[aria-pressed="true"] {
  color: hsl(var(--primary));
}

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

.lg-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: hsl(var(--foreground));
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.lg-check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: hsl(var(--primary));
}

.lg-forgot {
  color: hsl(var(--primary)) !important;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none !important;
}

.dark-theme .lg-forgot {
  color: hsl(var(--foreground)) !important;
}

.lg-forgot:hover {
  text-decoration: underline !important;
}

.lg-error {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 6px;
  background: hsl(var(--destructive) / .1);
  color: hsl(var(--destructive)) !important;
  font-size: 12.5px;
  font-weight: 600;
}

.lg-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .15);
  transition: filter .15s, transform .08s;
}

.lg-submit:hover {
  filter: brightness(1.1);
}

.lg-submit:active {
  transform: translateY(1px);
}

.lg-submit:disabled {
  cursor: progress;
  opacity: .75;
}

.lg-submit.is-loading svg {
  animation: lg-nudge .7s ease-in-out infinite alternate;
}

@keyframes lg-nudge {
  to { transform: translateX(4px); }
}

.lg-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 18px;
  color: hsl(var(--muted-foreground));
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.lg-divider::before,
.lg-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid hsl(var(--border));
}

.lg-alt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 36px;
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.lg-alt:hover {
  border-color: hsl(var(--primary) / .5);
  color: hsl(var(--foreground));
}

.lg-alt[hidden] {
  display: none;
}

.lg-hint {
  margin: 10px 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  text-align: center;
}

.lg-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
  padding: 0 14px env(safe-area-inset-bottom, 0px);
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  font-weight: 500;
}

.lg-status strong {
  color: hsl(var(--foreground));
}

.lg-status a {
  color: inherit !important;
  text-decoration: none !important;
}

@media (max-width: 480px) {
  .lg {
    padding-top: 32px;
  }

  /* 16px avoids iOS zooming into the fields */
  .lg-field input {
    height: 44px;
    font-size: 16px;
  }

  .lg-submit {
    height: 44px;
    font-size: 14px;
  }

  .lg-alt {
    height: 42px;
  }
}
